Ardour  9.0-pre0-1051-g8dd89616e1
ARDOUR::DSP::FFTSpectrum Class Reference

#include <dsp_filter.h>

Inheritance diagram for ARDOUR::DSP::FFTSpectrum:
[legend]

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 gain=1.f, bool pink=false) const
 
float freq_at_bin (const uint32_t bin) const
 
- Public Member Functions inherited from ARDOUR::DSP::SpectrumAnalyzer
virtual ~SpectrumAnalyzer ()
 

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
 

Detailed Description

Definition at line 295 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
inlinevirtual

Implements ARDOUR::DSP::SpectrumAnalyzer.

Definition at line 319 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  gain = 1.f,
bool  pink = false 
) const
virtual

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)

Implements ARDOUR::DSP::SpectrumAnalyzer.

◆ 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 333 of file dsp_filter.h.

◆ _fft_data_out

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

Definition at line 334 of file dsp_filter.h.

◆ _fft_data_size

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

Definition at line 330 of file dsp_filter.h.

◆ _fft_freq_per_bin

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

Definition at line 331 of file dsp_filter.h.

◆ _fft_power

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

Definition at line 335 of file dsp_filter.h.

◆ _fft_window_size

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

Definition at line 329 of file dsp_filter.h.

◆ _fftplan

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

Definition at line 337 of file dsp_filter.h.

◆ hann_window

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

Definition at line 324 of file dsp_filter.h.


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