Question about Filter

micman2
Posts: 20
Joined: Wed Feb 13, 2008 9:24 am

Question about Filter

Postby micman2 » Fri Feb 15, 2008 6:15 pm

I saw two examples that implement filters, I noticed the speed with which you can implement filters in a dspic.
But I have a question:

How has been calculated Band pass filter?
Attachments
MWSnap.gif

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Marseille - France
Contact:

Re: Question about Filter

Postby LubinKerhuel » Mon Feb 18, 2008 11:21 pm

Low pass filter with a cut off frequency at 1 Hz :
1Hz means 2*pi rad/s which is approximatively 6 rad/s.

matlab code :

Code: Select all

>> Filter_1Hz = tf([6],[1 6])
 
Transfer function:
  6
-----
s + 6
 
>> bode(Filter_1Hz)
>>

You will get :
Filter_1Hz.png
Filter_1Hz.png (4.32 KiB) Viewed 2607 times


We have a 45° phase and a -3db cut off at 6 rad/s which is approximatively 1Hz.
6 should be replace by 2*pi so as to get a precise 1Hz low pass filter.

If you are note familiar with theses math, have a look on the Laplace transform.

The filter is then discretized for a sampling rate of 200Hz using the c2d function with the tustin method.

chukhivuitinh
Posts: 2
Joined: Wed Apr 23, 2008 12:08 pm

Re: Question about Filter

Postby chukhivuitinh » Wed Apr 23, 2008 12:26 pm

can simu kalman filter ????

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Marseille - France
Contact:

Re: Question about Filter

Postby LubinKerhuel » Thu Apr 24, 2008 11:17 pm

I will have a look on kalman filter to estimate the gyro bias. But I could not give a date when I will do it.

You could do it anyway !


Return to “Advanced Simulink & RTW Questions”

Who is online

Users browsing this forum: No registered users and 1 guest