#include <Fundamental.hxx>
There are getters and setters, but for efficiency work directly on the buffer.
Definition at line 44 of file Fundamental.hxx.
Public Member Functions | |
DYNAMIC_TYPE_USING_INTERFACE (Fundamental, 2, ProcessingData) | |
DYN_ATTRIBUTE (0, public, DataArray, CandidatesFreq) | |
Array with the candidate frequencies. | |
DYN_ATTRIBUTE (1, public, DataArray, CandidatesErr) | |
Array with the error of candidate frequencies. | |
void | SetnMaxCandidates (TSize nMaxCandidates) |
TSize | GetnMaxCandidates () const |
void | SetnCandidates (int size) |
int | GetnCandidates () const |
TData | GetFreq (TIndex pos=0) const |
Returns the Frequency of a given position in the candidate array. | |
TData | GetErr (TIndex pos=0) const |
Returns the Error of a given position in the candidate array. | |
void | SetFreq (TIndex pos, TData newFreq) |
Changes the frequency of a candidate at a given index. | |
void | SetErr (TIndex pos, TData newErr) |
Changes the error of a candidate at a given index. | |
void | AddElem (TData freq=0.f, TData err=0.f) |
Adds a candidate, in frequencies array and errors array. | |
void | InsertElem (TIndex pos, TData freq=0.f, TData err=0.f) |
Adds a candidate, in frequencies array and errors array, and uses parameter pos to insert it in the arrays. | |
void | DeleteElem (TIndex pos) |
Delete an element of both arrays (frequency and error) given its position. | |
void | SortByFrequency () |
Sort the arrays by frequency. | |
void | SortByError () |
Sort the arrays by estimated error. | |
void | Init () |
Initializes data. | |
Protected Member Functions | |
void | DefaultInit () |
The concrete dynamic type constructor calls DefaultInit(). |
CLAM::Fundamental::DYNAMIC_TYPE_USING_INTERFACE | ( | Fundamental | , | |
2 | , | |||
ProcessingData | ||||
) |
CLAM::Fundamental::DYN_ATTRIBUTE | ( | 0 | , | |
public | , | |||
DataArray | , | |||
CandidatesFreq | ||||
) |
Array with the candidate frequencies.
CLAM::Fundamental::DYN_ATTRIBUTE | ( | 1 | , | |
public | , | |||
DataArray | , | |||
CandidatesErr | ||||
) |
Array with the error of candidate frequencies.
void CLAM::Fundamental::DefaultInit | ( | void | ) | [protected] |
The concrete dynamic type constructor calls DefaultInit().
This allows user to initialize his/her object. But we define DefaultInit() here because we don't want to force writting one DefaultInit() function for each concrete dynamic type. If a dynamic type concrete class defines some (not-default) constructors, this should also call the DefaultInit().
Reimplemented from CLAM::DynamicType.
Definition at line 39 of file Fundamental.cxx.
References SetnCandidates(), SetnMaxCandidates(), and CLAM::DynamicType::UpdateData().
void CLAM::Fundamental::SetnMaxCandidates | ( | TSize | nMaxCandidates | ) | [inline] |
Definition at line 57 of file Fundamental.hxx.
Referenced by DefaultInit(), and CLAM::FundFreqDetect::Do().
TSize CLAM::Fundamental::GetnMaxCandidates | ( | ) | const [inline] |
Definition at line 66 of file Fundamental.hxx.
Referenced by CLAM::FundFreqDetect::Do(), and InsertElem().
void CLAM::Fundamental::SetnCandidates | ( | int | size | ) | [inline] |
Definition at line 77 of file Fundamental.hxx.
Referenced by DefaultInit(), CLAM::SMSMorph::Do(), CLAM::FundFreqDetect::Do(), and Init().
int CLAM::Fundamental::GetnCandidates | ( | ) | const [inline] |
Definition at line 86 of file Fundamental.hxx.
Referenced by DeleteElem(), CLAM::SMSPitchShift::Do(), CLAM::SMSMorph::Do(), CLAM::FundFreqDetect::Do(), InsertElem(), SetErr(), SetFreq(), SortByError(), and SortByFrequency().
Returns the Frequency of a given position in the candidate array.
pos | Position we want to get frequency, 0 by default |
Definition at line 52 of file Fundamental.cxx.
References CLAM_DEBUG_ASSERT.
Referenced by CLAM::SMSPitchShift::Do(), CLAM::SMSPitchDiscretization::Do(), CLAM::SMSMorph::Do(), CLAM::SMSGenderChange::Do(), CLAM::FundFreqDetect::Do(), CLAM::Fundamental2Control::Do(), and CLAM::Fund2MIDI::Do().
Returns the Error of a given position in the candidate array.
pos | Position we want to get frequency, 0 by default |
Definition at line 66 of file Fundamental.cxx.
References CLAM_DEBUG_ASSERT.
Changes the frequency of a candidate at a given index.
pos | Position to change the frequency | |
newFreq | New value of this position |
Definition at line 73 of file Fundamental.cxx.
References CLAM_DEBUG_ASSERT, and GetnCandidates().
Referenced by CLAM::SMSPitchShift::Do(), and CLAM::SMSMorph::Do().
Changes the error of a candidate at a given index.
pos | Position to change the error | |
newFreq | New value of this position |
Definition at line 81 of file Fundamental.cxx.
References CLAM_DEBUG_ASSERT, and GetnCandidates().
Adds a candidate, in frequencies array and errors array.
freq | The frequency value of new candidate, 0 by default | |
err | The estimated error of new candidate, 0 by default |
Definition at line 90 of file Fundamental.cxx.
References CLAM_DEBUG_ASSERT.
Referenced by CLAM::SMSPitchDiscretization::Do(), CLAM::SMSMorph::Do(), CLAM::FundFreqDetect::Do(), and CLAM::SegmentSMSHarmonizer::SegmentSMSHarmonizer().
Adds a candidate, in frequencies array and errors array, and uses parameter pos to insert it in the arrays.
pos | Position where we want to insert the new element | |
freq | The frequency value of new candidate, 0 by default | |
err | The estimated error of new candidate, 0 by default |
Definition at line 101 of file Fundamental.cxx.
References CLAM_ASSERT, CLAM_DEBUG_ASSERT, GetnCandidates(), and GetnMaxCandidates().
void CLAM::Fundamental::DeleteElem | ( | TIndex | pos | ) |
Delete an element of both arrays (frequency and error) given its position.
Position | that we wanto to eliminate |
Definition at line 111 of file Fundamental.cxx.
References CLAM_ASSERT, CLAM_DEBUG_ASSERT, and GetnCandidates().
void CLAM::Fundamental::SortByFrequency | ( | ) |
Sort the arrays by frequency.
Definition at line 121 of file Fundamental.cxx.
References GetnCandidates().
void CLAM::Fundamental::SortByError | ( | ) |
Sort the arrays by estimated error.
Definition at line 138 of file Fundamental.cxx.
References GetnCandidates().
Referenced by CLAM::FundFreqDetect::Do().
void CLAM::Fundamental::Init | ( | ) | [inline] |
Initializes data.
Definition at line 159 of file Fundamental.hxx.
References SetnCandidates().
Referenced by CLAM::FundFreqDetect::Do().