SoDaRadio-5.0.3-master:8901fb5
|
Spectrogram generates magnitude buffers from input sample stream. More...
#include <Spectrogram.hxx>
Public Member Functions | |
Spectrogram (unsigned int fftlen) | |
Constructor. More... | |
void | apply_acc (std::complex< float > *invec, unsigned int inveclen, float *outvec, float accumulation_gain=0.0) |
Calculate the spectrogram from an input vector – add it to an accumulation buffer. More... | |
void | apply_max (std::complex< float > *invec, unsigned int inveclen, float *outvec, bool first=true) |
Calculate the spectrogram from an input vector – add it to an accumulation buffer. More... | |
Private Member Functions | |
float * | initBlackmanHarris () |
all spectrograms are under a blackman harris window More... | |
void | apply_common (std::complex< float > *invec, unsigned int inveclen) |
this is the common spectrogram calculation (window + fft + mag) More... | |
Private Attributes | |
fftwf_plan | fftplan |
float * | window |
std::complex< float > * | win_samp |
std::complex< float > * | fft_out |
float * | result |
unsigned int | fft_len |
Spectrogram generates magnitude buffers from input sample stream.
Definition at line 39 of file Spectrogram.hxx.
SoDa::Spectrogram::Spectrogram | ( | unsigned int | fftlen | ) |
Constructor.
fftlen | how many frequency points in the spectrogram buffer |
Definition at line 34 of file Spectrogram.cxx.
References fft_len, fft_out, fftplan, initBlackmanHarris(), result, win_samp, and window.
void SoDa::Spectrogram::apply_acc | ( | std::complex< float > * | invec, |
unsigned int | inveclen, | ||
float * | outvec, | ||
float | accumulation_gain = 0.0 |
||
) |
Calculate the spectrogram from an input vector – add it to an accumulation buffer.
invec | the input sample buffer |
inveclen | the length of the buffer |
outvec | the result buffer |
accumulation_gain | (out = result + out * acc_gain) |
Definition at line 111 of file Spectrogram.cxx.
References apply_common(), fft_len, and result.
Referenced by SoDa::UI::sendFFT().
|
private |
this is the common spectrogram calculation (window + fft + mag)
invec | the input sample buffer |
inveclen | the length of the buffer |
Definition at line 74 of file Spectrogram.cxx.
References fft_len, fft_out, fftplan, result, win_samp, and window.
Referenced by apply_acc(), and apply_max().
void SoDa::Spectrogram::apply_max | ( | std::complex< float > * | invec, |
unsigned int | inveclen, | ||
float * | outvec, | ||
bool | first = true |
||
) |
Calculate the spectrogram from an input vector – add it to an accumulation buffer.
invec | the input sample buffer |
inveclen | the length of the buffer |
outvec | the result buffer (out = max(result, out)) |
first | if true, ignore contents of outvec... |
Definition at line 142 of file Spectrogram.cxx.
References apply_common(), fft_len, and result.
|
private |
all spectrograms are under a blackman harris window
Definition at line 55 of file Spectrogram.cxx.
References fft_len.
Referenced by Spectrogram().
|
private |
Definition at line 94 of file Spectrogram.hxx.
Referenced by apply_acc(), apply_common(), apply_max(), initBlackmanHarris(), and Spectrogram().
|
private |
Definition at line 92 of file Spectrogram.hxx.
Referenced by apply_common(), and Spectrogram().
|
private |
Definition at line 89 of file Spectrogram.hxx.
Referenced by apply_common(), and Spectrogram().
|
private |
Definition at line 93 of file Spectrogram.hxx.
Referenced by apply_acc(), apply_common(), apply_max(), and Spectrogram().
|
private |
Definition at line 91 of file Spectrogram.hxx.
Referenced by apply_common(), and Spectrogram().
|
private |
Definition at line 90 of file Spectrogram.hxx.
Referenced by apply_common(), and Spectrogram().