Loading...
Searching...
No Matches
gr::filter::kernel::fft_filter_ccf Class Reference
GNU Radio C++ Signal Processing Blocks » Filters

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

`#include <gnuradio/filter/fft_filter.h>`

## Public Member Functions

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

## Detailed Description

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

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

y = ifft(fft(x)*fft(t))
gr::fft
Definition ctrlport_probe_psd.h:18

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_ccf) 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_ccf() [1/3]

gr::filter::kernel::fft_filter_ccf::fft_filter_ccf | ( | int | decimation,
|  | const std::vector< float > & | 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_ccf).

Parameters

  decimation | The decimation rate of the filter (int)
  taps | The filter taps (float)
  nthreads | The number of threads for the FFT to use (int)

References nthreads(), and taps().

Referenced by fft_filter_ccf(), fft_filter_ccf(), operator=(), and operator=().

## fft_filter_ccf() [2/3]

gr::filter::kernel::fft_filter_ccf::fft_filter_ccf | ( | const fft_filter_ccf & |  | ) |

delete

References fft_filter_ccf().

## fft_filter_ccf() [3/3]

gr::filter::kernel::fft_filter_ccf::fft_filter_ccf | ( | fft_filter_ccf && |  | ) |

default

References fft_filter_ccf().

## Member Function Documentation

## filter()

int gr::filter::kernel::fft_filter_ccf::filter | ( | int | nitems,
|  | const gr_complex * | input,
|  | gr_complex * | output )

Perform the filter operation.

Parameters

  nitems | The number of items to produce
  input | The input vector to be filtered
  output | The result of the filter operation

## filtersize()

unsigned int gr::filter::kernel::fft_filter_ccf::filtersize | ( |  | ) | const

Returns the actual size of the filter.

This value could be equal to ntaps, but we often build a longer filter to allow us to calculate a more efficient FFT. This value is the actual size of the filters used in the calculation of the overlap-and-add operation.

## ntaps()

unsigned int gr::filter::kernel::fft_filter_ccf::ntaps | ( |  | ) | const

Returns the number of taps in the filter.

## nthreads()

int gr::filter::kernel::fft_filter_ccf::nthreads | ( |  | ) | const

Get number of threads being used.

Referenced by fft_filter_ccf().

## operator=() [1/2]

fft_filter_ccf & gr::filter::kernel::fft_filter_ccf::operator= | ( | const fft_filter_ccf & |  | ) |

delete

References fft_filter_ccf().

## operator=() [2/2]

fft_filter_ccf & gr::filter::kernel::fft_filter_ccf::operator= | ( | fft_filter_ccf && |  | ) |

default

References fft_filter_ccf().

## set_nthreads()

void gr::filter::kernel::fft_filter_ccf::set_nthreads | ( | int | n | ) |

Set number of threads to use.

## set_taps()

int gr::filter::kernel::fft_filter_ccf::set_taps | ( | const std::vector< float > & | taps | ) |

Set new taps for the filter.

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

Parameters

  taps | The filter taps (complex)

References taps().

## taps()

std::vector< float > gr::filter::kernel::fft_filter_ccf::taps | ( |  | ) | const

Returns the taps.

Referenced by fft_filter_ccf(), and set_taps().

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

- fft_filter.h