31 "key",
"SegmentSMSMorph",
33 "description",
"SegmentSMSMorph",
36 static FactoryRegistrator<ProcessingFactory, SegmentSMSMorph>
reg =
metadata;
40 mHybBPF(
"MorphFactor",this),
41 mSynchronizeTime(
"Time", this),
42 mHybSinAmp(
"SinAmp", this),
43 mHybSinSpectralShape(
"SinShape", this),
44 mHybSinShapeW1(
"SinShapeW1", this),
45 mHybSinShapeW2(
"SinShapeW2", this),
46 mHybPitch(
"Pitch", this),
47 mHybSinFreq(
"SinFreq", this),
48 mHybResAmp(
"ResAmp", this),
49 mHybResSpectralShape(
"ResShape", this),
50 mHybResShapeW1(
"ResShapeW1", this),
51 mHybResShapeW2(
"ResShapeW2", this),
69 mHybBPF(
"MorphFactor",this),
70 mSynchronizeTime(
"Time", this),
71 mHybSinAmp(
"SinAmp", this),
72 mHybSinSpectralShape(
"SinShape", this),
73 mHybSinShapeW1(
"SinShapeW1", this),
74 mHybSinShapeW2(
"SinShapeW2", this),
75 mHybPitch(
"Pitch", this),
76 mHybSinFreq(
"SinFreq", this),
77 mHybResAmp(
"ResAmp", this),
78 mHybResSpectralShape(
"ResShape", this),
79 mHybResShapeW1(
"ResShapeW1", this),
80 mHybResShapeW2(
"ResShapeW2", this),
118 cfg.SetSpectralRange(
mConfig.GetSamplingRate()/2);
130 frIntCfg.SetUseSpectralShape(
true);
137 "Failed to configure Frame interpolator in SegmentSMSMorph::ConcreteConfigure" );
179 if(
mConfig.GetInterpolateFrame())
208 int frameNo1=
int(floor(synchroTimeFactor));
209 int frameNo2=
int(ceil(synchroTimeFactor));
212 TData frameFactor=synchroTimeFactor-frameNo1;
236 TData globalFactor=0;
242 globalFactor=
mConfig.GetHybBPF().GetValue(pos);
249 pos=
mConfig.GetSynchronizeTime().GetValue(pos);
296 if(
mConfig.HasSynchronizeTime() &&
mConfig.GetSynchronizeTime().Size() )
306 if(
mConfig.GetUseSpectralShapes())
318 BPF spectralShapeBPF;
319 TData spectralRange=spectralShape.GetSpectralRange();
322 bool usingFirst=
false;
323 if(weightBPF1.
Size()>weightBPF2.
Size())
325 nPoints=weightBPF1.
Size();
328 else nPoints=weightBPF2.
Size();
333 for(i=0;i<nPoints;i++)
337 xValue*=spectralRange;
338 spectralShapeBPF.
Insert(xValue,yValue);
343 for(i=0;i<nPoints;i++)
347 xValue*=spectralRange;
348 spectralShapeBPF.
Insert(xValue,yValue);
351 spectralShape.SetMagBPF(spectralShapeBPF);
359 cfg.SetMaxNumPeaks( 100 );
360 cfg.SetFileName( fileName );
361 cfg.SetEnableResidual(
true );