mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1188704 limit number of Fourier coefficients used to halfSize earlier r=rillian
realP[halfSize] was always set to zero because numberOfPartials < halfSize + 1 was always true.
This commit is contained in:
parent
08e91712bf
commit
57b96ec0de
@ -181,7 +181,9 @@ void PeriodicWave::createBandLimitedTables(const float* realData, const float* i
|
||||
unsigned halfSize = fftSize / 2;
|
||||
unsigned i;
|
||||
|
||||
numberOfComponents = std::min(numberOfComponents, halfSize + 1);
|
||||
// Limit the number of components used to those for frequencies below the
|
||||
// Nyquist of the fixed length inverse FFT.
|
||||
numberOfComponents = std::min(numberOfComponents, halfSize);
|
||||
|
||||
m_bandLimitedTables.SetCapacity(m_numberOfRanges);
|
||||
|
||||
@ -218,16 +220,12 @@ void PeriodicWave::createBandLimitedTables(const float* realData, const float* i
|
||||
realP[i] = 0;
|
||||
imagP[i] = 0;
|
||||
}
|
||||
// Clear nyquist if necessary.
|
||||
if (numberOfPartials < halfSize + 1)
|
||||
realP[halfSize] = 0;
|
||||
|
||||
// Clear any DC-offset.
|
||||
realP[0] = 0;
|
||||
|
||||
// Clear values which have no effect.
|
||||
// Clear value which has no effect.
|
||||
imagP[0] = 0;
|
||||
imagP[halfSize] = 0;
|
||||
|
||||
// Create the band-limited table.
|
||||
AlignedAudioFloatArray* table = new AlignedAudioFloatArray(m_periodicWaveSize);
|
||||
|
Loading…
Reference in New Issue
Block a user