SigPack - the C++ signal processing library
Filter

Classes

class  sp::FIR_filt< T1, T2, T3 >
 
class  sp::IIR_filt< T1, T2, T3 >
 

Functions

arma_inline arma::vec sp::fir1 (const arma::uword M, const double f0)
 
arma_inline arma::vec sp::fir1_hp (const arma::uword M, const double f0)
 
arma_inline arma::vec sp::fir1_bp (const arma::uword M, const double f0, const double f1)
 
arma_inline arma::vec sp::fir1_bs (const arma::uword M, const double f0, const double f1)
 
arma_inline arma::vec sp::fd_filter (const arma::uword M, double fd)
 
arma_inline arma::cx_vec sp::freq (const arma::vec b, const arma::vec a, const arma::uword K=512)
 
arma_inline arma::vec sp::freqz (const arma::vec b, const arma::vec a, const arma::uword K=512)
 
arma_inline arma::vec sp::phasez (const arma::vec b, const arma::vec a, const arma::uword K=512)
 

Detailed Description

Function Documentation

◆ fd_filter()

arma_inline arma::vec sp::fd_filter ( const arma::uword  M,
double  fd 
)

Fractional delay function. Fractional delay filter design using windowed sinc method. Actual delay is M/2+fd samples for even nr of taps and (M-1)/2+fd for odd nr of taps Best performance if -1 < fd < 1.

Parameters
MFilter length
fdFractional delay

Definition at line 716 of file filter.h.

References sp::blackmanharris(), sp::FIR_filt< T1, T2, T3 >::M, and sp::sinc().

Here is the call graph for this function:

◆ fir1()

arma_inline arma::vec sp::fir1 ( const arma::uword  M,
const double  f0 
)

FIR lowpass design function. FIR lowpassdesign using windows method (hamming window). NB! Returns size M+1.

Filter design functions

Returns
b Filter coefficients \( [b_0 ..b_N] \)
Parameters
MFilter order
f0Filter cutoff frequency in interval [0..1]
Examples:
filter_plot.cpp, and fir_iir.cpp.

Definition at line 607 of file filter.h.

References sp::FIR_filt< T1, T2, T3 >::b, sp::hamming(), and sp::sinc().

Referenced by main(), and sp::resampling< T1 >::resampling().

Here is the call graph for this function:

◆ fir1_bp()

arma_inline arma::vec sp::fir1_bp ( const arma::uword  M,
const double  f0,
const double  f1 
)

FIR bandpass design function. FIR design using windows method (hamming window). NB! Returns size M+1.

Returns
b Filter coefficients \( [b_0 ..b_N] \)
Parameters
MFilter order
f0Filter low cutoff frequency in interval [0..1]
f1Filter high cutoff frequency in interval [0..1]

Definition at line 655 of file filter.h.

References sp::FIR_filt< T1, T2, T3 >::b, err_handler, sp::hamming(), sp::PI, and sp::sinc().

Here is the call graph for this function:

◆ fir1_bs()

arma_inline arma::vec sp::fir1_bs ( const arma::uword  M,
const double  f0,
const double  f1 
)

FIR bandstop design function. FIR design using windows method (hamming window). NB! Returns size M+1.

Returns
b Filter coefficients \( [b_0 ..b_N] \)
Parameters
MFilter order (must be even)
f0Filter low cutoff frequency in interval [0..1]
f1Filter high cutoff frequency in interval [0..1]

Definition at line 688 of file filter.h.

References sp::FIR_filt< T1, T2, T3 >::b, err_handler, sp::hamming(), and sp::sinc().

Here is the call graph for this function:

◆ fir1_hp()

arma_inline arma::vec sp::fir1_hp ( const arma::uword  M,
const double  f0 
)

FIR highpass design function. FIR design using windows method (hamming window). NB! Returns size M+1.

Returns
b Filter coefficients \( [b_0 ..b_N] \)
Parameters
MFilter order (must be even)
f0Filter cutoff frequency in interval [0..1]

Definition at line 626 of file filter.h.

References sp::FIR_filt< T1, T2, T3 >::b, err_handler, sp::hamming(), sp::PI, and sp::sinc().

Here is the call graph for this function:

◆ freq()

arma_inline arma::cx_vec sp::freq ( const arma::vec  b,
const arma::vec  a,
const arma::uword  K = 512 
)

Frequency response function. Calculates the frequency response.

Parameters
bFIR/MA filter coefficients
aIIR/AR filter coefficients
KNumber of evaluation points, Default 512

Definition at line 738 of file filter.h.

References sp::FIR_filt< T1, T2, T3 >::b, sp::FIR_filt< T1, T2, T3 >::K, sp::FIR_filt< T1, T2, T3 >::M, and sp::PI.

Referenced by sp::freqz(), and sp::phasez().

◆ freqz()

arma_inline arma::vec sp::freqz ( const arma::vec  b,
const arma::vec  a,
const arma::uword  K = 512 
)

Frequency magnitude response function. Calculates the frequency magnitude response.

Parameters
bFIR/MA filter coefficients
aIIR/AR filter coefficients
KNumber of evaluation points, Default 512
Examples:
filter_plot.cpp.

Definition at line 765 of file filter.h.

References sp::freq(), and sp::FIR_filt< T1, T2, T3 >::K.

Referenced by main().

Here is the call graph for this function:

◆ phasez()

arma_inline arma::vec sp::phasez ( const arma::vec  b,
const arma::vec  a,
const arma::uword  K = 512 
)

Frequency phase response function. Calculates the frequency phase response.

Parameters
bFIR/MA filter coefficients
aIIR/AR filter coefficients
KNumber of evaluation points, Default 512
Examples:
filter_plot.cpp.

Definition at line 779 of file filter.h.

References sp::angle(), sp::freq(), and sp::FIR_filt< T1, T2, T3 >::K.

Referenced by main().

Here is the call graph for this function: