|
![](/i/fill.gif) |
>> OK, well suffice it to say that if you have an odd number of samples,
>> it's not possible to make half of them negative and half of them
>> positive. ;-)
>>
>> If you manually sum sinewaves, it does the right thing automatically.
>
> Ahh, makes sense.
Yeah.
I don't know if you know this already, but... the sinc function is the
impulse response of a perfect lowpass filter - which would be the ideal
kind of antialias filter.
If you take a digital signal and just throw away some of the samples to
change the pitch, you get aliasing. (High frequencies become distorted
into lower ones.)
Sure, you take the average of several points instead of just using one
of those points. This is equivilent to applying a moving-average filter
to the signal before downsampling it. If you look at the frequency
response for such a filter, you'll see it doesn't actually remove high
frequencies especially efficiently.
If, on the other hand, you apply a (windowed) sinc filter first, this
*will* remove high frequences more efficiently. Then when you
downsample, there won't be any high frequencies to alias.
Trouble is, a "perfect" lowpass filter requires an infinite kernel -
which isn't computable. (But note that if you're manipulating equations
rather than numerical samples, the magic of integral calculus means it
usually *can* be computed!) That's why it must be a "windowed" sinc.
sinc 0 = 1
sinc x = (sin x) / x
(This is actual, valid Haskell source code, BTW.)
Post a reply to this message
|
![](/i/fill.gif) |