| Prev | Next | fn2dhp |
| Syntax |
fn2dhp(wc, dt, b_in, a_in, bz, az) |
| Include: |
include spt\fn2dhp.oms |
| See Also | fn2dlp , fn2dbp , fn2dbs , fc2dig |
wc: Real or Double scalar specifying desired radian cutoff frequency for the new digital highpass filter.
dt: Real or Double scalar, sampling interval, in [seconds]
b_in: Real or Double column vector, input numerator polynomial of the normalized continuous highpass
prototype filter.
a_in: Real or Double column vector, input denominator polynomial of the normalized continuous highpass
prototype filter.
bz: Real or Double column vector, output numerator polynomial for the digital highpass filter.
az: Real or Double column vector, output denominator polynomial for the digital highpass filter.
Description
This function converts an input continuous domain rational transfer function (H = b_in/a_in) to its corresponding
z-domain digital transfer function. The function is intended to be used with normalized, s-domain, lowpass
filter functions as can be obtained from functions such as: fnbut
, fncheb1
, fncheb2
, fnbes
.
The sampling interval for the new filter is "dt", making the system sampling rate fs = 1/dt. Generally, the new
desired cutoff frequency is in [radians/sec], wc = 2*PI*fc, and should be strictly less than half of the sampling rate.
The complex gain for this resulting filter can be evaluated with the gainz
function.
The output z-domain polynomial "bz" and "az" must be declared before calling the function, though their types do not matter.
Example
# Design BUTTERWORTH lowpass prototype filter, fc = 1 [radian/sec]
Norder = 5; # Filter Order
b = novalue; # Declare numerator polynomial
a = novalue; # Declare denominator polynomial
fnbes(Norder,b,a); # Make analog prototype lowpass filter
# Convert filter to a digital filter
bz = novalue; # Declare output numerator polynomial
az = novalue; # Declare output denominator polynomial
fs = 100e3; # Sampling Frequency [Samples/sec] = [Hz]
dt = 1d0/fs; # Sampling interval [Sec]
fc = 1d3; # New highpass cutoff frequency
wc = 2d0*PI*fc; # Equivalent radian frequency
fn2dhp(wc, dt, b, a, bz, az); # Convert the filter
# Evaluate this filter around its cutoff.
fmin = 1d1; # Plotting Limits
fmax = fs;
ymax = 10d0;
ymin = -100d0;
ny = round((ymax-ymin)/10d0);
N = 201; # Plotting information
n = seq(N)'-1d0;
f = logspace(log10(fmin),log10(fs/2),N)';
H = gainz(bz,az,f,fs);
HdB = db20(H);