GNU Radio Manual and C++ API Reference
The Free & Open Software Radio Ecosystem
gr::filter::kernel::fft_filter_ccc Class Reference

Fast FFT filter with gr_complex input, gr_complex output and gr_complex taps. More...

#include <gnuradio/filter/fft_filter.h>

Public Member Functions

 fft_filter_ccc (int decimation, const std::vector< gr_complex > &taps, int nthreads=1)
 Construct an FFT filter for complex vectors with the given taps and decimation rate. More...
 fft_filter_ccc (const fft_filter_ccc &)=delete
fft_filter_cccoperator= (const fft_filter_ccc &)=delete
 fft_filter_ccc (fft_filter_ccc &&)=default
fft_filter_cccoperator= (fft_filter_ccc &&)=default
int set_taps (const std::vector< gr_complex > &taps)
 Set new taps for the filter. More...
void set_nthreads (int n)
 Set number of threads to use. More...
std::vector< gr_complextaps () const
 Returns the taps. More...
unsigned int ntaps () const
 Returns the number of taps in the filter. More...
int nthreads () const
 Get number of threads being used. More...
int filter (int nitems, const gr_complex *input, gr_complex *output)
 Perform the filter operation. More...

Detailed Description

Fast FFT filter with gr_complex input, gr_complex output and gr_complex taps.

This block performs fast convolution using the overlap-and-save algorithm. The filtering is performand in the frequency domain instead of the time domain (see gr::filter::kernel::fir_filter_ccc). For an input signal x and filter coefficients (taps) t, we compute y as:

y = ifft(fft(x)*fft(t))

This kernel computes the FFT of the taps when they are set to only perform this operation once. The FFT of the input signal x is done every time.

Because this is designed as a very low-level kernel operation, it is designed for speed and avoids certain checks in the filter() function itself. The filter function expects that the input signal is a multiple of d_nsamples in the class that's computed internally to be as fast as possible. The function set_taps will return the value of nsamples that can be used externally to check this boundary. Notice that all implementations of the fft_filter GNU Radio blocks (e.g., gr::filter::fft_filter_ccc) use this value of nsamples to compute the value to call gr::block::set_output_multiple that ensures the scheduler always passes this block the right number of samples.

Constructor & Destructor Documentation

◆ fft_filter_ccc() [1/3]

gr::filter::kernel::fft_filter_ccc::fft_filter_ccc ( int  decimation,
const std::vector< gr_complex > &  taps,
int  nthreads = 1 

Construct an FFT filter for complex vectors with the given taps and decimation rate.

This is the basic implementation for performing FFT filter for fast convolution in other blocks (e.g., gr::filter::fft_filter_ccc).

decimationThe decimation rate of the filter (int)
tapsThe filter taps (vector of complex)
nthreadsThe number of threads for the FFT to use (int)

◆ fft_filter_ccc() [2/3]

gr::filter::kernel::fft_filter_ccc::fft_filter_ccc ( const fft_filter_ccc )

◆ fft_filter_ccc() [3/3]

gr::filter::kernel::fft_filter_ccc::fft_filter_ccc ( fft_filter_ccc &&  )

Member Function Documentation

◆ filter()

int gr::filter::kernel::fft_filter_ccc::filter ( int  nitems,
const gr_complex input,
gr_complex output 

Perform the filter operation.

nitemsThe number of items to produce
inputThe input vector to be filtered
outputThe result of the filter operation

◆ ntaps()

unsigned int gr::filter::kernel::fft_filter_ccc::ntaps ( ) const

Returns the number of taps in the filter.

◆ nthreads()

int gr::filter::kernel::fft_filter_ccc::nthreads ( ) const

Get number of threads being used.

◆ operator=() [1/2]

fft_filter_ccc& gr::filter::kernel::fft_filter_ccc::operator= ( const fft_filter_ccc )

◆ operator=() [2/2]

fft_filter_ccc& gr::filter::kernel::fft_filter_ccc::operator= ( fft_filter_ccc &&  )

◆ set_nthreads()

void gr::filter::kernel::fft_filter_ccc::set_nthreads ( int  n)

Set number of threads to use.

◆ set_taps()

int gr::filter::kernel::fft_filter_ccc::set_taps ( const std::vector< gr_complex > &  taps)

Set new taps for the filter.

Sets new taps and resets the class properties to handle different sizes

tapsThe filter taps (complex)

◆ taps()

std::vector<gr_complex> gr::filter::kernel::fft_filter_ccc::taps ( ) const

Returns the taps.

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