CLAM-Development  1.4.0
Public Member Functions | Friends
CLAM::SpectralAnalysisConfig Class Reference

Configuration class for Spectral Analysis class It includes specific parameters: HopSize, ZeroPadding, Sampling Rate and FFTSize. More...

#include <SpectralAnalysisConfig.hxx>

List of all members.

Public Member Functions

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 EWindowTypeGetWindowType () 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
- Public Member Functions inherited from CLAM::ProcessingConfig
 ProcessingConfig (const int n)
 Constructor.
 ProcessingConfig (const ProcessingConfig &prototype, bool shareData=false, bool deep=true)
 Copy constructor.
virtual ~ProcessingConfig ()
virtual const char * GetClassName () const
 Return the class name.
- Public Member Functions inherited from CLAM::DynamicType
 DynamicType (const int nAttr)
 Constructs a DynamicType object that can hold.
 DynamicType (const DynamicType &prototype, const bool shareData, const bool deepCopy)
 Copy constructor of a dynamic Type.
 DynamicType (const DynamicType &prototype)
virtual ~DynamicType ()
void CopyInit (const DynamicType &dt)
 This method allows custom code for the copy-constructor of a dynamic type, since the copy-constructor is macro expanded and can not be overwritted.
bool UpdateData ()
 Method used to resize the data space of the dynamic type, necessary when some AddXXX() / RemoveXXX() (where XXX is an attribute name) has been done.
unsigned GetNDynamicAttributes () const
const char * GetDynamicAttributeName (unsigned i)
virtual const std::type_info & GetTypeId (unsigned i) const =0
bool AttributeIsComponent (unsigned i) const
bool AttributeIsDynamictype (unsigned i) const
bool IsAttributeInstantiated (unsigned i) const
const void * GetAttributeAsVoidPtr (unsigned i) const
const ComponentGetAttributeAsComponent (unsigned i) const
ComponentGetAttributeAsComponent (unsigned i)
void FullfilsInvariant () const
virtual ComponentDeepCopy () const
void Debug () const
virtual void StoreOn (CLAM::Storage &storage) const
 Stores component's subitems on the given Storage.
virtual void LoadFrom (CLAM::Storage &storage)
 Loads component's subitems from the given Storage.
- Public Member Functions inherited from CLAM::Component
virtual ~Component ()

Friends

class SpectralAnalysis

Detailed Description

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.


Member Function Documentation

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().

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.

See also:
EWindowType

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

See also:
PowerOfTwo

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().


Friends And Related Function Documentation

friend class SpectralAnalysis
friend

Definition at line 44 of file SpectralAnalysisConfig.hxx.


The documentation for this class was generated from the following files: