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

SRC Quality

Chris@41:

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

Chris@41:

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

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

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

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

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

Chris@41: Chris@41: Chris@41: Chris@41:

Methodology

Chris@41:

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

Chris@41:

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

Chris@41:

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

Chris@41: Chris@41:

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

Chris@41: Chris@41: Chris@41:

SoX

Chris@41:

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

Chris@41: Chris@41:

Shibatch

Chris@41:

Chris@41: Shibach Chris@41:

Chris@41: Chris@41:

Chris@41: More Coming Soon. Chris@41:

Chris@41: Chris@41: Chris@41: Chris@41:
Chris@41:
Chris@41: Chris@41: Chris@41: Chris@41: