shithub: libsamplerate

ref: 96fee0c594a56963b78cbd5be0b49d16e755762c
dir: /doc/quality.html/

View raw version
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>

<HEAD>
	<TITLE>
	Secret Rabbit Code (aka libsamplerate)
	</TITLE>
	<META NAME="Author"      CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
    <META NAME="Version"     CONTENT="libsamplerate-0.1.7">
	<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page">
	<META NAME="Keywords"    CONTENT="libsamplerate sound resample audio dsp Linux">
	<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all">
</HEAD>

<BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465">
<!-- pepper -->
<CENTER>
	<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png">
</CENTER>
<!-- pepper -->
<BR>
<!-- pepper -->
<TABLE ALIGN="center" WIDTH="98%">
<TR>
<TD VALIGN="top">
<BR>
<DIV CLASS="nav">
	<BR>
	<A HREF="index.html">Home</A><BR>
	<A HREF="license.html">License</A><BR>
	<A HREF="history.html">History</A><BR>
	<A HREF="download.html">Download</A><BR>
	<A HREF="quality.html">Quality</A><BR>
	<A HREF="api.html">API</A><BR>
	<A HREF="bugs.html">Bug Reporting</A><BR>
	<A HREF="win32.html">On Win32</A><BR>
	<A HREF="faq.html">FAQ</A><BR>
	<A HREF="lists.html">Mailing Lists</A><BR>
	<A HREF="ChangeLog">ChangeLog</A><BR>
<BR>
<DIV CLASS="block">
Author :<BR>Erik de Castro Lopo
<!-- pepper -->
<BR><BR>
<!-- pepper -->

</DIV>
	<IMG SRC=
	"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src_qual.dat" 
	HEIGHT=30 WIDTH=100 ALT="counter.gif">
</DIV>

</TD>
<!-- pepper -->
<!-- ######################################################################## -->
<!-- pepper -->
<TD VALIGN="top">
<DIV CLASS="block">

<H1><B>SRC Quality</B></H1>
<CENTER><P>
	<B>This document not yet complete.</B><BR>
</P></CENTER>
<P>
	When measuring the performance of a Sample Rate Converter, there are three 
	factors to consider:
</P>
<UL>
	<LI><B>Signal-to-Noise Ratio</B> - a measure of how much noise the sample 
			rate conversion process adds to the signal. 
			This is measured in decibels (dB) and the higher this value the 
			better.
			For most sample rate converters, the SNR will vary depending on
			the input signal and the ratio between input and output sample
			rates.
			The only valid comparison of SNR is between the worst case for
			for each converter.
	<LI><B>Bandwidth</B> - most sample rate converters attenuate high 
			frequencies as part of their operation. 
			Bandwidth can be measured by finding the frequency where the 
			attenuation is 3dB and expressing that as a percentage of the full 
			bandwidth at that sampling rate.
	<LI><B>Speed</B> - the faster the better <B>:-)</B>.
</UL>

<P>
	There are a number of sample rate converters available for downloading
	but I will limit the comparison ot Secret Rabbit Code to the following:
</P>
<UL>
	<LI><A HREF="http://www.mega-nerd.com/SRC/download.html">sndfile-resample</A>
		which is a program (which uses libsamplerate) from the <B>examples/</B> 
		directory of the Secret Rabbit Code source code distribution.
	<LI><A HREF="http://www-ccrma.stanford.edu/~jos/resample/Available_Software.html">
			Resample</A>
		by Julius O Smiths which seems to have been the first high quality converter 
		available as source code.
	<LI><A HREF="http://www.tsp.ece.mcgill.ca/MMSP/Documents/Software/AFsp/ResampAudio.html">ResampAudio</A> 
		which is part of 
		<A HREF="http://www.tsp.ece.mcgill.ca/MMSP/Documents/Software/AFsp/AFsp.html">
			Audio File Programs and Routines</A>
		by Peter Kabal.
	<LI><A HREF="http://home.sprynet.com/~cbagwell/sox.html">SoX</A> which is maintained
		by Chris Bagwell.
		SoX is also able to perform some low quality sample rate conversions but these
		will not be investigated.
	<LI><A HREF="http://shibatch.sourceforge.net/">Shibatch</A> which seems to be a
		frequency domain sample rate converter.
		Unfortunately, this converter does not handle arbitrary conversion ratios and
		hence could not be properly compared to the other converters.
	<LI><A HREF="http://sr-convert.sourceforge.net/">sr-convert</A> is another
		converter which does not handle arbitrary conversion ratios.
</UL>

<P>
It should be noted that the first three converters above are based on the algorithm
by <A HREF="http://www-ccrma.stanford.edu/~jos/resample/"> Julius O. Smith</A>
which emulates the conversion of the digital signal to an analogue one and then
sampling the analogue signal at the new sample rate.
</P>

<!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->

<H3><B>Methodology</B></H3>
<P>
	Measuring the SNR of a converter is relatively straight forward. 
	Generate an input signal consisting of a windowed sine wave, sample rate
	convert it and measure the signal-to-noise ratio of the output signal.
	A typical length for the original file is 30000 samples.
</P>
<P>
	The bandwidth of a sample rate converter is a little more difficult to measure.
	Currently this is done by generating two short files containing a windowed
	sine wave.
	The frequencies of the sine waves are 0.35 and 0.495 of the sample rate.
	These file are then upsampled by a factor of 2 using the converter under test.
	If the attenutaion of the lower frquency is less than 3dB and higher frequency is
	more than 3dB, it is then possible to iteratively increase the lower frequency
	and decrease the upper frequency keeping the -3dB point bracketed.
	When the distance between the upper and lower frequency is sufficiently small,
	it is possible to obtain a very accurate estimate of the -3dB frequency.
</P>
<P>
	The speed of a sample rate converter is easy to measure; simply perform a
	conversion on a large file or a number of smaller files and time the conversion 
	process.
</P>

<P>
	The above measurement techniques are built into a test program which is delivered
	with the Secret Rabbit Code source code distibution.
	This program is able to test the first four of the above converters.
</P>
<!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->

<H3><B>SoX</B></H3>
<P>
	SoX provides three methods of resampling; a linear interpolator, a polyphase
	resampler and the Julius O. Smith simulated analogue filter method. 
</P>

<H3><B>Shibatch</B></H3>
<P>
	Shibach 
</P>

<P>
	<B>More Coming Soon.</B> 
</P>

<!-- <A HREF="mailto:aldel@mega-nerd.com">For the spam bots</A> -->

</DIV>
</TD></TR>
</TABLE>

</BODY>
</HTML>