Reply by July 2, 20052005-07-02
I'd say your talking about a FIR implemented using a circular buffer.
The code below is used on the TMS320C67x. As you can see your circular
buffer is x[], which is written to before the function is called. So if
your processing 128 samples each time, then your x[] array must be at
least 128 floats in length. Of course there is no point in using a
circular buffer unless your willing to make x[] larger than 128 in the
first place.

void DSPF_sp_fircirc (float x[], float h[], float r[], int
index, int csize,
int nh, int nr)
{
int i, j;
//Circular Buffer block size = ((2^(csize + 1)) / 4)
//floating point numbers
int mod = (1 << (csize - 1));
float r0;
for (i = 0; i < nr; i++)
{
r0 = 0;
for (j = 0; j < nh; j++)
{
//Operation "% mod" is equivalent to "& (mod -1)"
//r0 += x[(i + j + index) % mod] * h[j];
r0 += x[(i + j + index) & (mod - 1)] * h[j];
}
r[i] = r0;
}
}

Reply by Bhaskar Thiagarajan July 1, 20052005-07-01
"Andor" <an2or@mailcircuit.com> wrote in message
news:1120254293.295636.136640@g43g2000cwa.googlegroups.com...
> Bhaskar wrote: > > > I don't think there is such a thing as a 'circular' FIR filter. > > Circular convolution?
I'd say it's a stretch to call circular convolution as a circular FIR filter since circular convolution is typically implemented using a DFT. Cheers Bhaskar
Reply by Andor July 1, 20052005-07-01
Bhaskar wrote:

> I don't think there is such a thing as a 'circular' FIR filter.
Circular convolution?
Reply by Jerry Avins July 1, 20052005-07-01
bg_ie@yahoo.com wrote:
> If I have a 1024 tap filter and I wish to use a circular FIR filter to > process 256 samples for each call of the associated function, then what > is the minimum size that I need my circular buffer to be?
I can't figure out what you want to do. I don't know any circular filters; as far as I know, there are none. Transversal FIRs process one sample at a time. You can save up 256 samples, then process them in a loop, but it's hard to imagine why. Each time around the loop one you put one more stored put sample into the circular buffer, then run the MAC. I don't believe you want to do that, but hey, it's your program. The circular buffer for a transversal FIR filter needs one cell for each tap. Clearly, you need N cells to hold N samples. A 1024-tap filter needs to process 1024 samples before the transient is completely gone. The first 600 outputs or so will be utter garbage. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Bhaskar Thiagarajan July 1, 20052005-07-01
<bg_ie@yahoo.com> wrote in message
news:1120236882.734070.191360@g43g2000cwa.googlegroups.com...
> If I have a 1024 tap filter and I wish to use a circular FIR filter to > process 256 samples for each call of the associated function, then what > is the minimum size that I need my circular buffer to be?
I don't think there is such a thing as a 'circular' FIR filter. Your delay line (or circular buffer) has to be 1024 taps long. If you plan to process 256 samples at each time, then you need to make sure subsequent sets of 256 samples fill up the circular buffer correctly. Cheers Bhaskar
Reply by July 1, 20052005-07-01
If I have a 1024 tap filter and I wish to use a circular FIR filter to
process 256 samples for each call of the associated function, then what
is the minimum size that I need my circular buffer to be?