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

SRC Quality

cannam@85:

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

cannam@85:

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

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

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

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

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

cannam@85: cannam@85: cannam@85: cannam@85:

Methodology

cannam@85:

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

cannam@85:

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

cannam@85:

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

cannam@85: cannam@85:

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

cannam@85: cannam@85: cannam@85:

SoX

cannam@85:

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

cannam@85: cannam@85:

Shibatch

cannam@85:

cannam@85: Shibach cannam@85:

cannam@85: cannam@85:

cannam@85: More Coming Soon. cannam@85:

cannam@85: cannam@85: cannam@85: cannam@85:
cannam@85:
cannam@85: cannam@85: cannam@85: cannam@85: