gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
FIR Class Reference

#include <FIR.H>

Public Member Functions

 FIR ()
 Constructor. More...
 
void init (unsigned int blockSize)
 
int loadTimeDomainCoefficients (const std::string fileName)
 
void loadTimeDomainCoefficients (const Eigen::Matrix< FP_TYPE, Eigen::Dynamic, Eigen::Dynamic > hIn)
 
template<typename Derived , typename DerivedOther >
void filter (const Eigen::MatrixBase< Derived > &input, Eigen::DenseBase< DerivedOther > const &output)
 

Protected Attributes

unsigned int N
 Block size of the audio subsystem. More...
 
Eigen::Matrix< FP_TYPE, Eigen::Dynamic, Eigen::Dynamic > y
 the time domain output signal More...
 

Private Member Functions

void resetDFT ()
 

Private Attributes

Eigen::FFT< FP_TYPEfft
 The fast Fourier transform. More...
 
Eigen::Array< Eigen::FFT< FP_TYPE >::Complex, Eigen::Dynamic, Eigen::Dynamic > H
 The DFT of the FIR coefficients. More...
 
Eigen::Matrix< FP_TYPE, Eigen::Dynamic, Eigen::Dynamic > h
 the time domain representation of the filter More...
 
Eigen::Matrix< FP_TYPE, Eigen::Dynamic, Eigen::Dynamic > x
 the time domain signal for filtering More...
 
Eigen::Matrix< FP_TYPE, Eigen::Dynamic, 1 > yTemp
 the time domain signal for filtering More...
 
Eigen::Array< Eigen::FFT< FP_TYPE >::Complex, Eigen::Dynamic, 1 > Y
 the time domain filter output and also the DFT of one col of x More...
 

Detailed Description

Examples:
FIRTest.C.

Definition at line 61 of file FIR.H.

Constructor & Destructor Documentation

◆ FIR()

FIR::FIR ( )
inline

Constructor.

Definition at line 76 of file FIR.H.

Member Function Documentation

◆ filter()

template<typename Derived , typename DerivedOther >
void FIR::filter ( const Eigen::MatrixBase< Derived > &  input,
Eigen::DenseBase< DerivedOther > const &  output 
)
inline

Convolve the input with h producing the output. Each column is a channel and then number of input, output and h channels must match.

Parameters
inputThe input signal of block size N where N is defined by calling init, each column is a different channel
outputThe output signal of block size N where N is defined by calling init, each column is a different channel
Examples:
FIRTest.C.

Definition at line 102 of file FIR.H.

Here is the call graph for this function:

◆ init()

void FIR::init ( unsigned int  blockSize)

Initialise the input audio frame count (window size or block size)

Parameters
blockSizeThe block size.
Examples:
FIRTest.C.

Definition at line 59 of file FIR.C.

Here is the call graph for this function:

◆ loadTimeDomainCoefficients() [1/2]

int FIR::loadTimeDomainCoefficients ( const std::string  fileName)

Method to read time domain coefficients from file, convert to the Fourier domain and Construct the necessary data types. You may pass any audio file which can be read by the class Sox - it can read a very large number of audio file formats.

Parameters
fileNameThe name of the file to load the time domain coefficients from
Returns
Negative value on error.
Examples:
FIRTest.C.

Definition at line 22 of file FIR.C.

Here is the call graph for this function:

◆ loadTimeDomainCoefficients() [2/2]

void FIR::loadTimeDomainCoefficients ( const Eigen::Matrix< FP_TYPE, Eigen::Dynamic, Eigen::Dynamic >  hIn)

Method to load time domain coefficients from Matrix, convert to the Fourier domain and Construct the necessary data types.

Parameters
hThe Matrix with time domain coefficients. Each column is a different channel
Returns
Negative value on error.

Definition at line 37 of file FIR.C.

Here is the call graph for this function:

◆ resetDFT()

void FIR::resetDFT ( )
private

Resets the H matrix once N or h is changed.

Definition at line 42 of file FIR.C.

Here is the caller graph for this function:

Member Data Documentation

◆ fft

Eigen::FFT<FP_TYPE> FIR::fft
private

The fast Fourier transform.

Definition at line 62 of file FIR.H.

◆ H

Eigen::Array<Eigen::FFT<FP_TYPE>::Complex, Eigen::Dynamic, Eigen::Dynamic> FIR::H
private

The DFT of the FIR coefficients.

Definition at line 63 of file FIR.H.

◆ h

Eigen::Matrix<FP_TYPE, Eigen::Dynamic, Eigen::Dynamic> FIR::h
private

the time domain representation of the filter

Definition at line 64 of file FIR.H.

◆ N

unsigned int FIR::N
protected

Block size of the audio subsystem.

Definition at line 73 of file FIR.H.

◆ x

Eigen::Matrix<FP_TYPE, Eigen::Dynamic, Eigen::Dynamic> FIR::x
private

the time domain signal for filtering

Definition at line 65 of file FIR.H.

◆ Y

Eigen::Array<Eigen::FFT<FP_TYPE>::Complex, Eigen::Dynamic, 1> FIR::Y
private

the time domain filter output and also the DFT of one col of x

Definition at line 67 of file FIR.H.

◆ y

Eigen::Matrix<FP_TYPE, Eigen::Dynamic, Eigen::Dynamic> FIR::y
protected

the time domain output signal

Definition at line 74 of file FIR.H.

◆ yTemp

Eigen::Matrix<FP_TYPE, Eigen::Dynamic, 1> FIR::yTemp
private

the time domain signal for filtering

Definition at line 66 of file FIR.H.


The documentation for this class was generated from the following files:
gtkIOStream: FIR Class Reference
GTK+ IOStream  Beta