Nsound
0.9.4
|
Results of performing an FFT are stored in this class. More...
#include <Nsound/FFTChunk.h>
Public Member Functions | |
FFTChunk (uint32 size=32, uint32 sample_rate=44100, uint32 original_size=0) | |
FFTChunk (const FFTChunk ©) | |
~FFTChunk () | |
Buffer | getFrequencyAxis () const |
Buffer | getReal () const |
Buffer | getImaginary () const |
Buffer | getMagnitude () const |
uint32 | getOriginalSize () const |
Buffer | getPhase () const |
boolean | isPolar () const |
FFTChunk & | operator= (const FFTChunk &rhs) |
void | plot (const std::string &title="", boolean dB=true, boolean show_phase=false) const |
void | setCartesian (const Buffer &real, const Buffer &imaginary) |
Sets up an FFTChunk to use the provided real & imaginary. More... | |
void | setPolar (const Buffer &magnitude, const Buffer &phase) |
Sets up an FFTChunk to use the provided magnitude & phase. More... | |
void | toPolar () |
convertes the real & imaginary unit to plor form: magnitude & phase More... | |
void | toCartesian () |
convertes the magnitude & phase to cartesian form: real & imaginary More... | |
uint32 | getSampleRate () const |
Public Attributes | |
Buffer * | real_ |
Buffer * | imag_ |
Protected Attributes | |
uint32 | sample_rate_ |
uint32 | original_size_ |
boolean | is_polar_ |
Results of performing an FFT are stored in this class.
Definition at line 49 of file FFTChunk.h.
FFTChunk::FFTChunk | ( | const FFTChunk & | copy | ) |
Definition at line 65 of file FFTChunk.cc.
FFTChunk::~FFTChunk | ( | ) |
Definition at line 79 of file FFTChunk.cc.
Buffer FFTChunk::getFrequencyAxis | ( | ) | const |
Definition at line 109 of file FFTChunk.cc.
References Nsound::Generator::drawLine(), Nsound::Buffer::getLength(), real_, and sample_rate_.
Referenced by plot().
Buffer FFTChunk::getReal | ( | ) | const |
Definition at line 127 of file FFTChunk.cc.
References Nsound::Buffer::getLength(), imag_, is_polar_, real_, and Nsound::Buffer::subbuffer().
Referenced by FFTransform_UnitTest().
Buffer FFTChunk::getImaginary | ( | ) | const |
Definition at line 87 of file FFTChunk.cc.
References Nsound::Buffer::getLength(), imag_, is_polar_, real_, and Nsound::Buffer::subbuffer().
Referenced by FFTransform_UnitTest().
Buffer FFTChunk::getMagnitude | ( | ) | const |
Definition at line 149 of file FFTChunk.cc.
References Nsound::Buffer::getLength(), is_polar_, real_, and Nsound::Buffer::subbuffer().
Referenced by plot().
|
inline |
Buffer FFTChunk::getPhase | ( | ) | const |
Definition at line 175 of file FFTChunk.cc.
References Nsound::Buffer::getLength(), imag_, is_polar_, M_PI, real_, and Nsound::Buffer::subbuffer().
Referenced by plot().
|
inline |
Definition at line 78 of file FFTChunk.h.
References is_polar_.
Referenced by Nsound::FFTransform::ifft().
Definition at line 214 of file FFTChunk.cc.
References imag_, is_polar_, original_size_, real_, and sample_rate_.
void FFTChunk::plot | ( | const std::string & | title = "" , |
boolean | dB = true , |
||
boolean | show_phase = false |
||
) | const |
Definition at line 232 of file FFTChunk.cc.
References Nsound::Buffer::dB(), Nsound::Plotter::figure(), getFrequencyAxis(), Nsound::Buffer::getLength(), getMagnitude(), getPhase(), Nsound::Plotter::plot(), real_, Nsound::Buffer::subbuffer(), Nsound::Plotter::subplot(), Nsound::Plotter::title(), Nsound::Plotter::xlabel(), and Nsound::Plotter::ylabel().
Sets up an FFTChunk to use the provided real & imaginary.
Definition at line 310 of file FFTChunk.cc.
References imag_, is_polar_, and real_.
Referenced by FFTransform_UnitTest().
Sets up an FFTChunk to use the provided magnitude & phase.
Definition at line 325 of file FFTChunk.cc.
References imag_, is_polar_, and real_.
Referenced by FFTransform_UnitTest().
void FFTChunk::toPolar | ( | ) |
convertes the real & imaginary unit to plor form: magnitude & phase
Definition at line 362 of file FFTChunk.cc.
References Nsound::Buffer::getLength(), is_polar_, M_PI, and real_.
void FFTChunk::toCartesian | ( | ) |
convertes the magnitude & phase to cartesian form: real & imaginary
Definition at line 340 of file FFTChunk.cc.
References Nsound::Buffer::getLength(), is_polar_, and real_.
Referenced by Nsound::FFTransform::ifft().
|
inline |
Definition at line 108 of file FFTChunk.h.
Buffer* Nsound::FFTChunk::real_ |
Definition at line 105 of file FFTChunk.h.
Referenced by FFTChunk(), getFrequencyAxis(), getImaginary(), getMagnitude(), getPhase(), getReal(), Nsound::FFTransform::ifft(), operator=(), plot(), setCartesian(), setPolar(), toCartesian(), toPolar(), and ~FFTChunk().
Buffer* Nsound::FFTChunk::imag_ |
Definition at line 106 of file FFTChunk.h.
Referenced by FFTChunk(), getImaginary(), getPhase(), getReal(), Nsound::FFTransform::ifft(), operator=(), setCartesian(), setPolar(), and ~FFTChunk().
|
protected |
Definition at line 108 of file FFTChunk.h.
Referenced by getFrequencyAxis(), and operator=().
|
protected |
Definition at line 113 of file FFTChunk.h.
Referenced by FFTChunk(), getOriginalSize(), and operator=().
|
protected |
Definition at line 114 of file FFTChunk.h.
Referenced by getImaginary(), getMagnitude(), getPhase(), getReal(), isPolar(), operator=(), setCartesian(), setPolar(), toCartesian(), and toPolar().