Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me write a C code for FIR filter design

Status
Not open for further replies.

rashmi venugopal

Newbie level 4
Joined
Nov 16, 2010
Messages
6
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
india
Activity points
1,326
hai,, i am rashmi,, doing mtech,,
can u plz guide me to write c code for fir filter design ,,,
any 1 plz reply.......
where can i get gudance about c code to fir filter design:eek:ops8-O
 

Do you know how to design fir filters? So that you only need to learn to write the filters in c? Or do you need to learn filter design as well?
 
thanks for the reply sir,, ya i know to design the FIR filter,, but how to write c code to that design,, kindly can u send me u r personal mail id,,, so that i can get inputs from u
 

It is better to discuss here so that others can contribute or learn as well.

If you have a fir filter like this y(n) = 0.5x(n) + 0.5x(n-1)
it can be written in C like this:

Code:
//Example signal to be filtered
int x[] = {0, 10, 20, 30, 40, 50 ,60};

//Resulting signal
int y[7];

//Counter
int i;

for (i=0; i<7; i++)
{
  if (i>=1)
    y[i] = 0.5*x[i] + 0.5*x[i-1]; 
  else
    y[i] = 0.5*x[i]; 
}

//y[] now consists of the filtered signal
 
is it advisable to write filter programs in C or MATLAB ?
i have 2 implement a filter coefficients optimization algorithm.
is it better to write it in C or MATLAB? Later for giving inputs, wwhich is easier ?
 

is it advisable to write filter programs in C or MATLAB ?
i have 2 implement a filter coefficients optimization algorithm.
is it better to write it in C or MATLAB? Later for giving inputs, wwhich is easier ?

It depends, per example, if you have a DSP and you need to know whats going in with your filter, you can use Matlab to see whats happening, and then write the C code for your DSP. In your case, you are implementing an algorithm, i suggest to use Matlab first.
 
  • Like
Reactions: bmsec

    bmsec

    Points: 2
    Helpful Answer Positive Rating
Thank you very much. I've started coding the algorithm in MATLAB.
It depends, per example, if you have a DSP and you need to know whats going in with your filter, you can use Matlab to see whats happening, and then write the C code for your DSP. In your case, you are implementing an algorithm, i suggest to use Matlab first.
 

hi,,
i am deepthi..doing mtech
can any 1 guide me to write c code for fir filter.i am implementing it in msp430 processor.
 

thank you very much.i got the code. since am a beginner in this processor.i have seen that three pages of code . its written like for actual implementation the code should be split into several files. i am really confused where to split and what all things to be done after getting this code. how will i simulate this. i have heard that an IAR embedded workbench c/c++ compiler is used. if so,how it is used. i need the steps.kindly help me..please..
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top