Structured this way so that I can keep all fftw linkage internal.
More...
#include <filter.h>
|
using | callback = std::function< std::complex< float >(std::complex< float >, float)> |
|
Structured this way so that I can keep all fftw linkage internal.
Filter takes an arbitrary callback to modify the magnitude/phase of the signal. The callback is run once on each bin, in an undefined order. The arguments are the complex value of the bin, and the relative frequency of that bin.
frequency_domain::filter::filter |
( |
size_t |
signal_length | ) |
|
|
explicit |
Instantiating will create two buffers and set up two fft plans. It will be cheaper to set one of these up once and re-use it, than to create a new one every time you need to filter something.
template<typename In , typename Out >
void frequency_domain::filter::run |
( |
In |
begin, |
|
|
In |
end, |
|
|
Out |
output_it, |
|
|
const callback & |
callback |
|
) |
| |
|
inline |
Filters data. It is safe to supply the same range as the input and output range. Output range should be as big or bigger than input range. TODO this is going to be slow because it will do a whole bunch of virtual call to the callback parameter. Not sure how to speed this up while keeping all the fft stuff behind a compiler firewall.
The documentation for this class was generated from the following files:
- src/frequency_domain/include/frequency_domain/filter.h
- src/frequency_domain/src/filter.cpp