To create a Butterworth High Pass Filter in Matlab, first we need to define the filter specifications, such as cutoff frequency and order. Then we can apply the butter
function to design the filter and obtain the filter coefficients. Finally, we can use the filter
function to apply the filter to our signal.
Here's the code to create a Butterworth High Pass Filter with a cutoff frequency of 100 Hz and a filter order of 4, assuming a sampling frequency of 1000 Hz:
main.m255 chars11 lines
In the butter
function, the second argument is the normalized cutoff frequency (between 0 and 1, where 1 corresponds to the Nyquist frequency), and the third argument specifies the filter type ('high'
for a high pass filter).
Note that the filter coefficients b
and a
represent the numerator and denominator coefficients of the transfer function for the filter. In the last line of the code, the filter
function applies these coefficients to our original signal to obtain the filtered signal.
gistlibby LogSnag