| cannam@126 | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | 
| cannam@126 | 2 <HTML> | 
| cannam@126 | 3 | 
| cannam@126 | 4 <HEAD> | 
| cannam@126 | 5 	<TITLE> | 
| cannam@126 | 6 	Secret Rabbit Code (aka libsamplerate) | 
| cannam@126 | 7 	</TITLE> | 
| cannam@126 | 8 	<META NAME="Author"      CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)"> | 
| cannam@126 | 9     <META NAME="Version"     CONTENT="libsamplerate-0.1.8"> | 
| cannam@126 | 10 	<META NAME="Description" CONTENT="The Secret Rabbit Code Home Page"> | 
| cannam@126 | 11 	<META NAME="Keywords"    CONTENT="libsamplerate sound resample audio dsp Linux"> | 
| cannam@126 | 12 	<LINK REL=StyleSheet HREF="SRC.css" TYPE="text/css" MEDIA="all"> | 
| cannam@126 | 13 </HEAD> | 
| cannam@126 | 14 | 
| cannam@126 | 15 <BODY TEXT="#FFFFFF" BGCOLOR="#000000" LINK="#FB1465" VLINK="#FB1465" ALINK="#FB1465"> | 
| cannam@126 | 16 <!-- pepper --> | 
| cannam@126 | 17 <CENTER> | 
| cannam@126 | 18 	<IMG SRC="SRC.png" HEIGHT=100 WIDTH=760 ALT="SRC.png"> | 
| cannam@126 | 19 </CENTER> | 
| cannam@126 | 20 <!-- pepper --> | 
| cannam@126 | 21 <BR> | 
| cannam@126 | 22 <!-- pepper --> | 
| cannam@126 | 23 <TABLE ALIGN="center" WIDTH="98%"> | 
| cannam@126 | 24 <TR> | 
| cannam@126 | 25 <TD VALIGN="top"> | 
| cannam@126 | 26 <BR> | 
| cannam@126 | 27 <DIV CLASS="nav"> | 
| cannam@126 | 28 	<BR> | 
| cannam@126 | 29 	<A HREF="index.html">Home</A><BR> | 
| cannam@126 | 30 	<A HREF="license.html">License</A><BR> | 
| cannam@126 | 31 	<A HREF="history.html">History</A><BR> | 
| cannam@126 | 32 	<A HREF="download.html">Download</A><BR> | 
| cannam@126 | 33 	<A HREF="quality.html">Quality</A><BR> | 
| cannam@126 | 34 	<A HREF="api.html">API</A><BR> | 
| cannam@126 | 35 	<A HREF="bugs.html">Bug Reporting</A><BR> | 
| cannam@126 | 36 	<A HREF="win32.html">On Win32</A><BR> | 
| cannam@126 | 37 	<A HREF="faq.html">FAQ</A><BR> | 
| cannam@126 | 38 	<A HREF="lists.html">Mailing Lists</A><BR> | 
| cannam@126 | 39 	<A HREF="ChangeLog">ChangeLog</A><BR> | 
| cannam@126 | 40 <BR> | 
| cannam@126 | 41 <DIV CLASS="block"> | 
| cannam@126 | 42 Author :<BR>Erik de Castro Lopo | 
| cannam@126 | 43 <!-- pepper --> | 
| cannam@126 | 44 <BR><BR> | 
| cannam@126 | 45 <!-- pepper --> | 
| cannam@126 | 46 | 
| cannam@126 | 47 </DIV> | 
| cannam@126 | 48 	<IMG SRC= | 
| cannam@126 | 49 	"/cgi-bin/Count.cgi?ft=6|frgb=55;55;55|tr=0|md=6|dd=B|st=1|sh=1|df=src_qual.dat" | 
| cannam@126 | 50 	HEIGHT=30 WIDTH=100 ALT="counter.gif"> | 
| cannam@126 | 51 </DIV> | 
| cannam@126 | 52 | 
| cannam@126 | 53 </TD> | 
| cannam@126 | 54 <!-- pepper --> | 
| cannam@126 | 55 <!-- ######################################################################## --> | 
| cannam@126 | 56 <!-- pepper --> | 
| cannam@126 | 57 <TD VALIGN="top"> | 
| cannam@126 | 58 <DIV CLASS="block"> | 
| cannam@126 | 59 | 
| cannam@126 | 60 <H1><B>SRC Quality</B></H1> | 
| cannam@126 | 61 <CENTER><P> | 
| cannam@126 | 62 	<B>This document not yet complete.</B><BR> | 
| cannam@126 | 63 </P></CENTER> | 
| cannam@126 | 64 <P> | 
| cannam@126 | 65 	When measuring the performance of a Sample Rate Converter, there are three | 
| cannam@126 | 66 	factors to consider: | 
| cannam@126 | 67 </P> | 
| cannam@126 | 68 <UL> | 
| cannam@126 | 69 	<LI><B>Signal-to-Noise Ratio</B> - a measure of how much noise the sample | 
| cannam@126 | 70 			rate conversion process adds to the signal. | 
| cannam@126 | 71 			This is measured in decibels (dB) and the higher this value the | 
| cannam@126 | 72 			better. | 
| cannam@126 | 73 			For most sample rate converters, the SNR will vary depending on | 
| cannam@126 | 74 			the input signal and the ratio between input and output sample | 
| cannam@126 | 75 			rates. | 
| cannam@126 | 76 			The only valid comparison of SNR is between the worst case for | 
| cannam@126 | 77 			for each converter. | 
| cannam@126 | 78 	<LI><B>Bandwidth</B> - most sample rate converters attenuate high | 
| cannam@126 | 79 			frequencies as part of their operation. | 
| cannam@126 | 80 			Bandwidth can be measured by finding the frequency where the | 
| cannam@126 | 81 			attenuation is 3dB and expressing that as a percentage of the full | 
| cannam@126 | 82 			bandwidth at that sampling rate. | 
| cannam@126 | 83 	<LI><B>Speed</B> - the faster the better <B>:-)</B>. | 
| cannam@126 | 84 </UL> | 
| cannam@126 | 85 | 
| cannam@126 | 86 <P> | 
| cannam@126 | 87 	There are a number of sample rate converters available for downloading | 
| cannam@126 | 88 	but I will limit the comparison ot Secret Rabbit Code to the following: | 
| cannam@126 | 89 </P> | 
| cannam@126 | 90 <UL> | 
| cannam@126 | 91 	<LI><A HREF="http://www.mega-nerd.com/SRC/download.html">sndfile-resample</A> | 
| cannam@126 | 92 		which is a program (which uses libsamplerate) from the <B>examples/</B> | 
| cannam@126 | 93 		directory of the Secret Rabbit Code source code distribution. | 
| cannam@126 | 94 	<LI><A HREF="http://www-ccrma.stanford.edu/~jos/resample/Available_Software.html"> | 
| cannam@126 | 95 			Resample</A> | 
| cannam@126 | 96 		by Julius O Smiths which seems to have been the first high quality converter | 
| cannam@126 | 97 		available as source code. | 
| cannam@126 | 98 	<LI><A HREF="http://www.tsp.ece.mcgill.ca/MMSP/Documents/Software/AFsp/ResampAudio.html">ResampAudio</A> | 
| cannam@126 | 99 		which is part of | 
| cannam@126 | 100 		<A HREF="http://www.tsp.ece.mcgill.ca/MMSP/Documents/Software/AFsp/AFsp.html"> | 
| cannam@126 | 101 			Audio File Programs and Routines</A> | 
| cannam@126 | 102 		by Peter Kabal. | 
| cannam@126 | 103 	<LI><A HREF="http://home.sprynet.com/~cbagwell/sox.html">SoX</A> which is maintained | 
| cannam@126 | 104 		by Chris Bagwell. | 
| cannam@126 | 105 		SoX is also able to perform some low quality sample rate conversions but these | 
| cannam@126 | 106 		will not be investigated. | 
| cannam@126 | 107 	<LI><A HREF="http://shibatch.sourceforge.net/">Shibatch</A> which seems to be a | 
| cannam@126 | 108 		frequency domain sample rate converter. | 
| cannam@126 | 109 		Unfortunately, this converter does not handle arbitrary conversion ratios and | 
| cannam@126 | 110 		hence could not be properly compared to the other converters. | 
| cannam@126 | 111 	<LI><A HREF="http://sr-convert.sourceforge.net/">sr-convert</A> is another | 
| cannam@126 | 112 		converter which does not handle arbitrary conversion ratios. | 
| cannam@126 | 113 </UL> | 
| cannam@126 | 114 | 
| cannam@126 | 115 <P> | 
| cannam@126 | 116 It should be noted that the first three converters above are based on the algorithm | 
| cannam@126 | 117 by <A HREF="http://www-ccrma.stanford.edu/~jos/resample/"> Julius O. Smith</A> | 
| cannam@126 | 118 which emulates the conversion of the digital signal to an analogue one and then | 
| cannam@126 | 119 sampling the analogue signal at the new sample rate. | 
| cannam@126 | 120 </P> | 
| cannam@126 | 121 | 
| cannam@126 | 122 <!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--> | 
| cannam@126 | 123 | 
| cannam@126 | 124 <H3><B>Methodology</B></H3> | 
| cannam@126 | 125 <P> | 
| cannam@126 | 126 	Measuring the SNR of a converter is relatively straight forward. | 
| cannam@126 | 127 	Generate an input signal consisting of a windowed sine wave, sample rate | 
| cannam@126 | 128 	convert it and measure the signal-to-noise ratio of the output signal. | 
| cannam@126 | 129 	A typical length for the original file is 30000 samples. | 
| cannam@126 | 130 </P> | 
| cannam@126 | 131 <P> | 
| cannam@126 | 132 	The bandwidth of a sample rate converter is a little more difficult to measure. | 
| cannam@126 | 133 	Currently this is done by generating two short files containing a windowed | 
| cannam@126 | 134 	sine wave. | 
| cannam@126 | 135 	The frequencies of the sine waves are 0.35 and 0.495 of the sample rate. | 
| cannam@126 | 136 	These file are then upsampled by a factor of 2 using the converter under test. | 
| cannam@126 | 137 	If the attenutaion of the lower frquency is less than 3dB and higher frequency is | 
| cannam@126 | 138 	more than 3dB, it is then possible to iteratively increase the lower frequency | 
| cannam@126 | 139 	and decrease the upper frequency keeping the -3dB point bracketed. | 
| cannam@126 | 140 	When the distance between the upper and lower frequency is sufficiently small, | 
| cannam@126 | 141 	it is possible to obtain a very accurate estimate of the -3dB frequency. | 
| cannam@126 | 142 </P> | 
| cannam@126 | 143 <P> | 
| cannam@126 | 144 	The speed of a sample rate converter is easy to measure; simply perform a | 
| cannam@126 | 145 	conversion on a large file or a number of smaller files and time the conversion | 
| cannam@126 | 146 	process. | 
| cannam@126 | 147 </P> | 
| cannam@126 | 148 | 
| cannam@126 | 149 <P> | 
| cannam@126 | 150 	The above measurement techniques are built into a test program which is delivered | 
| cannam@126 | 151 	with the Secret Rabbit Code source code distibution. | 
| cannam@126 | 152 	This program is able to test the first four of the above converters. | 
| cannam@126 | 153 </P> | 
| cannam@126 | 154 <!--+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--> | 
| cannam@126 | 155 | 
| cannam@126 | 156 <H3><B>SoX</B></H3> | 
| cannam@126 | 157 <P> | 
| cannam@126 | 158 	SoX provides three methods of resampling; a linear interpolator, a polyphase | 
| cannam@126 | 159 	resampler and the Julius O. Smith simulated analogue filter method. | 
| cannam@126 | 160 </P> | 
| cannam@126 | 161 | 
| cannam@126 | 162 <H3><B>Shibatch</B></H3> | 
| cannam@126 | 163 <P> | 
| cannam@126 | 164 	Shibach | 
| cannam@126 | 165 </P> | 
| cannam@126 | 166 | 
| cannam@126 | 167 <P> | 
| cannam@126 | 168 	<B>More Coming Soon.</B> | 
| cannam@126 | 169 </P> | 
| cannam@126 | 170 | 
| cannam@126 | 171 <!-- <A HREF="mailto:aldel@mega-nerd.com">For the spam bots</A> --> | 
| cannam@126 | 172 | 
| cannam@126 | 173 </DIV> | 
| cannam@126 | 174 </TD></TR> | 
| cannam@126 | 175 </TABLE> | 
| cannam@126 | 176 | 
| cannam@126 | 177 </BODY> | 
| cannam@126 | 178 </HTML> | 
| cannam@126 | 179 |