Closed jpaasen closed 1 year ago
Hi @jpaasen . Pull request?
I can do a PR with improvements to the doc. I just wanted to establish if this behavior was intentional or not.
Looking at librosa.resample, that exposes libsamplerate
for some of its supported res_type
values, there are no warnings about using ‘linear’ for down-sampling. So the misconception seems "widespread".
We need to ask @erikd. But he doesn't answer.
The linear sample rate converter is provided for completeness and for something to compare actually good converters against.
If you want sample rate conversion without aliasing, then used the SRC_SINC_*
converters.
Hi @erikd :smile:
There is no anti-aliasing filter applied for the Linear resampling mode.
So if you create the following chirp:
and you resample (down) with
Linear
you get:This might be intentional, but it is not straightforward from the documentation that this is the case.
The documentation says:
The line
This is the fastest bandlimited interpolator
forSRC_SINC_FASTEST
implies that the latter two options are not band-limited.The documentation could be improved with a line or two, stating the latter two options should NOT be used without the user taking care of the anti-aliasing filtering him/herself.
If you downsample using
SRC_SINC_FASTEST
.libsamplerate
takes care of the anti-aliasing filtering: