Design Butterworth IIR filter with Matlab-like syntax.
import signals.filters.iir-1;
Butterworth digital filter design
filt=butter(4,0.3[0.3,0.7],"")
n
the order of filter
Wn
the relative corner frequnecy
return value
Transfer function object.
The function can be used in several ways:
butter(n,Wn) - design an n pole lowpass or bandpass Butterworth filter with corner frequency Wn (scalar or 2 element vector).
buffer(n,Wn,type) - design an n pole lowpass, highpass, bandpass or bandstop filter, with corner frequencies specified by Wn (scalar or 2 element vector).
butter(...,'s') - if 's' is added to the end of the function, analog filter will be designed.
The parameter Wn is the relative corner frequency of the filter for digital filters. For analog filters it is specified in radians per second.
The size of the Wn depends on the type of the filter:
lowpass, highpass - a scalar value representing the corner frequency of the filter.
bandpass, bandstop - a 2 element vector representing the corner frequencies: [Wn1 Wn2]. Wn1 < Wn2.
Relative frequency in case of digital filters is defined as $ 2\frac{f}{f_s} $, where f is the frequency of iterest. Thus 0 means 0Hz, 1 means the Niquist rate (fs/2).
Parameter type is a string value describing the filter type: