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 496200 times) previous topic - next topic
Tropoje and 2 Guests 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.