[music-dsp] oversampling
Nigel Redmon
earlevel at earlevel.com
Sun Feb 27 22:36:06 EST 2005
I think it's a good idea to fiddle with filters in a math program and
plot the output. I plot just about everything before I code. Just to
give you a quick idea, here's a plot of a 25-tap FIR halfband and a
4-coefficient halfband. Both hit about -90dB in the same place, but
look very different (I used a Kaiser window to set it to -90dB stopband
for the FIR, and had a two-path that hit about there too--no great
one-to-one comparison intended, just wanted to show you the basic
characteristics). The FIR in red, the two-path in blue. As you can see,
the two-path turns a pretty sharp corner and drops like a rock. While
it seems like a terrible mismatch, 25 coefficients versus 4, 12 of the
FIR taps are zero, so you get some small amount of setup + 13 cycles on
a 56k, whereas you have up to 17 memory states (type 1 allpasses) on
the two-path to juggle. If you're filtering zero-inserted (2x
upsampled) data, the FIR taps drop almost in half again, and adding two
more cycles buy you eight more effective taps, etc. You can get some
savings on the two-path in that case too, but you can see how a few
cycles goes a long ways for oversampling FIRs when implemented on
DSP-friendly processors. And for multistage conversion, it's pretty
easy to make favorable tradeoffs with FIRs (sharpness of the corner
isn't important in the early stages, for instance). (Don't read this to
say two-path filters suck--it's just that there is a tendency to look
at a graph like this and conclude that FIRs suck by comparison, so I'm
pointing out why they don't.)
http://www.earlevel.com/FIR2path.png
On Feb 27, 2005, at 3:30 PM, James Chandler Jr wrote:
> Thanks Eric
>
> Had been reading on sinc halfband filters, which are -6 db at the
> halfband Fc with symmetrical shape on both sides of Fc (when viewed on
> a linear freq-vs-amplitude plot). Just assumed that a polyphase IIR
> halfband filter would look the same, but obviously IIR filters don't
> often have such tidy shapes.
>
> JCJR
More information about the music-dsp
mailing list