b=1074765 use greater weight for nearer sample in PeriodicWave interpolation r=rillian

--HG--
extra : rebase_source : 0c6ac8b0a870caa4bf5e770fe431aebe25b5af26
This commit is contained in:
Karl Tomlinson 2014-09-30 17:30:30 +13:00
Родитель 534ee9bcad
Коммит b7f87dd74c
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -395,12 +395,12 @@ public:
j2 -= periodicWaveSize;
}
float sampleInterpolationFactor = mPhase - j1;
float lower = sampleInterpolationFactor * lowerWaveData[j1] +
(1 - sampleInterpolationFactor) * lowerWaveData[j2];
float higher = sampleInterpolationFactor * higherWaveData[j1] +
(1 - sampleInterpolationFactor) * higherWaveData[j2];
aOutput[i] = tableInterpolationFactor * lower +
(1 - tableInterpolationFactor) * higher;
float lower = (1.0f - sampleInterpolationFactor) * lowerWaveData[j1] +
sampleInterpolationFactor * lowerWaveData[j2];
float higher = (1.0f - sampleInterpolationFactor) * higherWaveData[j1] +
sampleInterpolationFactor * higherWaveData[j2];
aOutput[i] = (1.0f - tableInterpolationFactor) * lower +
tableInterpolationFactor * higher;
mPhase += basePhaseIncrement * mFinalFrequency;
}