Re: What are all the "really efficient" filter algoritms?
- From: Robert Adams <robert.adams@xxxxxxxxxx>
- Date: Tue, 3 Mar 2009 20:15:25 -0800 (PST)
On Mar 3, 1:35 pm, Martin Eisenberg <martin.eisenb...@xxxxxxx> wrote:
Tony wrote:
I've played with several "standard" generalized routines for up-
and down-sampling of audio, and now I want to get into the ones
that really are more efficient in hardware or software - haven't
decided yet - just know I want the most grunt for the least
power, and because I'll be introducing nonlinearities and don't
want artifacts.
Perhaps you've seen them before, but I've been satisfied with the
polyphase-IIR halfband filters athttp://www.musicdsp.org/archive.php?classid=3#39. That code provides
only single-rate processing, so you'll want to add rate-changing
operations that actually exploit the polyphase structure.
Here's how. Note that I'm writing this from the top of my head
because I use my own adaptation of Dave Malham's code. I list the
original single-rate processing first for comparison, then the
additions:
double CHalfBandFilter::process(const double input)
{
const double output=(filter_a->process(input)+oldout)*0.5;
oldout=filter_b->process(input);
return output;
}
double CHalfBandFilter::decimate(const double* input)
{
const double output = (filter_a->process(input[0]) + oldout)*0.5;
oldout = filter_b->process(input[1]);
return output;
}
void CHalfBandFilter::interpolate(const double input, double* output)
{
input *= 0.5;
output[0] = filter_a->process(input);
output[1] = filter_b->process(input);
}
Martin
--
Quidquid latine scriptum est, altum videtur.
You need to first choose whether or not linear phase is important to
you (or your customer). This should be simply a matter of science
(that is, what do controlled listening tests say?) but like many
topics in audio you will encounter those who adhere to one view or
another with a conviction approaching religious fervor. You need to
decide this first because the hardware implementations for IIR versus
FIR is very different.
You should be very skeptical of Matlab results that say, "filter A
needs 20 multipliers and 30 adders, whereas filter B needs 15
multipliers and 20 adders, therefore filter B will be cheaper to
implement". Anyone with any real experience in this area knows enough
to disregard such advice; the bag of tricks that can be brought to
bear is quite large.
Bob Adams
.
- Follow-Ups:
- Re: What are all the "really efficient" filter algoritms?
- From: Martin Eisenberg
- Re: What are all the "really efficient" filter algoritms?
- References:
- What are all the "really efficient" filter algoritms?
- From: Tony
- Re: What are all the "really efficient" filter algoritms?
- From: Martin Eisenberg
- What are all the "really efficient" filter algoritms?
- Prev by Date: Re: Wave propagation
- Next by Date: FFT symmetry
- Previous by thread: Re: What are all the "really efficient" filter algoritms?
- Next by thread: Re: What are all the "really efficient" filter algoritms?
- Index(es):
Relevant Pages
|