Csound Csound-dev Csound-tekno Search About

Re: Inter/Extrapolation

Date1999-05-15 21:06
FromTobias Kunze
SubjectRe: Inter/Extrapolation
> I dunno about this specifically, but one other "perfect
> interpolation" would be to compute the DFT/FFT of the

NO.  You'll get a perfect interpolation of a hypothetical 
periodic signal of which the FFT is the transform.  That
signal is *significantly* different from the one you are 
actually taking the transform of (which is why people have
thought so much about windowing).  It is NOT the original.

In short, 

   IDFT(DFT(x(·))) = x(·) 

if and only if x(·) is harmonic.(which it virtually never is).


> That's what I used (for non realtime uses) and worked perfectly.

You must either write the worst kind of new age music, have an 2-bit
system or should go see your ENT specialist...  :)


> This sinc method sounds interesting though, since it is
> supposed to be faster (o instead of o*log (FFT case)).

You can't compare it.  Sinc interpolation has to be performed
for every sample of the TARGET sample rate, and for a number
of samples to the left AND right, which linearly increases the
quality of your signal.  So, interpolating from 10 to 100 kHz 
costs 1000 times the cycles needed to interpolate from 10 down to 1.
Thus, time here is a linear combination of 3 variables (source 
rate, target rate and sinc width) as opposed to 2 vars in the FFT
case (sample rate and window width).  Big-O notation doesn't 
make sense here since you won't want to increase your width past
20 or so anyway.


> And moreover, doesn't ask you to compute the following
> samples either.

no. you need equal amount of samples on both sides.