From: Richard Guenther <richard.guenther@gm...> - 2006-11-25 17:57:00
Richard Guenther wrote:
> Philip Walden wrote:
>> I am very new to glame and have version 2.0.1.
>> I have some 8000Hz wav files recorded off my Sansa MP3 player. I was
>> trying to boost their volume and add them as background sounds to some
>> mpeg videos.
>> The mpeg encoder wants the source at 44100Hz.
>> When I import the 8000Hz wav files, I check the resample box and set the
>> Rate to 44100. After the import completes, the Rate is reported as
>> 44085Hz, not 44100Hz as requested.
>> Is this a bug or am I doing something wrong?
>> When I export the file, the encoder reports the file is in fact 44085Hz
>> and stops.
> I have fixed some rounding issues in the fft based resampler which makes
> the above error (with 512 samples blocksize) smaller, producing 44093Hz.
> Note that this error is simply due to the fact that an exact 44100Hz
> would require to resample the 512 sample blocks FFT data to 2822.4
> sample blocks FFT data, which is of course not possible. So we choose
> 2822 sample blocks FFT data which results in this frequency "error".
> As computers have become faster, I have increased the default blocksize
> for resampling to 2048 which makes the error 1Hz in your case (but it
> takes some more time for resampling).
> Now for better user experience the exact wanted target sample-rate will
> also be "set" on the imported file, ignoring the fact that the
> conversion is never exact.
Experimenting further we can reduce the error (without increasing block
size) by compensating for the error in the IFFT. Done so, makes the
shift caused by 44100Hz -> 8000Hz -> 44100Hz resampling to go way down
(there's still some, I'll try to do some more tuning.)