SigPack - the C++ signal processing library
sp::resampling< T1 > Class Template Reference

#include <resampling.h>

Collaboration diagram for sp::resampling< T1 >:
Collaboration graph

Public Member Functions

 resampling (const arma::uword _P, const arma::uword _Q, const arma::vec _H)
 
 resampling (const arma::uword _P, const arma::uword _Q)
 
 ~resampling ()
 
void downfir (const arma::Col< T1 > &in, arma::Col< T1 > &out)
 
void upfir (const arma::Col< T1 > &in, arma::Col< T1 > &out)
 
void upfirdown (const arma::Col< T1 > &in, arma::Col< T1 > &out)
 

Private Attributes

FIR_filt< T1, double, T1 > aa_filt
 
arma::vec H
 
arma::vec K
 
arma::uword P
 
arma::uword Q
 

Detailed Description

template<class T1>
class sp::resampling< T1 >

Implements up/downsampling functions

Definition at line 53 of file resampling.h.

Constructor & Destructor Documentation

◆ resampling() [1/2]

template<class T1 >
sp::resampling< T1 >::resampling ( const arma::uword  _P,
const arma::uword  _Q,
const arma::vec  _H 
)
inline

Constructor.

Parameters
_PUpsampling rate
_QDownsampling rate
_HFIR filter coefficients

Definition at line 69 of file resampling.h.

References sp::FIR_filt< T1, T2, T3 >::set_coeffs().

Here is the call graph for this function:

◆ resampling() [2/2]

template<class T1 >
sp::resampling< T1 >::resampling ( const arma::uword  _P,
const arma::uword  _Q 
)
inline

Constructor using a fir1 filter with 8*M+1 taps and cutoff 1/M where M=max(P,Q)

Parameters
_PUpsampling rate
_QDownsampling rate

Definition at line 84 of file resampling.h.

References sp::fir1(), sp::resampling< T1 >::Q, and sp::FIR_filt< T1, T2, T3 >::set_coeffs().

Here is the call graph for this function:

◆ ~resampling()

template<class T1 >
sp::resampling< T1 >::~resampling ( )
inline

Destructor.

Definition at line 97 of file resampling.h.

Member Function Documentation

◆ downfir()

template<class T1 >
void sp::resampling< T1 >::downfir ( const arma::Col< T1 > &  in,
arma::Col< T1 > &  out 
)
inline

Downsampling with anti alias filter.

Parameters
inInput vector
outOutput vector

Definition at line 105 of file resampling.h.

References sp::resampling< T1 >::aa_filt, and sp::resampling< T1 >::Q.

◆ upfir()

template<class T1 >
void sp::resampling< T1 >::upfir ( const arma::Col< T1 > &  in,
arma::Col< T1 > &  out 
)
inline

Upsampling with anti alias filter.

Parameters
inInput vector
outOutput vector

Definition at line 122 of file resampling.h.

References sp::resampling< T1 >::aa_filt.

◆ upfirdown()

template<class T1 >
void sp::resampling< T1 >::upfirdown ( const arma::Col< T1 > &  in,
arma::Col< T1 > &  out 
)
inline

Resampling by a rational P/Q with anti alias filtering.

The caller needs to allocate the input and output vector so that length(out)==length(in)*P/Q

Parameters
inInput vector
outOutput vector

Definition at line 142 of file resampling.h.

References sp::resampling< T1 >::aa_filt, and sp::resampling< T1 >::Q.

Member Data Documentation

◆ aa_filt

template<class T1 >
FIR_filt<T1, double, T1> sp::resampling< T1 >::aa_filt
private

◆ H

template<class T1 >
arma::vec sp::resampling< T1 >::H
private

Filter coefficients.

Definition at line 57 of file resampling.h.

◆ K

template<class T1 >
arma::vec sp::resampling< T1 >::K
private

Number of filter coefficients.

Definition at line 58 of file resampling.h.

◆ P

template<class T1 >
arma::uword sp::resampling< T1 >::P
private

Upsampling rate.

Definition at line 59 of file resampling.h.

◆ Q

template<class T1 >
arma::uword sp::resampling< T1 >::Q
private

The documentation for this class was generated from the following file: