Re: Optimizing a tapped delay (FIR) filter implementation
- From: "robert bristow-johnson" <rbj@xxxxxxxxxxxxxxxxxxxx>
- Date: 30 Jun 2006 07:33:27 -0700
Kumar Appaiah wrote:
... I have a an initial delay line....
(circular) buffer of 3520 samples, where I have 18 taps
at various positions with various gains. Right now, I am doing the
following in a loop:
Obviously, this makes the code spend a *lot* of time on the division
(modulo) operator. What is the correct and efficient way
bump the size of the circular array up to a power of 2 (in this case
4096) and then use the bit-wise & operator to mask (er_index+TAP_2)
with (ER_LENGTH-1). if your compiler is dumb and subtracts the 1 each
time rather than uses a constant value of (ER_LENGTH-1), then #define a
new symbol. the & operator is much faster than the % operator.
#define ER_LENGTH 4096 % must be power of 2
#define CIRC_INDEX(x) ( (x) & (ER_LENGTH-1) )
r b-j
.
- References:
- Optimizing a tapped delay (FIR) filter implementation
- From: Kumar Appaiah
- Optimizing a tapped delay (FIR) filter implementation
- Prev by Date: Re: Any resources on VLIW?
- Next by Date: CCS Download
- Previous by thread: Re: Optimizing a tapped delay (FIR) filter implementation
- Next by thread: CCTV signal detector
- Index(es):
Relevant Pages
|
|