On Dec 27, 2010, at 2:05 AM, Nigel Redmon wrote:
Hi Robert,
hi Nigel,
No need for me to address point by point, because I agree with
everything you say, except for one major point (which affects a few
things you said)...
You seem to imply that a windowed-sinc created for 2x oversampling
is necessarily a half-band (or happens to be a half-band, if you
want to put it that way). Why?
because the math says so. you should suspect the case that for either
half-band or for windowed-sinc (where it's sinc(n/2)), that every even
sample of h[n] is zero (except for h[0]).
since multiplication in the time domain is equivalent to convolution
in the frequency domain, you can think of your practical half-band LPF
as an ideal brick-wall half-band:
H(f) = rect(2*f) (assuming Fs = 1/T = 1)
convolved with the even-symmetry W(f) which is the Fourier Transform
of the window function, w[n]. the half-band symmetry is preserved
when it's convolved with an even-symmetry W(f).
likewise in the time domain, the discrete-time impulse response of
that ideal brick-wall LPF is
h[n] = sinc(n/2)
every other sample (where n is even) of h[n] is zero except for the
sample at h[0]. now when you multiply with the window function w[n]
(which results in the convolving of W(f) with H(f)), it is *still* the
case that h[2m]=0 except for m=0.
A half-band FIR, one that has a zero every other coefficient, is
only down 6 dB at half the Nyquist frequency.
sure, that's necessary for the half-band symmetry. both facts are
also true for *any* windowed sinc that is
h[n] = sinc(n/2) * w[n]
that filter has zero for every other coefficient (except h[0]) and the
frequency response will have half-band symmetry:
H(1/4 + f) = 1 - H(1/4 - f)
which means that
H(1/4) = 1/2
or -6.02 dB.
so you design *any* half-band LPF your heart desires, and i will take
the impulse response h[n], divide by sinc(n/2) and for all odd values
of n will show you what the implied window w[n] is. for the even n,
there is a 0/0 division. if it were continuous, we could apply limits
to see what the ratio would be, but in the discrete-time case, we just
have to guess (via interpolation) whay w[n] might be for even n.
Ideally, you would want everything from 0.50 to 1.00 to be "clear"
to a reasonable degree. It's not. It's down 6 dB at .50, and hits
the -90dB stop-band at about 0.70. (You can get a closer look at it
on the follow webpage, with settings of 0.50 factor, 31 length, and
90 rejection: http://www.earlevel.com/main/2010/12/05/building-a-windowed-sinc-filter
) To put it another way, half-band filters alias in the transition
band. More typically, you'd move Fc down a bit (which means you are
filtering the original points, which means you can't just copy them).
if you move Fc down a little bit (from Nyquist/2), it's no longer half-
band and the sinc() function is not exactly sinc(n/2) so then for
*every* n, the sinc() is non-zerp.
As far as 4x, and my comment that you may want to do 2x *2x instead:
the reason is that you can't (general case) use a quarter-band
filter for 4x, so you don't get to skip every fourth multiply,
sure you can. if you *choose* to, you can design
h[n] = sinc(n/4) * w[n]
for some w[n], which is a quarter-band filter. it may not be the best
design, but for 4x it might not be so bad (it was about a wash in my
example). also, the effective impulse response that you get by
cascading 2x with 2x (assuming both 2x upsamplers were half-band) will
satisfy that sinc(n/4) equation above because we know that every 4th
output sample will take on exactly the value of the corresponding
input sample. the interpolated signal will pass through the original
input sample points. that means it *must* be a windowed-sinc with
sinc(n/4) and it must have quarter wave symmetry (there is the issue
of circular aliasing that corrupts the perfect symmetry which is
obscured in the half-band case).
but with 2x * 2x, you can use a half-band on the first, skipping
every other multiply,
no, you skip the computation for every other *sample* (by just copying
over the input sample) UNLESS you just changed the topic from
upsampling (and interpolation) to the filtering that we do before
decimation when we downsample. is that what has happened? did you
just change the topic?
then a non-half-band on the second; the second stage is designed to
no alias in the transition band--it also cleans up the aliasing left
by the first stage. Couple this with the fact that the filter for 4x
has to be twice the length one at 2x for equivalent characteristics,
and that's where you get the savings in multirate conversion.
i know about multirate processing, but i am having trouble deciding
about whether you're referring to upsampling (which is where the
interpolation is happening) or downsampling (where, if you're
downsampling by 2x and using a half-band LPF, every other *tap* in the
FIR is zero).
And of course it doesn't have to be windowed sinc (especially for
the non-half-band)--you may well want an equiripple design instead,
but I view this as a separate issue. My only issue with what you're
saying pertains to half-band sinc FIRs. Again, half-band filters are
great in multirate (where the aliasing transition band can get clear
in a later stage), or when you have prior knowledge that there is
nothing in the transition band to alias (or even that you expect the
aliasing would go unnoticed) but in the general case, you aren't
going to use a half-band for a high-fidelity rate conversion.
On Dec 27, 2010, at 3:50 AM, Nigel Redmon wrote:
BTW, there's a way to get nearly half the coefficients to be zero
for equiripple half-band designs as well, but I'm trying not to
stray too far from my point.
sure, you have to stick to the half-band symmetry. turns out that
those "equal" ripples look a lot worse in the stopband than they do in
the passband.
and you can take that design, divide the impulse response with a
sinc(n/2) function and what will come out is the implied window. so
it's also a windowed sinc. *every* half-band LPF design is equivalent
to a windowed-sinc (but you might not know what the window is, except
in retrospect).
--
r b-j r...@audioimagination.com
"Imagination is more important than knowledge."
--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp