|See Also||fn2chp , fn2cbp , fn2cbs|
wc: Real or Double scalar, specifying the desired cutoff frequency in [radians/sec]
for the new lowpass 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 lowpass filter.
a: Column Vector, Output, returning the denominator polynomial for the lowpass filter.
This function takes the numerator and denominator polynomials of a lowpass normalized continuous transfer function (Hin = b_in/a_in) and frequency translates them to the desired radian cutoff frequency [rad/sec] "wc" (Hout = b/a) of a new lowpass 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 BUTTERWORTH lowpass prototype filter, fc = 1 [radian/sec]
Norder = 5; # Filter Order
b_in = novalue; # Declare numerator polynomial
a_in = novalue; # Declare denominator polynomial
fnbut(Norder,b_in,a_in); # Make prototype filter
# Convert filter to a new lowpass 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
fn2clp(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);