|
FC2DIGX.OMS
Script File:
# Description:
# Converts a normalized Butterworth filter to a digital filter.
#
clear
#
# digital cutoff frequency
cutoff_d = 2
# digital sampling interval
dt = .2
# continuous cutoff frequency
cutoff_c = (2 / dt) * tan(cutoff_d * dt / 2)
# normalized filter
num_n = novalue
den_n = novalue
fnbut(6, num_n, den_n)
# convert to cutoff frequency
num_c = novalue
den_c = novalue
fn2clp(cutoff_c, num_n, den_n, num_c, den_c)
# convert to digital
num_d = novalue
den_d = novalue
fc2dig(dt, num_c, den_c, num_d, den_d)
#
# minimum y axis value
ymin = 1e-4
# maximum y axis value
ymax = 10.
# title for the plot
gtitle("Digital Butterworth Filter Response")
# plot the digital
fdplot(dt, ymin, ymax, cutoff_d, num_d, den_d)
# scale the horizontal axis
gxaxis("linear", 0., 10.)
Output:
|
|