Pitch shift with timbre preservation using the SMS model. More...
#include <SMSPitchShift.hxx>
Public Member Functions | |
SMSPitchShift () | |
~SMSPitchShift () | |
bool | ConcreteConfigure (const ProcessingConfig &config) |
Configuration method interface. | |
bool | Do (const SpectralPeakArray &inPeaks, const Fundamental &inFund, const Spectrum &inRes, SpectralPeakArray &outPeaks, Fundamental &outFund, Spectrum &outRes) |
bool | Do (const Frame &in, Frame &out) |
bool | Do () |
Supervised mode execution method (using ports). | |
Public Attributes | |
FloatInControl | mIgnoreResidual |
In some cases, such as in the harmonizer it makes sense to ignore the residual spectrum in order to keep things manageable. |
Pitch shift with timbre preservation using the SMS model.
In order to preserve timbre, the original spectral shape is extracted and then applied back.
Definition at line 47 of file SMSPitchShift.hxx.
CLAM::SMSPitchShift::SMSPitchShift | ( | ) | [inline] |
Definition at line 61 of file SMSPitchShift.hxx.
References CLAM::Processing::Configure().
CLAM::SMSPitchShift::~SMSPitchShift | ( | ) | [inline] |
Definition at line 76 of file SMSPitchShift.hxx.
bool CLAM::SMSPitchShift::ConcreteConfigure | ( | const ProcessingConfig & | ) | [inline, virtual] |
Configuration method interface.
The Processing base class forces all the concrete classes derived from it to implement this method, which must actually perform the specific configuration tasks.
Note that the user can not call this method directly. He will use Configure instead. The argument is expected to be an object of the necesary concrete configuration class.
Reference | to the configuration object. |
true if the processing object is left in a consistent state, and can be executed.
This | method must throw a bad_cast exception if the argument is not an object of the expected configuration class. |
Reimplemented from CLAM::Processing.
Definition at line 78 of file SMSPitchShift.hxx.
References CLAM::InControl< ControlDataType >::DoControl(), mIgnoreResidual, CLAM::InControlBase::SetBounds(), and CLAM::InControlBase::SetDefaultValue().
bool CLAM::SMSPitchShift::Do | ( | ) | [inline, virtual] |
Supervised mode execution method (using ports).
Implements CLAM::Processing.
Definition at line 99 of file SMSPitchShift.hxx.
References CLAM::InPort< Token >::Consume(), CLAM::OutPort< Token >::GetData(), CLAM::InPort< Token >::GetData(), and CLAM::OutPort< Token >::Produce().
Referenced by Do().
Implements CLAM::FrameTransformation.
Definition at line 111 of file SMSPitchShift.cxx.
References Do().
bool CLAM::SMSPitchShift::Do | ( | const SpectralPeakArray & | inPeaks, | |
const Fundamental & | inFund, | |||
const Spectrum & | inRes, | |||
SpectralPeakArray & | outPeaks, | |||
Fundamental & | outFund, | |||
Spectrum & | outRes | |||
) |
Definition at line 40 of file SMSPitchShift.cxx.
References CLAM::FDCombFilter::Do(), CLAM::SpectralEnvelopeApply::Do(), CLAM::SpectralEnvelopeExtract::Do(), CLAM::InControl< ControlDataType >::DoControl(), CLAM::Fundamental::GetFreq(), CLAM::InControl< ControlDataType >::GetLastValue(), CLAM::Fundamental::GetnCandidates(), CLAM::SpectralPeakArray::GetnPeaks(), CLAM::FrameTransformation::mConfig, CLAM::FDCombFilter::mFreq, mIgnoreResidual, CLAM::Fundamental::SetFreq(), and CLAM::SpectralPeakArray::SetnPeaks().
In some cases, such as in the harmonizer it makes sense to ignore the residual spectrum in order to keep things manageable.
This should if fact be a configuration param, but we don't want to introduce specific params that prevent us from using the generic one
Definition at line 128 of file SMSPitchShift.hxx.
Referenced by ConcreteConfigure(), Do(), CLAM::SMSHarmonizer::IgnoreResidual(), and CLAM::SegmentSMSHarmonizer::IgnoreResidual().