[pulseaudio-discuss] [PATCH 0/4] Add support for libsoxr resampler

Alexander E. Patrakov patrakov at gmail.com
Wed Nov 12 07:03:48 PST 2014


12.11.2014 14:26, Alexander E. Patrakov пишет:
> I will recheck the quality separately later today, in order to verify
> that it is still as good as in the previous tests. Please don't merge
> the patches until this is done.

Done. The -mq, -hq and -vhq variants of the resampler never produce 
audible distortions. The -lq variant sometimes does, by means of 
suppressing very high frequencies, but this is relevant to artificial 
tests only, and only if the listener knows that these frequencies are 
supposed to be there. Thus, quality is on par with speex-float-5, the 
CPU consumption is even better than with speex-float-1. Conclusion:

*** the patches are generally acceptable ***

However, because the low-quality and high-quality versions eat very 
similar amount of CPU time, I'd just expose a single (high or very high) 
quality setting.

All plots are available at: https://yadi.sk/d/GTQYG9qBcfbMe  (2.2 MB)

Read this in order to interpret them and to understand how they were 
made: 
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-September/021811.html 
. The room noise has not been taken into account for the plots, so these 
are worst-case plots.


I have not subjected the new resampler to extensive tests on a variety 
of music. However, here is what various resamplers think about two files 
that I did test them on:

Artist: Ryan Farish
Album: Bloom
Composition: Anthem of Hope  (i.e. track 2 out of 17)
FFT size used for the test: 4096
Length of the track: 4 minutes 14 seconds

speex-float-1: average distortion = -12.6 dB, maximum = -5.4 dB, at 0:05
speex-float-3: average distortion = -28.3 dB, maximum = -26.1 dB, at 0:10
speex-float-5: average distortion = -42.2 dB, maximum = -37.7 dB, at 0:10

soxr-lq: average distortion = -38.0 dB, maximum = -31.4 dB, at 2:06
soxr-mq: average distortion = -28.1 dB, maximum = -21.2 dB, at 1:45
soxr-hq: average distortion = -39.9 dB, maximum = -38.9 dB, at 3:54
soxr-vhq: average distortion = -40.4 dB, maximum = -39.2 dB, at 1:10

I.e., for music, soxr creates distortions ~40 dB below what a human can 
notice.


For speech, I have used a track from the first audio CD that comes with 
a "Teach Yourself Malay" book. The track (number 5) is for Unit 1, 
"Welcome to Singapore!", and is the second of the five tracks for the 
unit. The track is 1 minute and 12 seconds long.

speex-float-1: average distortion = -14.5 dB, maximum = -4.7 dB, at 0:58
speex-float-3: average distortion = -28.9 dB, maximum = -24.9 dB, at 0:58
speex-float-5: average distortion = -43.1 dB, maximum = -36.5 dB, at 0:58

soxr-lq: average distortion = -38.8 dB, maximum = -28.0 dB, at 0:30
soxr-mq: average distortion = -27.7 dB, maximum = -17.3 dB, at 0:55
soxr-hq: average distortion = -40.7 dB, maximum = -39.0 dB, at 1:06
soxr-vhq: average distortion = -41.2 dB, maximum = -39.0 dB, at 0:58

All of the above assumes that the full scale is 92 dB SPL, and that the 
room is absolutely quiet. So, even in these conditions, a human 
definitely cannot hear distortions created by any of the resamplers.

To test the resamplers according to the psychoacoustical model on the 
music of your choice, please follow this post: 
http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-October/021911.html

Or, if you just want to regenerate the distortion lines above, download 
this archive and convert resampler response files to wav:

https://yadi.sk/d/4DzqyERYcfeBm (113 MB)

The command line is:

flac -d sound-files2/*.flac

./music_distortions.py --report-only --resampler-response 
sound-files2/soxr-vhq.wav --rate-from 44100 --fftsize 4096 --skip 32768 
/path/to/your/music/file.mp3 2>/dev/null

-- 
Alexander E. Patrakov


More information about the pulseaudio-discuss mailing list