|See Also||fn2clp , fn2cbp , fn2cbs|
usage: include function\fn2chp.oms
wc: Real or Double scalar, specifying the desired cutoff frequency in [radians/sec]
for the new highpass filter.
b_in: Column Vector, Input , specifying the numerator polynomial for the normalized filter.
a_in: Column Vector, Input , specifying the denominator polynomial for the normalized filter.
b: Column Vector, Output, returning the numerator polynomial for the highpass filter.
a: Column Vector, Output, returning the denominator polynomial for the highpass filter.
This function takes the numerator and denominator polynomials of a lowpass normalized continuous transfer function (Hin = b_in/a_in), converting and frequency translates them to the desired radian cutoff frequency [rad/sec] "wc" (Hout = b/a) of a new highpass filter. Sources of normalized filter transfer functions can be obtained from functions such as fn2chp , fn2cbp , fn2cbs , or, any similar user defined function.
The input and output polynomials are ascending polynomials in s = jw expressed as a column vector of length n as:
The output polynomials b and a must be declared before the function is called, though their types do not matter. They can be declared as type "b = novalue", "a = novalue", for instance.
b => b(1) + n(2) * s + .. + b(n) * s^(n-1); similarly for a.
A plot of the resulting filter appears as:
# Design CHEBYSHEV Type 1 lowpass prototype filter, fc = 1 [radian/sec]
Norder = 5; # Filter Order
Ap = 1d0; # Passband Ripple
b_in = novalue; # Declare numerator polynomial
a_in = novalue; # Declare denominator polynomial
fncheb1(Norder, Ap, b_in, a_in); # Make prototype filter
# Convert filter to a new highpass cutoff frequency
b = novalue; # Declare output numerator polynomial
a = novalue; # Declare output denominator polynomial
fc = 1000d0; # New lowpass cutoff frequency
wc = 2d0*PI*fc; # Equivalent radian frequency
fn2chp(wc, b_in, a_in, b, a); # Convert the filter
# Evaluate this filter around its cutoff.
fmin = 1d2; # Plotting Limits
fmax = 1d4;
ymax = 10d0;
ymin = -60d0;
N = 201; # Plotting information
n = seq(N)'-1d0;
f = logspace(log10(fmin),log10(fmax),N)';
H = gains(b,a,f);
HdB = db20(H);