Page 1 of 1

Question about Filter

Posted: Fri Feb 15, 2008 6:15 pm
by micman2
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?

Re: Question about Filter

Posted: Mon Feb 18, 2008 11:21 pm
by LubinKerhuel
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 13120 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.

Re: Question about Filter

Posted: Wed Apr 23, 2008 12:26 pm
by chukhivuitinh
can simu kalman filter ????

Re: Question about Filter

Posted: Thu Apr 24, 2008 11:17 pm
by LubinKerhuel
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 !