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.

[SOLVED] Problem in implementation of IIR Filter

Status
Not open for further replies.

mshrestha789

Junior Member level 1
Joined
Dec 29, 2010
Messages
17
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,283
Activity points
1,392
Hello friends,

I am facing problem in implementing IIR filter. I have determined the coefficient for the first order Butterworth filter using MATLAB FDATOOL with sampling frequency 2000 Hz and cutoff frequency 100 Hz and used it to filter the AC signal but it isn't working.

To implement this I took the adc sample in every 0.5ms and used following equation to get the filtered output.

y(n) = x(n) * a1 + x(n-1) * a2 + y(n-1) * b1;

Please help me regarding this. Any help will be appreciated.
 

Try the following:
In FDATool: File - Export - To Workspace. You'll get the SOS matrix and gain G.
Then [[b,a] = sos2tf(SOS,G);
Then output_data=filter(b,a,input_data);

And what does the "isn't working"mean?
 

As I stated before I am using MATLAB to get the filter coefficient only and using the same to filter the signal I am getting from AC line, which I am reading from ARM microcontroller, but instead of getting filtered signal, I am getting the signal with decreased amplitude. That's what "isn't working" means.
 

It seems the equation to be wrong
I dont know it exactly but try the following:
In FDATool: File - Export To Simulink Model. Before pressing the button "Realize Model" check the checkbox "Build model using basic elements".
You will see the diagram for your filter process and will be able to restore the right formula from this.

- - - Updated - - -

It seems the equation to be wrong
I dont know it exactly but try the following:
In FDATool: File - Export To Simulink Model. Before pressing the button "Realize Model" check the checkbox "Build model using basic elements".
You will see the diagram for your filter process and will be able to restore the right formula from this.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top