Wayverb
frequency_domain::filter Class Referencefinal

Structured this way so that I can keep all fftw linkage internal. More...

#include <filter.h>

Classes

class  impl
 

Public Types

using callback = std::function< std::complex< float >(std::complex< float >, float)>
 

Public Member Functions

 filter (size_t signal_length)
 
 filter (const filter &)=delete
 
filteroperator= (const filter &)=delete
 
 filter (filter &&)=delete
 
filteroperator= (filter &&)=delete
 
template<typename In , typename Out >
void run (In begin, In end, Out output_it, const callback &callback)
 

Detailed Description

Structured this way so that I can keep all fftw linkage internal.

Member Typedef Documentation

using frequency_domain::filter::callback = std::function<std::complex<float>(std::complex<float>, float)>

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.

Constructor & Destructor Documentation

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.

Member Function Documentation

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: