HydrogenAudio

Hydrogenaudio Forum => Scientific Discussion => Topic started by: punkrockdude on 2012-07-23 11:31:44

Title: FSRC resampler
Post by: punkrockdude on 2012-07-23 11:31:44
Anyone tried FSRC http://libfsrc.sourceforge.net/ (http://libfsrc.sourceforge.net/)? The tests shows good specs and I was surprised by its speed.

Quote
FSRC (Overlap-Save) - ~5.6s
FSRC (Polyphase) - ~16.1s
libsamplerate - ~103.9s

Any programmers who might be interested in making a Foobar2000 dsp of it if it's possible? I would like to try it out against SoX. Regards.
Title: FSRC resampler
Post by: Garf on 2012-07-23 11:44:02
Note that it's a GPL library which (IIRC) makes distributing a foobar2000 component based on it problematic.
Title: FSRC resampler
Post by: punkrockdude on 2012-07-23 12:20:11
That's a shame. Does GPL say that it is only allowed in open source programs or something? Regards.
Title: FSRC resampler
Post by: Garf on 2012-07-23 12:44:23
That's a shame. Does GPL say that it is only allowed in open source programs or something? Regards.


It says a lot but that's a reasonable simplified summary.
Title: FSRC resampler
Post by: bandpass on 2012-07-23 13:15:13
Anyone tried FSRC http://libfsrc.sourceforge.net/ (http://libfsrc.sourceforge.net/)? The tests shows good specs and I was surprised by its speed.

The numbers on the FSRC web-site look good because the author chose to compare it against libsamplerate, one of the slowest SRCs around (and in its slowest mode).  Also, it may not be that significant overall, but he's way-off with his ripple estimation of libsamplerate; it's much smaller than suggested there.

As for its claimed alpha status: when it works, the output looks good, but it does crash out on certain ratios, even some fairly simple ones.

The website mentions a future comparison against SoX, but that was several years ago; maybe he made the comparison then gave up when he saw the results.

FSRC is GPL as it relies on FFTW's (GPL) ability to perform FFTs on arbitrary sized blocks (not just powers of 2, for which there are many non-GPL FFT libs available).
Title: FSRC resampler
Post by: punkrockdude on 2012-07-23 16:41:07
Thanks for the great explanations guys. This migh be a side track but SRC is one of
Pulseaudio's resamplers right? Do you guys know if it is possible to use SoX's resample in Pulseaudio?
Title: FSRC resampler
Post by: bandpass on 2012-07-23 17:12:26
Yes, libsamplerate a.k.a. SRC is available for Pulse; easy integration as a lib is one of its big pluses. Though it probably ought to be, AFAIK SoX isn't available for pulse (neither its SRC nor the rest of libSoX has really been pushed much in the general purpose lib direction).
Title: FSRC resampler
Post by: bandpass on 2012-07-30 09:30:52
It comes with a standalone tool, so I did a quick comparison with some other well-known SRCs (sndfile-resample = 0.1.7-3ubuntu1; others converters compiled from latest source).

Execution time and comparative execution time percentage shown for a couple of common SRC ratios, and a couple of conversion qualities:

High-ish quality:

Code: [Select]
44100 ->  96000 sox rate                   6.21s 100.0%
44100 ->  96000 ssrc                      20.58s 331.4%      
44100 ->  96000 fsrctool -q mq20          27.74s 446.7%
44100 ->  96000 sndfile-resample -c 1     40.17s 646.9%

96000 ->  44100 sox rate                   5.28s 100.0%  
96000 ->  44100 ssrc                      19.98s 378.4%      
96000 ->  44100 fsrctool -q mq20          28.88s 547.0%
96000 ->  44100 sndfile-resample -c 1     34.54s 654.2%

(http://i49.tinypic.com/20j2xix.gif)


Best-ish quality:
     
Code: [Select]
44100 ->  96000 sox rate -vs               7.01s 100.0%
44100 ->  96000 ssrc_hp                   32.86s 468.8%
44100 ->  96000 fsrctool -q hq24          24.19s 345.1%
44100 ->  96000 sndfile-resample -c 0    369.50s 5271.0%

96000 ->  44100 sox rate -vs               5.91s 100.0%
96000 ->  44100 ssrc_hp                   32.31s 546.7%
96000 ->  44100 fsrctool -q hq24          22.58s 382.1%
96000 ->  44100 sndfile-resample -c 0    359.16s 6077.2%

(http://i48.tinypic.com/25ivymd.gif)
Title: FSRC resampler
Post by: punkrockdude on 2012-07-30 11:20:47
Thank you bandpass for those informative demonstrations. I guess compared to the others, this resamplers is not quite as high quality.
Title: FSRC resampler
Post by: Arnold B. Krueger on 2012-07-30 11:43:23
Anyone tried FSRC http://libfsrc.sourceforge.net/ (http://libfsrc.sourceforge.net/)? The tests shows good specs and I was surprised by its speed.

Quote
FSRC (Overlap-Save) - ~5.6s
FSRC (Polyphase) - ~16.1s
libsamplerate - ~103.9s

Any programmers who might be interested in making a Foobar2000 dsp of it if it's possible? I would like to try it out against SoX. Regards.



How does it compare if you run the same tests that they run at:

Infinite Wave Test ReSamplers (http://src.infinitewave.ca/)
Title: FSRC resampler
Post by: bandpass on 2012-07-30 12:54:16
How does it compare if you run the same tests that they run at:

Infinite Wave Test ReSamplers (http://src.infinitewave.ca/)

AFAIK, one of the two tests I ran above (96k -> 44100) is the same as is run at the Infinite Wave site (they test only one ratio, and in only one direction).  I ran each test twice, once on an 8-second sweep (as they do, though I chose a linear sweep; they use a quadratic) to generate the spectrograms, and once on several minutes of audio, for the execution-time measurement.

Where possible, I used the same settings as Infinite Wave for each converter; but I don't know what settings were used there for libfsrc, apparently something with better stop-band rejection than "-q hq24", but I couldn't get anything higher than that (such as "-q push") to work.