Freq_Filt Frequency domain filtering using the overlap-add techniqueThe Freq_Filt class implements an FFT based filter using the overlap-add technique. The data is filtered by first transforming the input sequence into the frequency domain with an efficient FFT implementation (i.e. FFTW) and then multiplied with a Fourier transformed version of the impulse response. The resulting data is then inversed Fourier transformed to return a filtered time domain signal. More...
#include <itpp/signal/freq_filt.h>
Public Member Functions | |
Freq_Filt () | |
Constructor. | |
Freq_Filt (const Vec< Num_T > &b, const int xlength) | |
Constructor with initialization of the impulse response b. | |
Vec< Num_T > | filter (const Vec< Num_T > &x, const int strm=0) |
Filter data in the input vector x. | |
int | get_fft_size () |
Return FFT size. | |
int | get_blk_size () |
Return the data block size. | |
~Freq_Filt () | |
Destructor. | |
Freq_Filt Frequency domain filtering using the overlap-add technique
The Freq_Filt class implements an FFT based filter using the overlap-add technique. The data is filtered by first transforming the input sequence into the frequency domain with an efficient FFT implementation (i.e. FFTW) and then multiplied with a Fourier transformed version of the impulse response. The resulting data is then inversed Fourier transformed to return a filtered time domain signal.
Freq_Filt is a templated class. The template paramter Num_T
defines the data type for the impulse response b
, input data x
and output data y
.
The class constructor chooses an optimal FFT length and data block size that minimizes execution time.
For example,
where 8000 corresponds to the expected vector length of the data to be filtered. The actual number of elements does not have to be exact, but it should be close.
Here is a complete example:
To facilitate large data sets the Freq_Filt class has a streaming option. In this mode of operation data history is internally stored. This allows the class to be used for large data sets that are read from disk or streamed in real-time.
Definition at line 112 of file freq_filt.h.
|
inline |
Constructor.
The empty constructor makes it possible to have other container objects of the Freq_Filt class
Definition at line 121 of file freq_filt.h.
|
inline |
Constructor with initialization of the impulse response b.
Create a filter object with impulse response b. The FFT size and data block size are also initialized.
Definition at line 134 of file freq_filt.h.
Vec< Num_T > itpp::Freq_Filt< Num_T >::filter | ( | const Vec< Num_T > & | x, |
const int | strm = 0 |
||
) |
Filter data in the input vector x.
Filters data in batch mode or streaming mode
Definition at line 230 of file freq_filt.h.
References itpp::concat(), itpp::Vec< Num_T >::length(), itpp::Vec< Num_T >::set_size(), and itpp::Vec< Num_T >::zeros().
Generated on Sat May 25 2013 16:32:34 for IT++ by Doxygen 1.8.2