Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Resampler plugin (Read 524129 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Resampler plugin

Reply #600
Speed comparison. The source file is a CD image, stereo, 16 bps, 44100 Hz. Duration reported by foobar2000: 55:41.150 (147 344 700 samples).
Conversion run untimed first so the source file gets cached in memory. C: is a fast NVMe SSD too, so not a bottleneck.

Code: [Select]
$ del C:\temp\out.wav & timer64 ffmpeg -i c:\temp\image.wav -af "ardftsrc=48000,atrim=start=0" -acodec pcm_f32le c:\temp\out.wav
- timed conversion ran three times, fastest run took 2.027 seconds. Average 2.065 s
- the conversion speed for the fastest run is 1648x realtime

$ del C:\temp\out.wav & timer64 ffmpeg7 -i c:\temp\image.wav -af "aresample=48000:resampler=soxr" -acodec pcm_f32le c:\temp\out.wav
- timed conversion ran three times, fastest run took 1.711 seconds. Average 1.711 s
- the conversion speed for the fastest run is 1953x realtime

The ardftsrc produced output length is still incorrect: 55:41.153 (160 375 360 samples)
Sox length is correct: 55:41.150 (160 375 184 samples)
147 344 700 / 44100 * 48000 = 160 375 183,67..., which rounds up to 160 375 184

Quality comparison:
Code: [Select]
$ ffmpeg -i swept_float.wv -af "ardftsrc=48000,atrim=start=0" -acodec pcm_f32le ardftsrc.wav
$ ffmpeg7 -i swept_float.wv -af "aresample=48000:resampler=soxr" -acodec pcm_f32le soxr.wav

$ ffmpeg7 -i ardftsrc.wav -lavfi showspectrumpic=s=1280x800 ardftsrc.png
$ ffmpeg7 -i soxr.wav -lavfi showspectrumpic=s=1280x800 soxr.png
$ ffmpeg7 -i swept_float.wv -lavfi showspectrumpic=s=1280x800 swept_float.png

ardftsrc.png:
X

soxr.png:
X

swept_float.png:
X

Edit: Added labels for images.

Re: Resampler plugin

Reply #601
you are free to increase quality parameter to 2x or 4x of original default value if you want more than 16bit (> 92dB) output quality.
visual transforms are not good way to represent how resampler is cutting high end of spectrum too much.
For example better to take up-sampling than down-sampling to original sample rate and compare output differences between resamplers and not by using visuals but comparing output with SDR (signal-to-distortion ratio) or similar measurements.

ardftsrc give superior quality compared to soxr resampler (when comparing with same quality parameters) at same or faster speed at lower latency and much lower complexity of code. (And ardftsrc code is not 100% hand optimized like soxr resampler)

The only real difference is in higher spectrum which is anyway not that relevant for ordinary listeners.
Please remove my account from this forum.

Re: Resampler plugin

Reply #602
Since lvqcl still hasn't released a 64-bit version I wanted to see if I can improve the quick conversion I did earlier.
Here's a new build that supports both 32-bit and 64-bit foobar2000 versions, dark mode is supported and now fast mode works also on 64-bit variant.

I also added options to resample only chosen samplerates or to resample everything else but the chosen samplerates, so it should allow doing everything mod and mod2 versions did in one file. I didn't see sources for lvqcl's mod variants so this is my custom implementation.

Registered just to give my thanks for this, really appreciate it :)

Re: Resampler plugin

Reply #603
Since lvqcl still hasn't released a 64-bit version I wanted to see if I can improve the quick conversion I did earlier.
Here's a new build that supports both 32-bit and 64-bit foobar2000 versions, dark mode is supported and now fast mode works also on 64-bit variant.

I also added options to resample only chosen samplerates or to resample everything else but the chosen samplerates, so it should allow doing everything mod and mod2 versions did in one file. I didn't see sources for lvqcl's mod variants so this is my custom implementation.

Thanks for your work, it helps me a lot. I have not found any other resampler in foobar2000 that gives me the option to choose the phase response like SOX does.

Re: Resampler plugin

Reply #604
Hi there,

I am using the SOX resampler mod, and I have a clarification question.

In the settings page, there is a selection "UP to 176k/192k".



If I were to configure as follows:
  • Target samplerate: UP to 176k/192k
  • Resample ONLY: 352800;384000;705600;768000

Will it do the following?
  • Do nothing to sample rates 0-192000
  • Downsample 352800;705600 to 176400
  • Downsample 384000;768000 to 192000

Appreciate any help or clarification with my question. Thank you in advance.

.

Re: Resampler plugin

Reply #605
Since option "Service priority" is useless since fb2k 1.4, it would be not bad to remove it from recompiled version.