Query about Butterworth filter
Show older comments
Hi.
I am relatively new to Matlab and I am not from Signal processing background, so pardon my ignorance. I have a fluid pressure data acquired at 10 Hz from the sensor, which I wish to filter using low-pass filter. I measured for 51s to acquire 510 samples of pressure data. I saw this code in the internet which I modified to suit my data:
pa=data(:,3); % extracting third column from the acquired data
t1=data(:,1); % time data from first column
t1=t1-min(t1); % resetting the start time to zero
cut_off_freq = 0.2; % normalised cut-off frequency
sampling_freq = 10; % acquisition rate of the measurement device
number_of_point = length(pa);
order = 2;
[butter_b, butter_a] = butter(order, cut_off_freq/(sampling_freq/2));
freqz(butter_b, butter_a, number_of_point, sampling_freq);
y=filter(butter_b,butter_a,pa);
My friend tells me that the sampling frequency is the sampling frequency of the filter and not the actual measurement. He suggests me to use any frequency above 20 Hz (Nyquist criteria). But I am of the opinion that it should be 10, and we should play around the normalised cutoff frequency instead to come up with a proper filter. Who is right in this case?
Should sampling_freq=10 or should it be >20?
Thanks.
2 Comments
Daniel Shub
on 17 Jun 2013
This doesn't appear to be a MATLAB question. The answer is your sampling frequency is 10 Hz, but you need to understand the theory behind the differences between the continuous time Fourier transform and the DTFT (and to some extent the DFT) tp understand why.
Jan
on 19 Jun 2013
Although the usage of normalized frequencies should be trivial, it took me some time to understand the underlying logic also. Therefore I've voted for this question.
Accepted Answer
More Answers (1)
Jan
on 17 Jun 2013
For data sampled at 1000 Hz, design a 9th-order highpass Butterworth filter
with cutoff frequency of 300 Hz, which corresponds to a normalized value of
0.6:
[z,p,k] = butter(9,300/500,'high');
...
So do not use the already normalized cut-off frequency in cut_off_freq/(sampling_freq/2), because this normalized it again.
Categories
Find more on Butterworth in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!