Chris@0: Chris@0: Chris@0: Chris@0: Chris@0: Chris@0: Secret Rabbit Code (aka libsamplerate) Chris@0: Chris@0: Chris@0: Chris@0: Chris@0: Chris@0: Chris@0: Chris@0: Chris@0: Chris@0: Chris@0:
Chris@0: SRC.png Chris@0:
Chris@0: Chris@0:
Chris@0: Chris@0: Chris@0: Chris@0: Chris@0: Chris@0: Chris@0: Chris@0: Chris@0:
Chris@0:
Chris@0: Chris@0: Chris@0:
Chris@0:
Chris@0: Chris@0:

SRC Quality

Chris@0:

Chris@0: This document not yet complete.
Chris@0:

Chris@0:

Chris@0: When measuring the performance of a Sample Rate Converter, there are three Chris@0: factors to consider: Chris@0:

Chris@0:
    Chris@0:
  • Signal-to-Noise Ratio - a measure of how much noise the sample Chris@0: rate conversion process adds to the signal. Chris@0: This is measured in decibels (dB) and the higher this value the Chris@0: better. Chris@0: For most sample rate converters, the SNR will vary depending on Chris@0: the input signal and the ratio between input and output sample Chris@0: rates. Chris@0: The only valid comparison of SNR is between the worst case for Chris@0: for each converter. Chris@0:
  • Bandwidth - most sample rate converters attenuate high Chris@0: frequencies as part of their operation. Chris@0: Bandwidth can be measured by finding the frequency where the Chris@0: attenuation is 3dB and expressing that as a percentage of the full Chris@0: bandwidth at that sampling rate. Chris@0:
  • Speed - the faster the better :-). Chris@0:
Chris@0: Chris@0:

Chris@0: There are a number of sample rate converters available for downloading Chris@0: but I will limit the comparison ot Secret Rabbit Code to the following: Chris@0:

Chris@0:
    Chris@0:
  • sndfile-resample Chris@0: which is a program (which uses libsamplerate) from the examples/ Chris@0: directory of the Secret Rabbit Code source code distribution. Chris@0:
  • Chris@0: Resample Chris@0: by Julius O Smiths which seems to have been the first high quality converter Chris@0: available as source code. Chris@0:
  • ResampAudio Chris@0: which is part of Chris@0: Chris@0: Audio File Programs and Routines Chris@0: by Peter Kabal. Chris@0:
  • SoX which is maintained Chris@0: by Chris Bagwell. Chris@0: SoX is also able to perform some low quality sample rate conversions but these Chris@0: will not be investigated. Chris@0:
  • Shibatch which seems to be a Chris@0: frequency domain sample rate converter. Chris@0: Unfortunately, this converter does not handle arbitrary conversion ratios and Chris@0: hence could not be properly compared to the other converters. Chris@0:
  • sr-convert is another Chris@0: converter which does not handle arbitrary conversion ratios. Chris@0:
Chris@0: Chris@0:

Chris@0: It should be noted that the first three converters above are based on the algorithm Chris@0: by Julius O. Smith Chris@0: which emulates the conversion of the digital signal to an analogue one and then Chris@0: sampling the analogue signal at the new sample rate. Chris@0:

Chris@0: Chris@0: Chris@0: Chris@0:

Methodology

Chris@0:

Chris@0: Measuring the SNR of a converter is relatively straight forward. Chris@0: Generate an input signal consisting of a windowed sine wave, sample rate Chris@0: convert it and measure the signal-to-noise ratio of the output signal. Chris@0: A typical length for the original file is 30000 samples. Chris@0:

Chris@0:

Chris@0: The bandwidth of a sample rate converter is a little more difficult to measure. Chris@0: Currently this is done by generating two short files containing a windowed Chris@0: sine wave. Chris@0: The frequencies of the sine waves are 0.35 and 0.495 of the sample rate. Chris@0: These file are then upsampled by a factor of 2 using the converter under test. Chris@0: If the attenutaion of the lower frquency is less than 3dB and higher frequency is Chris@0: more than 3dB, it is then possible to iteratively increase the lower frequency Chris@0: and decrease the upper frequency keeping the -3dB point bracketed. Chris@0: When the distance between the upper and lower frequency is sufficiently small, Chris@0: it is possible to obtain a very accurate estimate of the -3dB frequency. Chris@0:

Chris@0:

Chris@0: The speed of a sample rate converter is easy to measure; simply perform a Chris@0: conversion on a large file or a number of smaller files and time the conversion Chris@0: process. Chris@0:

Chris@0: Chris@0:

Chris@0: The above measurement techniques are built into a test program which is delivered Chris@0: with the Secret Rabbit Code source code distibution. Chris@0: This program is able to test the first four of the above converters. Chris@0:

Chris@0: Chris@0: Chris@0:

SoX

Chris@0:

Chris@0: SoX provides three methods of resampling; a linear interpolator, a polyphase Chris@0: resampler and the Julius O. Smith simulated analogue filter method. Chris@0:

Chris@0: Chris@0:

Shibatch

Chris@0:

Chris@0: Shibach Chris@0:

Chris@0: Chris@0:

Chris@0: More Coming Soon. Chris@0:

Chris@0: Chris@0: Chris@0: Chris@0:
Chris@0:
Chris@0: Chris@0: Chris@0: Chris@0: