Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::DSP::FFTSpectrum Class Reference

#include <dsp_filter.h>

Public Member Functions

 FFTSpectrum (uint32_t window_size, double rate)
 
 ~FFTSpectrum ()
 
void set_data_hann (float const *const data, const uint32_t n_samples, const uint32_t offset=0)
 
void execute ()
 
float power_at_bin (const uint32_t bin, const float norm=1.f) const
 
float freq_at_bin (const uint32_t bin) const
 

Private Member Functions

void init (uint32_t window_size, double rate)
 
void reset ()
 

Private Attributes

float * hann_window
 
uint32_t _fft_window_size
 
uint32_t _fft_data_size
 
double _fft_freq_per_bin
 
float * _fft_data_in
 
float * _fft_data_out
 
float * _fft_power
 
fftwf_plan _fftplan
 

Static Private Attributes

static Glib::Threads::Mutex fft_planner_lock
 

Detailed Description

Definition at line 287 of file dsp_filter.h.

Constructor & Destructor Documentation

◆ FFTSpectrum()

ARDOUR::DSP::FFTSpectrum::FFTSpectrum ( uint32_t  window_size,
double  rate 
)

◆ ~FFTSpectrum()

ARDOUR::DSP::FFTSpectrum::~FFTSpectrum ( )

Member Function Documentation

◆ execute()

void ARDOUR::DSP::FFTSpectrum::execute ( )

process current data in buffer

◆ freq_at_bin()

float ARDOUR::DSP::FFTSpectrum::freq_at_bin ( const uint32_t  bin) const
inline

Definition at line 311 of file dsp_filter.h.

◆ init()

void ARDOUR::DSP::FFTSpectrum::init ( uint32_t  window_size,
double  rate 
)
private

◆ power_at_bin()

float ARDOUR::DSP::FFTSpectrum::power_at_bin ( const uint32_t  bin,
const float  norm = 1.f 
) const

query

Parameters
binthe frequency bin 0 .. window_size / 2
normgain factor (set equal to bin for 1/f normalization)
Returns
signal power at given bin (in dBFS)

◆ reset()

void ARDOUR::DSP::FFTSpectrum::reset ( )
private

◆ set_data_hann()

void ARDOUR::DSP::FFTSpectrum::set_data_hann ( float const *const  data,
const uint32_t  n_samples,
const uint32_t  offset = 0 
)

set data to be analyzed and pre-process with hanning window n_samples + offset must not be larger than the configured window_size

Parameters
dataraw audio data
n_samplesnumber of samples to write to analysis buffer
offsetdestination offset

Member Data Documentation

◆ _fft_data_in

float* ARDOUR::DSP::FFTSpectrum::_fft_data_in
private

Definition at line 326 of file dsp_filter.h.

◆ _fft_data_out

float* ARDOUR::DSP::FFTSpectrum::_fft_data_out
private

Definition at line 327 of file dsp_filter.h.

◆ _fft_data_size

uint32_t ARDOUR::DSP::FFTSpectrum::_fft_data_size
private

Definition at line 323 of file dsp_filter.h.

◆ _fft_freq_per_bin

double ARDOUR::DSP::FFTSpectrum::_fft_freq_per_bin
private

Definition at line 324 of file dsp_filter.h.

◆ _fft_power

float* ARDOUR::DSP::FFTSpectrum::_fft_power
private

Definition at line 328 of file dsp_filter.h.

◆ _fft_window_size

uint32_t ARDOUR::DSP::FFTSpectrum::_fft_window_size
private

Definition at line 322 of file dsp_filter.h.

◆ _fftplan

fftwf_plan ARDOUR::DSP::FFTSpectrum::_fftplan
private

Definition at line 330 of file dsp_filter.h.

◆ fft_planner_lock

Glib::Threads::Mutex ARDOUR::DSP::FFTSpectrum::fft_planner_lock
staticprivate

Definition at line 316 of file dsp_filter.h.

◆ hann_window

float* ARDOUR::DSP::FFTSpectrum::hann_window
private

Definition at line 317 of file dsp_filter.h.


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