xiph / speexdsp

Speex audio processing library - THIS IS A MIRROR, DEVELOPMENT HAPPENS AT https://gitlab.xiph.org/xiph/speexdsp
https://speex.org
Other
469 stars 190 forks source link

Frequency bounce in dynamic resampling with noisy input sine #29

Open ct-pcc opened 4 years ago

ct-pcc commented 4 years ago

When using dynamic resampling of a noisy sine (e.g. with 977 Hz) from e.g. 48000 Hz samplerate to 480001 samplerate, a frequency bounce of the resulting sine is visible which exceeds the actual frequency adaption.

Tested with

This issue doesn't occur with a generated sine of the same frequency. This issue isn't visible with other resamplers as soxr or secret-rabbit-code (src) aka libsamplerate.

A sample code including WAV header handling is included. It can be used to generate a sine or use an input file (also attached). The resulting fundamental frequencies over time are attached for the original input and output signals. A similar plot can be achieved by using e.g. SonicVisualizer ('Layer' -> 'Add Peak Frequency Spectrogram' with max. Window size and a frequency zoom from 976 to 978 Hz).

Attachments: