CLAM-Development
1.1
|
This class is dedicated to find magnitude SpectralPeaks in a given spectral frame. More...
#include <SpectralPeakDetect.hxx>
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 ProcessingConfig & | GetConfig () 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< Spectrum > | mInput |
OutPort< SpectralPeakArray > | mOutput |
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.
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().
CLAM::SpectralPeakDetect::SpectralPeakDetect | ( | const SpectralPeakDetectConfig & | c = SpectralPeakDetectConfig() | ) |
Constructor with an object of SpectralPeakDetectConfig class by parameter.
c | SpectralPeakDetectConfig object created by the user |
Definition at line 40 of file SpectralPeakDetect.cxx.
References CLAM::Processing::Configure().
CLAM::SpectralPeakDetect::~SpectralPeakDetect | ( | ) | [virtual] |
Destructor of the class.
Definition at line 47 of file SpectralPeakDetect.cxx.
bool CLAM::SpectralPeakDetect::ConcreteConfigure | ( | const ProcessingConfig & | c | ) | [protected, virtual] |
Config change method.
The | ProcessingConfig object |
Reimplemented from CLAM::Processing.
Definition at line 53 of file SpectralPeakDetect.cxx.
References CLAM::Processing::CopyAsConcreteConfig(), and mConfig.
bool CLAM::SpectralPeakDetect::Do | ( | void | ) | [virtual] |
Supervised Do() function.
Implements CLAM::Processing.
Definition at line 77 of file SpectralPeakDetect.cxx.
References CLAM::InPort< Token >::Consume(), Do(), CLAM::EScale::eLog, CLAM::InPort< Token >::GetData(), CLAM::OutPort< Token >::GetData(), mInput, mOutput, CLAM::OutPort< Token >::Produce(), and CLAM::Spectrum::ToDB().
Referenced by CLAM::SMSAnalysisCore::Do(), Do(), and CLAM::SpectralShapeShift::Do().
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)
input | The spectrum we want to get the SpectralPeaks |
out | An SpectralPeakArray object where will be setted the SpectralPeaks of Spectrum in. |
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.
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.
Reimplemented from CLAM::Processing.
Definition at line 84 of file SpectralPeakDetect.hxx.
References mConfig.
bool CLAM::SpectralPeakDetect::MayDisableExecution | ( | ) | const [inline] |
Definition at line 108 of file SpectralPeakDetect.hxx.
bool CLAM::SpectralPeakDetect::SetPrototypes | ( | Spectrum & | inputs, |
const SpectralPeakArray & | out | ||
) |
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.
Definition at line 51 of file SpectralPeakDetect.hxx.
Referenced by ConcreteConfigure(), Do(), and GetConfig().
InPort< Spectrum > CLAM::SpectralPeakDetect::mInput [protected] |
Definition at line 53 of file SpectralPeakDetect.hxx.
Referenced by Do().
OutPort< SpectralPeakArray > CLAM::SpectralPeakDetect::mOutput [protected] |
Definition at line 54 of file SpectralPeakDetect.hxx.
Referenced by Do().