CLAM-Development  1.1
Public Member Functions | Protected Member Functions | Protected Attributes
CLAM::SpectralPeakDetect Class Reference

This class is dedicated to find magnitude SpectralPeaks in a given spectral frame. More...

#include <SpectralPeakDetect.hxx>

List of all members.

Public Member Functions

 SpectralPeakDetect ()
 Base constructor of class.
 SpectralPeakDetect (const SpectralPeakDetectConfig &c)
 Constructor with an object of SpectralPeakDetectConfig class by parameter.
virtual ~SpectralPeakDetect ()
 Destructor of the class.
const ProcessingConfigGetConfig () const
 This method allows to obtain the SpectralPeakDetectConfig object of the class.
bool Do (void)
 Supervised Do() function.
bool Do (const Spectrum &input, SpectralPeakArray &out)
 Unsupervised Do function, receives an Spectrum object input, and the output of method is an SpectralPeakArray (passed by parameter)
bool SetPrototypes (Spectrum &inputs, const SpectralPeakArray &out)
 Change the internal type state.
bool SetPrototypes ()
bool UnsetPrototypes ()
bool MayDisableExecution () const

Protected Member Functions

const char * GetClassName () const
 This method returns the name of the object.
bool ConcreteConfigure (const ProcessingConfig &)
 Config change method.

Protected Attributes

SpectralPeakDetectConfig mConfig
InPort< SpectrummInput
OutPort< SpectralPeakArraymOutput

Detailed Description

This class is dedicated to find magnitude SpectralPeaks in a given spectral frame.

The spectral frame has to be in phase/magnitudes (in dB's) format for the algorithm.

In order to get a better frequency solution, the precise SpectralPeakBinPosition is interpolated. The Magnitude at this interpolated BinPos is calculated a 3-point curve-fit, phase is interpolated linearly.

The type of the output is SpectralPeakArray

Definition at line 48 of file SpectralPeakDetect.hxx.


Constructor & Destructor Documentation

Base constructor of class.

Calls Configure method with a SpectralPeakDetectConfig initialised by default

Definition at line 33 of file SpectralPeakDetect.cxx.

References CLAM::Processing::Configure().

Constructor with an object of SpectralPeakDetectConfig class by parameter.

Parameters:
cSpectralPeakDetectConfig object created by the user

Definition at line 40 of file SpectralPeakDetect.cxx.

References CLAM::Processing::Configure().

Destructor of the class.

Definition at line 47 of file SpectralPeakDetect.cxx.


Member Function Documentation

bool CLAM::SpectralPeakDetect::ConcreteConfigure ( const ProcessingConfig c) [protected, virtual]

Config change method.

Parameters:
TheProcessingConfig object
Precondition:
the argument should be an SpectralPeakDetectConfig object.
Returns:
True if the cast has been commited correctly

Reimplemented from CLAM::Processing.

Definition at line 53 of file SpectralPeakDetect.cxx.

References CLAM::Processing::CopyAsConcreteConfig(), and mConfig.

bool CLAM::SpectralPeakDetect::Do ( void  ) [virtual]
bool CLAM::SpectralPeakDetect::Do ( const Spectrum input,
SpectralPeakArray out 
)

Unsupervised Do function, receives an Spectrum object input, and the output of method is an SpectralPeakArray (passed by parameter)

Parameters:
inputThe spectrum we want to get the SpectralPeaks
outAn SpectralPeakArray object where will be setted the SpectralPeaks of Spectrum in.
Returns:
Boolean value, true if all has been executed correctly.

Definition at line 101 of file SpectralPeakDetect.cxx.

References CLAM::Array< T >::AddElem(), CLAM_ASSERT, CLAM::Spectrum::GetMag(), CLAM::SpectralPeakArray::GetnMaxPeaks(), CLAM::Spectrum::GetPhase(), CLAM::Spectrum::GetSize(), mConfig, PI, CLAM::SpectralPeakArray::SetnMaxPeaks(), CLAM::SpectralPeakArray::SetnPeaks(), and TWO_PI.

const char* CLAM::SpectralPeakDetect::GetClassName ( ) const [inline, protected, virtual]

This method returns the name of the object.

Returns:
Char pointer with the name of object

Implements CLAM::Processing.

Definition at line 60 of file SpectralPeakDetect.hxx.

const ProcessingConfig& CLAM::SpectralPeakDetect::GetConfig ( ) const [inline, virtual]

This method allows to obtain the SpectralPeakDetectConfig object of the class.

Returns:
The configuration of the class

Reimplemented from CLAM::Processing.

Definition at line 84 of file SpectralPeakDetect.hxx.

References mConfig.

Definition at line 108 of file SpectralPeakDetect.hxx.

Change the internal type state.

Apart from prototype configuration, the Size, Scale and SpectralRange attributes of each Spectrum are also checked.

Definition at line 62 of file SpectralPeakDetect.cxx.

Definition at line 67 of file SpectralPeakDetect.cxx.

Definition at line 72 of file SpectralPeakDetect.cxx.


Member Data Documentation

Definition at line 51 of file SpectralPeakDetect.hxx.

Referenced by ConcreteConfigure(), Do(), and GetConfig().

Definition at line 53 of file SpectralPeakDetect.hxx.

Referenced by Do().

Definition at line 54 of file SpectralPeakDetect.hxx.

Referenced by Do().


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