next up previous contents
Next: Some filter concepts Up: Filtering Previous: Filtering   Contents

Quick start: how to filter in matlab

Filtering in matlab is a two step process. First, you have to design the filter that you want to use. Then, you use the filter on your data. Assuming your sampling frequency is in the variable Fs, and your desired cutoff frequency is Fc, then the most simple filter command would be these two lines:

[b,a] = butter(1, Fc/Fs);

filtered_data = filter(b,a,data);

The variables b and a represent the coefficients of the filter in transfer function format. You can basically ignore the actual values for now.

To perform highpass filtering, just design the filter this way:

[b,a] = butter(1, Fc/Fs, 'high');

and for bandpass filtering, specify a vector of upper and lower cutoff frequencies.

[b,a] = butter(1, [Fc1 Fc2] /Fs, );



" . $row['Name'] . " Posted on " . $row['DateTime']; echo "
"; echo $row['Comment']; echo "

"; } echo "
"; ?> Leave a comment on this page:

Name: (optional)
To prove you are not a robot, what is 2+3?

Creative Commons License
This work by Daniel Kiracofe (daniel dot kiracofe at gmail dot com) is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License./' $I