Sign in

username:

password:



Not a member?

Search c54x



Search tips

Subscribe to c54x



c54x by Keywords

5409 | 5416 | AD5 | ADC | BIOS | Boot | Booting | Bootloader | C540 | C5402 | C5409 | C5416 | CCS | Codec | DMA | Dmad | DSK | DSKPlus | Dsplib | EVM | FFT | FIR | Flash | GPIO | HPI | Initialization | Interrupt | JTAG | LOG_printf | MCBSP | RFFT | RTDX | Sampling | STLM | UART | VC540

Ads

Discussion Groups

Discussion Groups | TMS320C54x | FIR Filter Implementation

Technical discussions about the TI C54x DSPs (including the c5401, c5402, c5402a, c5404, c5407, c5409, c5409a, c5410, c5410a, c5416, c5420, c5421, c5441, c549, c5470 and c5471).

  

Post a new Thread

FIR Filter Implementation - dspswansea - Feb 25 10:31:00 2002



Hi Everyone,

I am having some major problems trying to implement FIR filters on
the TMS320C5402 as part of my University Porject. This is compounded
by the fact that I am new to DSP. I am trying to implement two
filters a Low-Pass (Interpolating) Filter and a Combfilter. Using
Matlab I have found the filter coefficients that I require. I
thought a good place to start was to use the "FIRTEST" examples that
come with CCS, these are located in: ti\examples\dsk5402
\xdias\firtest. In these examples i tried to change the Filter
coeffiecint in the example and see what happens ( the input is an
impulse), but the output is a string of ZEROS. Even in the TEXAS
example i get a String of Zeros! (when the impulse responce would be
1,2,3,4,4,3,2,1) The only time i can get output other than ZERO is
when a coeffiecient is negative, and then its only ever -1. Also it
appear that the output array is reversed (but I think that can
rectifed simply enough). It took me a while to actually get the
ouput to be displayed, but it via "DSP/BIOS ---> Message Log"

I am a bit stuck now. Is there a problem with the Filtering Algorith
with CCS? Has anyone else experienced this/Or is it me doing
something daft (quite likely!). I would really appreciate any
pointers or advice from anyone out there no matter how small.
Thanks for you time
MARK





(You need to be a member of c54x -- send a blank email to c54x-subscribe@yahoogroups.com )

Re: FIR Filter Implementation - Author Unknown - Feb 25 14:41:00 2002



Hi,

You'll do well to leave those examples alone. A good way to start is writing the
code yourself (I hope you are familiar with fundamentals of fixed point
arithmetic). A simple FIR Filter code is :

/* Update the filter buffer */
for (j = LENGTH; j > 0; j--)
filter_buffer[j] = filter_buffer[j-1];
filter_buffer[0] = input_sample;

/* Convolve the filter_buffer with filter_coeff */
output = 0;
for (j = 0; j < LENGTH; j++)
output += filter_buffer[j] * filter_coeff[j];

NOTE: The update filter buffer can be done very efficiently if you keep a head
and tail pointers for circular buffer.

The above code will work well in case of floating point numbers. You'll need to
do somethings with fixed-point numbers though. I also hope you are trying to
write a C Code first.

Hope it helps,
Sachin "dspswansea" <> on 02/25/2002 04:01:39 PM

To:
cc: (bcc: Sachin Gupta/HSS)

Subject: [c54x] FIR Filter Implementation

Hi Everyone,

I am having some major problems trying to implement FIR filters on
the TMS320C5402 as part of my University Porject. This is compounded
by the fact that I am new to DSP. I am trying to implement two
filters a Low-Pass (Interpolating) Filter and a Combfilter. Using
Matlab I have found the filter coefficients that I require. I
thought a good place to start was to use the "FIRTEST" examples that
come with CCS, these are located in: ti\examples\dsk5402
\xdias\firtest. In these examples i tried to change the Filter
coeffiecint in the example and see what happens ( the input is an
impulse), but the output is a string of ZEROS. Even in the TEXAS
example i get a String of Zeros! (when the impulse responce would be
1,2,3,4,4,3,2,1) The only time i can get output other than ZERO is
when a coeffiecient is negative, and then its only ever -1. Also it
appear that the output array is reversed (but I think that can
rectifed simply enough). It took me a while to actually get the
ouput to be displayed, but it via "DSP/BIOS ---> Message Log"

I am a bit stuck now. Is there a problem with the Filtering Algorith
with CCS? Has anyone else experienced this/Or is it me doing
something daft (quite likely!). I would really appreciate any
pointers or advice from anyone out there no matter how small.
Thanks for you time
MARK
_____________________________________




(You need to be a member of c54x -- send a blank email to c54x-subscribe@yahoogroups.com )