Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!uunet!zephyr.ens.tek.com!orca!ka7axd.WV.TEK.COM!mhorne
From: mhorne@ka7axd.WV.TEK.COM (Michael T. Horne)
Newsgroups: comp.dsp
Subject: Re: Adjust-Speed CD player?
Message-ID: <4726@orca.WV.TEK.COM>
Date: 27 Sep 89 21:44:20 GMT
References: <4320@internal.Apple.COM> <61860@tut.cis.ohio-state.edu> <4653@orca.WV.TEK.COM>
Sender: nobody@orca.WV.TEK.COM
Reply-To: mhorne@ka7axd.wv.tek.com
Organization: Horne's Happy Home of Heavy Hacking
Lines: 53

> In general, it is easy to convert between two sampling rates that are
> rational multiples of each other (hence, I chose 6/5 in my example).
> The first step is to interpolate the signal by the numerator ...
> 
> The next step is to filter out all (or most) spectral energy which
> would be "aliased" when throwing away the unneeded samples...
>
> Obviously, if you want to change the sampling rate by 7724/137, you have
> a problem.

The main merits of the system I discussed earlier is that you *can* interpolate
by any rational increment, subject to the accuracy of the word size you use
to represent the increment.  Resampling the input by a 7724/137 ~= 56.38X
sampling rate increase is easy.  You aren't limited to small, rational
increments
in sampling rate since you are are directly calculating the actual interpolated
sample values from the original samples.  By evaluating the sin(x)/x function
at the correct locations (which need not be rational integer locations) you
can interpolate *any* point between elements in the data set.  The only
hard part in using this type of interpolator is how you calculate the sinc
coefficients.  If you have a non-repetitive interpolation increment (i.e.
if you need to recalculate the sinc coefficients for each new interpolated
data point), the bottleneck in such a system resides in the sinc
calculation.  However, there are methods for minimizing this hit, mostly by
trading off accurracy for computation time since your original data set
accuracy is dependent upon how many bits of resolution you have, how much
noise is on the data, the length of the FIR filter you use to calculate the
interpolated value, etc.

This is very similar to how an analog reconstruction filter `interpolates' the
functional values between the known data points output by a DAC.  A
perfect (low pass) reconstruction filter has a sin(x)/x impluse response,
and its response is convolved with the known data points to generate all
`points' between them.  Less than perfect (read: real) reconstruction filters
usually have impulse responses that have the general shape of a sinc function
(though not exactly), but are usually sufficient for correctly reconstructing
the output waveforms.

I have implemented several interpolators using this scheme, and they work
very well and can be easily implemented on a DSP chip set.

By the way, for those of you interested in multirate DSP, I recommend obtaining
a copy of "Multirate Digital Signal Processing," by Crochiere and Rabiner
(Prentice Hall).  This text provides an excellent background on the topic that
Steve discussed in his earlier article.  Also, a chapter in "Advanced Topics
in Digital Signal Processing," by Lim and Oppenheim (also Prentice Hall)
provides a good introduction to the same topic.

> -- 
> swass@apple.com

Mike
mhorne@ka7axd.wv.tek.com