#include <iso_synth_fft_unit.h>
Inherits iso::synth::ProcessUnit.
Inheritance diagram for iso::synth::FFTUnit:
Public Member Functions | |
FFTUnit () | |
default constructor | |
FFTUnit (const String &pName) | |
name constructor | |
FFTUnit (unsigned int pChannelCount) | |
parameter based contructor | |
FFTUnit (const String &pName, unsigned int pChannelCount) | |
parameter based contructor | |
FFTUnit (FunctionType pWindowType, unsigned int pOverlap) | |
parameter based contructor | |
FFTUnit (const String &pName, FunctionType pWindowType, unsigned int pOverlap) | |
parameter based contructor | |
FFTUnit (unsigned int pChannelCount, FunctionType pWindowType, unsigned int pOverlap) | |
parameter based contructor | |
FFTUnit (const String &pName, unsigned int pChannelCount, FunctionType pWindowType, unsigned int pOverlap) | |
parameter based contructor | |
FFTUnit (FunctionType pWindowType, unsigned int pOverlap, unsigned int pFrameCount, unsigned int pChannelCount, unsigned int pRate, FanInType pFanInType=FANIN_ADD) | |
parameter based contructor | |
FFTUnit (const String &pName, FunctionType pWindowType, unsigned int pOverlap, unsigned int pFrameCount, unsigned int pChannelCount, unsigned int pRate, FanInType pFanInType=FANIN_ADD) | |
name and parameter based contructor | |
FFTUnit (const FFTUnit &pUnit) | |
copy constructor | |
FFTUnit (const String &pName, const FFTUnit &pUnit) | |
name & copy constructor | |
FFTUnit (const data::Values &pValues) throw (SynthException) | |
values based constructor | |
virtual | ~FFTUnit () |
destructor | |
virtual void | process (Buffer *pBuffer) throw (SynthException) |
processes buffer | |
virtual String | info (bool pPropagate=false, bool pShowPorts=true) const |
obtain textual unit information | |
Static Public Attributes | |
static const String | sClassName |
default name | |
Protected Member Functions | |
void | init () |
initializes ports | |
Protected Attributes | |
Buffer * | mAudioBuffer |
audio buffer | |
FunctionType | mWindowType |
window type for windowing | |
Channel * | mWindow |
window buffer | |
unsigned int | mOverlap |
number of overlaps | |
unsigned int | mSpectraCount |
total number of spectra per audio buffer | |
unsigned int | mSpectrumStartNr |
first spectrum number | |
unsigned int | mSpectrumNr |
current spectrum number | |
sample * | mFFTWAudioData |
audio data buffer for fftw | |
fftwf_complex * | mFFTWSpectralData |
spectral data buffer for fftw | |
RingBuffer * | mPreFFTAudioBuffer |
audio buffer which combines audio buffers before fft | |
Frame | mPreFFTBufferReadPos |
relative read position into PreFFTRingBuffer | |
fftwf_plan | mFFTPlan |
forward fft plan | |
Static Protected Attributes | |
static unsigned int | sUnitCount |
total number of units created so far | |
static FunctionType | sWindowType |
default window type for windowing | |
Friends | |
std::ostream & | operator<< (std::ostream &pOstream, const FFTUnit &pUnit) |
print unit information |
fourier transformation
This unit expands the basic process unit class.
It receives audio data at its audio input port and transforms it into spectral data that is output through the audio output port.
Apart from the standard configuration possibilities for processing units, this unit
allows users to specify the window type (GAUSS, HAMMING, HANN) and the number of overlaps between windows.
This unit is peculiar in that it works at the different rate than normal audio units
and in that the number of frames and channels differs at the audio input and output ports.
This values are calculated as follows (if no specified manually)
unit:
rate : synth default rate * 2.0 ^ (windowoverlap - 1)
frameCount : synth default frameCount
channelCount : synth default channelCount
input port:
rate : synth default rate
frameCount : synth default frameCount
channelCount : synth default channelCount
output port:
rate : synth default rate * 2.0 ^ (windowoverlap - 1)
frameCount : synth default frameCount / 2
channelCount : synth default channelCount * 2
SwitchPorts:
name: active channelCount: 1 defaultValue: 1.0 resizable: false function: setActive
Created by Daniel Bisig on 9/12/06.
Copyright 2006 Daniel Bisig All rights reserved.
FFTUnit::FFTUnit | ( | ) |
default constructor
FFTUnit::FFTUnit | ( | const String & | pName | ) |
name constructor
pName | unit name |
FFTUnit::FFTUnit | ( | unsigned int | pChannelCount | ) |
parameter based contructor
pChannelCount | channel count |
FFTUnit::FFTUnit | ( | const String & | pName, | |
unsigned int | pChannelCount | |||
) |
parameter based contructor
pName | unit name | |
pChannelCount | channel count |
FFTUnit::FFTUnit | ( | FunctionType | pWindowType, | |
unsigned int | pOverlap | |||
) |
parameter based contructor
pWindowType | window type | |
pOverlap | number of overlaps |
FFTUnit::FFTUnit | ( | const String & | pName, | |
FunctionType | pWindowType, | |||
unsigned int | pOverlap | |||
) |
parameter based contructor
pName | unit name | |
pWindowType | window type | |
pOverlap | number of overlaps |
FFTUnit::FFTUnit | ( | unsigned int | pChannelCount, | |
FunctionType | pWindowType, | |||
unsigned int | pOverlap | |||
) |
parameter based contructor
pChannelCount | channel count | |
pWindowType | window type | |
pOverlap | number of overlaps |
FFTUnit::FFTUnit | ( | const String & | pName, | |
unsigned int | pChannelCount, | |||
FunctionType | pWindowType, | |||
unsigned int | pOverlap | |||
) |
parameter based contructor
pName | unit name | |
pChannelCount | channel count | |
pWindowType | window type | |
pOverlap | number of overlaps |
FFTUnit::FFTUnit | ( | FunctionType | pWindowType, | |
unsigned int | pOverlap, | |||
unsigned int | pFrameCount, | |||
unsigned int | pChannelCount, | |||
unsigned int | pRate, | |||
FanInType | pFanInType = FANIN_ADD | |||
) |
parameter based contructor
pWindowType | window type | |
pOverlap | number of overlaps | |
pFrameCount | number of frames | |
pChannelCount | number of channels | |
pRate | samping rate | |
pFanInType | strategy for combining audio buffers in case this unit is connected to several units |
FFTUnit::FFTUnit | ( | const String & | pName, | |
FunctionType | pWindowType, | |||
unsigned int | pOverlap, | |||
unsigned int | pFrameCount, | |||
unsigned int | pChannelCount, | |||
unsigned int | pRate, | |||
FanInType | pFanInType = FANIN_ADD | |||
) |
name and parameter based contructor
pName | unit name | |
pWindowType | window type | |
pOverlap | number of overlaps | |
pFrameCount | number of frames | |
pChannelCount | number of channels | |
pRate | samping rate | |
pFanInType | strategy for combining audio buffers in case this unit is connected to several units |
SynthException | pFreqBinCount or pFrameCount not a power of two |
FFTUnit::FFTUnit | ( | const FFTUnit & | pUnit | ) |
copy constructor
pUnit | unit to copy properties from |
name & copy constructor
pName | unit name | |
pUnit | unit to copy properties from |
FFTUnit::FFTUnit | ( | const data::Values & | pValues | ) | throw (SynthException) |
values based constructor
pValues | unit values |
SynthException | failed to create unit |
FFTUnit::~FFTUnit | ( | ) | [virtual] |
destructor
void FFTUnit::process | ( | Buffer * | pBuffer | ) | throw (SynthException) [virtual] |
base::String FFTUnit::info | ( | bool | pPropagate = false , |
|
bool | pShowPorts = true | |||
) | const [virtual] |
obtain textual unit information
pPropagate | if true, the unit calls the info methods of its input ports | |
pShowPorts | print port information |
Reimplemented from iso::synth::ProcessUnit.
void FFTUnit::init | ( | ) | [protected] |
initializes ports
std::ostream& operator<< | ( | std::ostream & | pOstream, | |
const FFTUnit & | pUnit | |||
) | [friend] |
print unit information
const base::String FFTUnit::sClassName [static] |
unsigned int FFTUnit::sUnitCount [static, protected] |
FunctionType FFTUnit::sWindowType [static, protected] |
default window type for windowing
Buffer* iso::synth::FFTUnit::mAudioBuffer [protected] |
audio buffer
FunctionType iso::synth::FFTUnit::mWindowType [protected] |
window type for windowing
Channel* iso::synth::FFTUnit::mWindow [protected] |
window buffer
unsigned int iso::synth::FFTUnit::mOverlap [protected] |
number of overlaps
unsigned int iso::synth::FFTUnit::mSpectraCount [protected] |
total number of spectra per audio buffer
unsigned int iso::synth::FFTUnit::mSpectrumStartNr [protected] |
first spectrum number
unsigned int iso::synth::FFTUnit::mSpectrumNr [protected] |
current spectrum number
sample* iso::synth::FFTUnit::mFFTWAudioData [protected] |
audio data buffer for fftw
fftwf_complex* iso::synth::FFTUnit::mFFTWSpectralData [protected] |
spectral data buffer for fftw
RingBuffer* iso::synth::FFTUnit::mPreFFTAudioBuffer [protected] |
audio buffer which combines audio buffers before fft
Frame iso::synth::FFTUnit::mPreFFTBufferReadPos [protected] |
relative read position into PreFFTRingBuffer
fftwf_plan iso::synth::FFTUnit::mFFTPlan [protected] |
forward fft plan