Nsound
0.9.4
|
The result from an STFT. More...
#include <Nsound/Spectrogram.h>
Public Member Functions | |
Spectrogram (const Buffer &x, const float64 &sample_rate, const float64 &time_window, const float64 &time_step, const WindowType &type) | |
Spectrogram (const Spectrogram ©) | |
~Spectrogram () | |
Buffer | getFrequencyAxis () const |
AudioStream | getMagnitude () const |
Buffer | getTimeAxis () const |
Spectrogram & | operator= (const Spectrogram &rhs) |
void | plot (const std::string &title="", const boolean &use_dB=true, const float64 &squash=0.5) const |
Buffer | computeMagnitude (const Buffer &x) |
Protected Attributes | |
float64 | sample_rate_ |
Buffer * | frequency_axis_ |
Buffer * | time_axis_ |
AudioStream * | real_ |
AudioStream * | imag_ |
Buffer * | fft_window_ |
uint32 | nfft_ |
uint32 | n_window_samples_ |
FFTransform * | fft_ |
The result from an STFT.
Definition at line 47 of file Spectrogram.h.
Spectrogram::Spectrogram | ( | const Buffer & | x, |
const float64 & | sample_rate, | ||
const float64 & | time_window, | ||
const float64 & | time_step, | ||
const WindowType & | type | ||
) |
Definition at line 44 of file Spectrogram.cc.
References Nsound::Generator::drawWindow(), Nsound::FFTransform::fft(), fft_, fft_window_, frequency_axis_, Nsound::Buffer::getLength(), imag_, n_window_samples_, nfft_, real_, Nsound::FFTransform::roundUp2(), sample_rate_, Nsound::Generator::silence(), sr, Nsound::Buffer::subbuffer(), and time_axis_.
Spectrogram::Spectrogram | ( | const Spectrogram & | copy | ) |
Definition at line 232 of file Spectrogram.cc.
Spectrogram::~Spectrogram | ( | ) |
Definition at line 246 of file Spectrogram.cc.
References fft_, fft_window_, frequency_axis_, imag_, real_, and time_axis_.
Buffer Spectrogram::getFrequencyAxis | ( | ) | const |
AudioStream Spectrogram::getMagnitude | ( | ) | const |
Buffer Spectrogram::getTimeAxis | ( | ) | const |
Spectrogram & Spectrogram::operator= | ( | const Spectrogram & | rhs | ) |
Definition at line 279 of file Spectrogram.cc.
References fft_, fft_window_, frequency_axis_, imag_, n_window_samples_, nfft_, real_, sample_rate_, and time_axis_.
void Spectrogram::plot | ( | const std::string & | title = "" , |
const boolean & | use_dB = true , |
||
const float64 & | squash = 0.5 |
||
) | const |
Definition at line 301 of file Spectrogram.cc.
References Nsound::AudioStream::dB(), Nsound::Plotter::figure(), frequency_axis_, getMagnitude(), Nsound::Plotter::imagesc(), time_axis_, Nsound::Plotter::title(), Nsound::AudioStream::transpose(), Nsound::Plotter::xlabel(), and Nsound::Plotter::ylabel().
Referenced by my_main().
Definition at line 342 of file Spectrogram.cc.
References Nsound::FFTransform::fft(), fft_, fft_window_, Nsound::Buffer::getLength(), n_window_samples_, nfft_, Nsound::Buffer::subbuffer(), and Nsound::Buffer::zeros().
|
protected |
Definition at line 86 of file Spectrogram.h.
Referenced by operator=(), and Spectrogram().
|
protected |
Definition at line 88 of file Spectrogram.h.
Referenced by getFrequencyAxis(), operator=(), plot(), Spectrogram(), and ~Spectrogram().
|
protected |
Definition at line 89 of file Spectrogram.h.
Referenced by getTimeAxis(), operator=(), plot(), Spectrogram(), and ~Spectrogram().
|
protected |
Definition at line 91 of file Spectrogram.h.
Referenced by getMagnitude(), operator=(), Spectrogram(), and ~Spectrogram().
|
protected |
Definition at line 92 of file Spectrogram.h.
Referenced by getMagnitude(), operator=(), Spectrogram(), and ~Spectrogram().
|
protected |
Definition at line 94 of file Spectrogram.h.
Referenced by computeMagnitude(), operator=(), Spectrogram(), and ~Spectrogram().
|
protected |
Definition at line 95 of file Spectrogram.h.
Referenced by computeMagnitude(), operator=(), and Spectrogram().
|
protected |
Definition at line 96 of file Spectrogram.h.
Referenced by computeMagnitude(), operator=(), and Spectrogram().
|
protected |
Definition at line 97 of file Spectrogram.h.
Referenced by computeMagnitude(), operator=(), Spectrogram(), and ~Spectrogram().