Configuration class for Spectral Analysis class It includes specific parameters: HopSize, ZeroPadding, Sampling Rate and FFTSize. More...
#include <SpectralAnalysisConfig.hxx>
Public Member Functions | |
SpectralAnalysisConfig () | |
SpectralAnalysisConfig (const SpectralAnalysisConfig &prototype, const bool shareData=false, const bool deep=true) | |
__COMMON_DYNAMIC_TYPE (SpectralAnalysisConfig, 9) | |
__COMMON_DYN_ATTRIBUTE (0, public, WindowGeneratorConfig, WindowGenerator) protected | |
Configuration for children Processing Objects. | |
bool | LoadWindowGenerator (CLAM::Storage &s) |
__COMMON_DYN_ATTRIBUTE (1, public, CircularShiftConfig, CircularShift) protected | |
bool | LoadCircularShift (CLAM::Storage &s) |
__COMMON_DYN_ATTRIBUTE (2, public, FFTConfig, FFT) protected | |
bool | LoadFFT (CLAM::Storage &s) |
__COMMON_DYN_ATTRIBUTE (3, public, int, prHopSize) protected | |
bool | LoadprHopSize (CLAM::Storage &s) |
__COMMON_DYN_ATTRIBUTE (4, public, int, prZeroPadding) protected | |
bool | LoadprZeroPadding (CLAM::Storage &s) |
__COMMON_DYN_ATTRIBUTE (5, public, int, prSamplingRate) protected | |
bool | LoadprSamplingRate (CLAM::Storage &s) |
__COMMON_DYN_ATTRIBUTE (6, public, int, prFFTSize) protected | |
bool | LoadprFFTSize (CLAM::Storage &s) |
__COMMON_DYN_ATTRIBUTE (7, public, int, prWindowSize) protected | |
bool | LoadprWindowSize (CLAM::Storage &s) |
__COMMON_DYN_ATTRIBUTE (8, public, EWindowType, prWindowType) protected | |
bool | LoadprWindowType (CLAM::Storage &s) |
void | SetWindowSize (TSize w) |
Sets Analysis Window size in num. | |
TSize | GetWindowSize () const |
Getter for window size. | |
void | SetWindowType (const EWindowType &t) |
Sets Analysis Window type, modifying configuration of child Window Generator configuration. | |
const EWindowType & | GetWindowType () const |
Getter for window type, returns window type in Window Generator. | |
void | SetZeroPadding (int z) |
Sets Zero padding factor. | |
int | GetZeroPadding () const |
returns ZeroPaddingFactor being used. | |
void | SetHopSize (TSize h) |
Sets Analysis Hop size in number of samples. | |
TSize | GetHopSize () const |
returns HopSize in number of samples. | |
void | SetSamplingRate (TData sr) |
Sets Sampling rate of the input audio. | |
TData | GetSamplingRate () const |
returns SamplingRate | |
void | Sync () |
synchronize configuration values just in case they had been modified directly | |
Friends | |
class | SpectralAnalysis |
Configuration class for Spectral Analysis class It includes specific parameters: HopSize, ZeroPadding, Sampling Rate and FFTSize.
Further setter/getters are also offered for WindowSize and WindowType. It also includes complete configurations for child processings: WindowGenerator, Circular Shift and FFT. These configurations should only be modified by advanced users
Definition at line 42 of file SpectralAnalysisConfig.hxx.
CLAM::SpectralAnalysisConfig::SpectralAnalysisConfig | ( | ) | [inline] |
Definition at line 46 of file SpectralAnalysisConfig.hxx.
CLAM::SpectralAnalysisConfig::SpectralAnalysisConfig | ( | const SpectralAnalysisConfig & | prototype, | |
const bool | shareData = false , |
|||
const bool | deep = true | |||
) | [inline] |
Definition at line 46 of file SpectralAnalysisConfig.hxx.
CLAM::SpectralAnalysisConfig::__COMMON_DYN_ATTRIBUTE | ( | 8 | , | |
public | , | |||
EWindowType | , | |||
prWindowType | ||||
) | [inline] |
Definition at line 57 of file SpectralAnalysisConfig.hxx.
CLAM::SpectralAnalysisConfig::__COMMON_DYN_ATTRIBUTE | ( | 7 | , | |
public | , | |||
int | , | |||
prWindowSize | ||||
) | [inline] |
Definition at line 56 of file SpectralAnalysisConfig.hxx.
CLAM::SpectralAnalysisConfig::__COMMON_DYN_ATTRIBUTE | ( | 6 | , | |
public | , | |||
int | , | |||
prFFTSize | ||||
) | [inline] |
Definition at line 54 of file SpectralAnalysisConfig.hxx.
CLAM::SpectralAnalysisConfig::__COMMON_DYN_ATTRIBUTE | ( | 5 | , | |
public | , | |||
int | , | |||
prSamplingRate | ||||
) | [inline] |
Definition at line 53 of file SpectralAnalysisConfig.hxx.
CLAM::SpectralAnalysisConfig::__COMMON_DYN_ATTRIBUTE | ( | 4 | , | |
public | , | |||
int | , | |||
prZeroPadding | ||||
) | [inline] |
Definition at line 52 of file SpectralAnalysisConfig.hxx.
CLAM::SpectralAnalysisConfig::__COMMON_DYN_ATTRIBUTE | ( | 3 | , | |
public | , | |||
int | , | |||
prHopSize | ||||
) | [inline] |
Definition at line 51 of file SpectralAnalysisConfig.hxx.
Definition at line 50 of file SpectralAnalysisConfig.hxx.
CLAM::SpectralAnalysisConfig::__COMMON_DYN_ATTRIBUTE | ( | 1 | , | |
public | , | |||
CircularShiftConfig | , | |||
CircularShift | ||||
) | [inline] |
Definition at line 49 of file SpectralAnalysisConfig.hxx.
CLAM::SpectralAnalysisConfig::__COMMON_DYN_ATTRIBUTE | ( | 0 | , | |
public | , | |||
WindowGeneratorConfig | , | |||
WindowGenerator | ||||
) | [inline] |
Configuration for children Processing Objects.
Definition at line 48 of file SpectralAnalysisConfig.hxx.
CLAM::SpectralAnalysisConfig::__COMMON_DYNAMIC_TYPE | ( | SpectralAnalysisConfig | , | |
9 | ||||
) |
TSize CLAM::SpectralAnalysisConfig::GetHopSize | ( | ) | const |
returns HopSize in number of samples.
Definition at line 109 of file SpectralAnalysisConfig.cxx.
Referenced by SetWindowSize().
TData CLAM::SpectralAnalysisConfig::GetSamplingRate | ( | ) | const |
returns SamplingRate
Definition at line 122 of file SpectralAnalysisConfig.cxx.
TSize CLAM::SpectralAnalysisConfig::GetWindowSize | ( | ) | const |
Getter for window size.
Actually returns size of the window generator.
Definition at line 72 of file SpectralAnalysisConfig.cxx.
Referenced by CLAM::SpectralAnalysis::Do(), SetSamplingRate(), and SetZeroPadding().
const EWindowType & CLAM::SpectralAnalysisConfig::GetWindowType | ( | ) | const |
Getter for window type, returns window type in Window Generator.
Definition at line 84 of file SpectralAnalysisConfig.cxx.
int CLAM::SpectralAnalysisConfig::GetZeroPadding | ( | ) | const |
returns ZeroPaddingFactor being used.
Definition at line 97 of file SpectralAnalysisConfig.cxx.
Referenced by SetWindowSize(), and SetZeroPadding().
bool CLAM::SpectralAnalysisConfig::LoadCircularShift | ( | CLAM::Storage & | s | ) | [inline] |
Definition at line 49 of file SpectralAnalysisConfig.hxx.
bool CLAM::SpectralAnalysisConfig::LoadFFT | ( | CLAM::Storage & | s | ) | [inline] |
Definition at line 50 of file SpectralAnalysisConfig.hxx.
bool CLAM::SpectralAnalysisConfig::LoadprFFTSize | ( | CLAM::Storage & | s | ) | [inline] |
Definition at line 54 of file SpectralAnalysisConfig.hxx.
bool CLAM::SpectralAnalysisConfig::LoadprHopSize | ( | CLAM::Storage & | s | ) | [inline] |
Definition at line 51 of file SpectralAnalysisConfig.hxx.
bool CLAM::SpectralAnalysisConfig::LoadprSamplingRate | ( | CLAM::Storage & | s | ) | [inline] |
Definition at line 53 of file SpectralAnalysisConfig.hxx.
bool CLAM::SpectralAnalysisConfig::LoadprWindowSize | ( | CLAM::Storage & | s | ) | [inline] |
Definition at line 56 of file SpectralAnalysisConfig.hxx.
bool CLAM::SpectralAnalysisConfig::LoadprWindowType | ( | CLAM::Storage & | s | ) | [inline] |
Definition at line 57 of file SpectralAnalysisConfig.hxx.
bool CLAM::SpectralAnalysisConfig::LoadprZeroPadding | ( | CLAM::Storage & | s | ) | [inline] |
Definition at line 52 of file SpectralAnalysisConfig.hxx.
bool CLAM::SpectralAnalysisConfig::LoadWindowGenerator | ( | CLAM::Storage & | s | ) | [inline] |
Definition at line 48 of file SpectralAnalysisConfig.hxx.
void CLAM::SpectralAnalysisConfig::SetHopSize | ( | TSize | h | ) |
Sets Analysis Hop size in number of samples.
This setter only changes attribute but does not change configurations accordingly! VIP: It assumes that a SetWindowSize is called afterwards.
Definition at line 104 of file SpectralAnalysisConfig.cxx.
Referenced by SetWindowSize(), and Sync().
void CLAM::SpectralAnalysisConfig::SetSamplingRate | ( | TData | sr | ) |
Sets Sampling rate of the input audio.
Sampling rate of the input audio.
It calls SetWindowSize for synchronizing existing configurations.
for sychronizing existing config
Definition at line 115 of file SpectralAnalysisConfig.cxx.
References GetWindowSize(), and SetWindowSize().
Referenced by Sync().
void CLAM::SpectralAnalysisConfig::SetWindowSize | ( | TSize | w | ) |
Sets Analysis Window size in num.
of samples. This setter actually changes window size in the window generator, size of the FFT, and amount of circular shift. If new window size is smaller than twice the hop size plus one, hop size is also modified to that value. Note1: for best results, window size should be set to odd number. Note2: this setter should be called after the hop size has already been set.
Definition at line 59 of file SpectralAnalysisConfig.cxx.
References CLAM_ASSERT, CLAM_pow(), GetHopSize(), GetZeroPadding(), nextPowerOfTwo(), and SetHopSize().
Referenced by SetSamplingRate(), and Sync().
void CLAM::SpectralAnalysisConfig::SetWindowType | ( | const EWindowType & | t | ) |
Sets Analysis Window type, modifying configuration of child Window Generator configuration.
Analysis Window type.
Definition at line 78 of file SpectralAnalysisConfig.cxx.
Referenced by Sync().
void CLAM::SpectralAnalysisConfig::SetZeroPadding | ( | int | z | ) |
Sets Zero padding factor.
Zero padding factor.
It changes FFTSize and Circular shift accordingly. If factor is 0, FFTSize is set to WindowSize-1 next power of two (assumes window size is odd!) Assuming a WindowSize of 513, see following table to understand how the factor works: ZeroPaddingFactor FFTSize -1 256 0 512 1 1024 2 2048
Definition at line 90 of file SpectralAnalysisConfig.cxx.
References CLAM_pow(), GetWindowSize(), GetZeroPadding(), and nextPowerOfTwo().
Referenced by Sync().
void CLAM::SpectralAnalysisConfig::Sync | ( | ) |
synchronize configuration values just in case they had been modified directly
Definition at line 128 of file SpectralAnalysisConfig.cxx.
References SetHopSize(), SetSamplingRate(), SetWindowSize(), SetWindowType(), and SetZeroPadding().
friend class SpectralAnalysis [friend] |
Definition at line 44 of file SpectralAnalysisConfig.hxx.