Log in

View Full Version : Avisynth sample rate conversion


Reel.Deel
7th July 2012, 04:33
Hello, in the Avisynth manual SSRC it's described as: "Performs a high-quality change of the audio sample rate. It uses SSRC by Naoki Shibata, which offers the best resample quality available".
I know there is no "best" but does the quality of SSRC still true to today's standards?
Also, in this SRC comparison (http://src.infinitewave.ca/) there is 2 variants of SSRC. SSRC and SSRC high precision, which one does Avisynth use?

Thanks in advance!

IanB
8th July 2012, 09:20
Originally when SSRC was added ResampleAudio() only processed 16bit samples. SSRC always processes in ieee 32bit floats. ResampleAudio has since been taught how to also process in floats, so the gap has closed.

SSRC() by default uses Naoki Shibata's "fast" algorithm which yield very excellent result under most normal circumstances. If required you may do SSRC(fast=False) which will use the "slow" algorithm. This is for when you are doing large samplerate down conversions (more than a factor 2). When converting between 32K, 44.1K and 48K there is almost no observable difference. The "slow" algorithm gives improved aliasing prevention at the cost of processing speed.

However SSRC can only convert between particular sample rates as defined by these expressions :-sfrq = samplerate of source clip
dfrq = samplerate of destination clip
frqgcd = gcd(sfrq,dfrq)
fs1 = dfrq * sfrq / frqgcd
Resampling is possible if: (fs1/dfrq == 1) or (fs1/dfrq % 2 == 0) or (fs1/dfrq % 3 == 0)
ResampleAudio() has no such restriction. It uses a a brute force 64 tap FIR filter approach with triangular interpolation. It is about the same speed as "fast" mode SSRC. SSRC uses a fast and clever factoring approach that achieves results similar to a 512 tap FIR filter in "fast" mode and a 4096 tap FIR filter in "slow" mode. For processing 16bit CD grade audio both filters in all modes well exceed the quality requirements of the 16bit data. In float mode a trained observer might be able to detect differences with a true 24bit audio stream.

cretindesalpes
8th July 2012, 10:12
I would recommend to forget SSRC() which has too many constraints to be used properly. ResampleAudio() is fast and gives nearly perfect results even for large resampling factors.

Reel.Deel
8th July 2012, 16:06
IanB:
Thank you very much for the in-depth explanation. Very helpful. :)

cretindesalpes:
Knowing that you have a SRC of your own and that you wrote a technical paper about SRC, your input is also highly regarded.
Thanks cretindesalpes, maybe one day we'll see your SRC used by Avisynth. ;)

---------------------------------------------------------------

Under the SRC comparisons FAQ (http://src.infinitewave.ca/faq.html) some test signals are available for download. I'm going to try to process them with Avisynth and submit the results of both SSRC() and ResampleAudio().
I'm curious to see whether SSRC fast/slow are more or less equivalent to SSRC/high precission. Then again eac3to's SSRC seems to be the better one.
I know the differences may not even be audible and if they are you need some good gear and a excellent set of trained ears. :)

pandy
9th July 2012, 16:28
Use SOX for resampling and forget about Avisynth on this area ;)