cannam@126: cannam@126: cannam@126: cannam@126: cannam@126: cannam@126: Secret Rabbit Code (aka libsamplerate) cannam@126: cannam@126: cannam@126: cannam@126: cannam@126: cannam@126: cannam@126: cannam@126: cannam@126: cannam@126: cannam@126:
cannam@126: SRC.png cannam@126:
cannam@126: cannam@126:
cannam@126: cannam@126: cannam@126: cannam@126: cannam@126: cannam@126: cannam@126: cannam@126: cannam@126:
cannam@126:
cannam@126: cannam@126: cannam@126:
cannam@126:
cannam@126: cannam@126:

SRC Quality

cannam@126:

cannam@126: This document not yet complete.
cannam@126:

cannam@126:

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

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

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

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

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

cannam@126: cannam@126: cannam@126: cannam@126:

Methodology

cannam@126:

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

cannam@126:

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

cannam@126:

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

cannam@126: cannam@126:

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

cannam@126: cannam@126: cannam@126:

SoX

cannam@126:

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

cannam@126: cannam@126:

Shibatch

cannam@126:

cannam@126: Shibach cannam@126:

cannam@126: cannam@126:

cannam@126: More Coming Soon. cannam@126:

cannam@126: cannam@126: cannam@126: cannam@126:
cannam@126:
cannam@126: cannam@126: cannam@126: cannam@126: