MCPcopy Create free account
hub / github.com/audacity/audacity / EnvLogToLin

Method EnvLogToLin

src/effects/EqualizationBandSliders.cpp:124–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124void EqualizationBandSliders::EnvLogToLin(void)
125{
126 auto &parameters = mCurvesList.mParameters;
127 auto &linEnvelope = parameters.mLinEnvelope;
128 auto &logEnvelope = parameters.mLogEnvelope;
129 const auto &hiFreq = parameters.mHiFreq;
130
131 size_t numPoints = logEnvelope.GetNumberOfPoints();
132 if( numPoints == 0 )
133 {
134 return;
135 }
136
137 Doubles when{ numPoints };
138 Doubles value{ numPoints };
139
140 linEnvelope.Flatten(0.);
141 linEnvelope.SetTrackLen(1.0);
142 logEnvelope.GetPoints( when.get(), value.get(), numPoints );
143 linEnvelope.Reassign(0., value[0]);
144 double loLog = log10(20.);
145 double hiLog = log10(hiFreq);
146 double denom = hiLog - loLog;
147
148 for (size_t i = 0; i < numPoints; i++)
149 linEnvelope.Insert(pow( 10., ((when[i] * denom) + loLog))/hiFreq , value[i]);
150 linEnvelope.Reassign(1., value[numPoints-1]);
151}
152
153void EqualizationBandSliders::EnvLinToLog(void)
154{

Callers 2

UpdateDrawMethod · 0.80
OnLinFreqMethod · 0.80

Calls 7

GetNumberOfPointsMethod · 0.80
SetTrackLenMethod · 0.80
GetPointsMethod · 0.80
ReassignMethod · 0.80
FlattenMethod · 0.45
getMethod · 0.45
InsertMethod · 0.45

Tested by

no test coverage detected