Clear Filters
Clear Filters

High pass butterworth filter

92 views (last 30 days)
LU
LU on 7 Apr 2011
Answered: Yepuni Giyai on 18 May 2022
Hello, I am trying to implement a Butterworth filter with the following specs:
  • high-pass
  • 6th order
  • 0.1 Hz 3dB cutoff frequency
  • sample interval of 50 Hz
I am trying to replicate results from another source which I do not have access to the source code, only the filter specs (original not implemented in matlab), but so far have not had any luck in getting my results to match that of the original source.
So far I have tried the following:
fc=0.1;% cut off frequency
w=2*pi*fc;% convert to radians per second
fn=25; %nyquivst frequency = sample frequency/2;
order = 6; 6th order filter, high pass
[b14 a14]=butter(order,(w/fn),'high');
xf14=filtfilt(b14,a14,data);
Basically, I am not sure how to proceed at this point. Perhaps someone can see where I am going wrong? My experience with filtering is pretty limited so any help would be appreciated.If it would be beneficial I can upload the data, or describe the data further.
Thank you for your time,
lu

Answers (3)

Rob Graessle
Rob Graessle on 7 Apr 2011
You are converting the cutoff frequency to radians while leaving the Nyquist rate in Hz.
Try this:
fc=0.1;% cut off frequency
fn=25; %nyquivst frequency = sample frequency/2;
order = 6; %6th order filter, high pass
[b14 a14]=butter(order,(fc/fn),'high');
fvtool(b14,a14);
Does the filter response look like what you are expecting?
  1 Comment
LU
LU on 8 Apr 2011
Thanks Rob,
After doing some more reading I see that I want an analog filter, where as the default is a digital filter. I will try using the analog option to see if this helps.
lu

Sign in to comment.


Prasanth Reddy
Prasanth Reddy on 14 Nov 2021
clc
clear all
fc=0.1;% cut off frequency
w=2*pi*fc;% convert to radians per second
fn=25; %nyquivst frequency = sample frequency/2;
order = 6; %6th order filter, high pass
[b14, a14]=butter(order,(w/fn),'high');
fvtool(b14,a14);

Yepuni Giyai
Yepuni Giyai on 18 May 2022
clc
clear all
fc=0.1;% cut off frequency
w=2*pi*fc;% convert to radians per second
fn=25; %nyquivst frequency = sample frequency/2;
order = 6; %6th order filter, high pass
[b14, a14]=butter(order,(w/fn),'high');
fvtool(b14,a14);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!