|See Also||fn2clp , fn2cbp , fn2cbs|
wc: A two element Real or Double row vector specifying the lower and upper radian
cutoff frequencies [rad/sec] for the new bandpass filter, such that:
wc(1) is the lower frequency limit for bandpass filter, and
wc(2) is the upper frequency limit for bandpass 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 bandpass filter.
a: Column Vector, Output, returning the denominator polynomial for the bandpass filter.
This function takes the numerator and denominator polynomials of a lowpass normalized continuous transfer function (Hin = b_in/a_in), converts and frequency translates them to the desired lower and upper radian cutoff frequencies [rad/sec] given in the two element vector "wc" (Hout = b/a) of a new bandpass filter. Sources of normalized filter transfer functions can be obtained from functions such as fn2chp , fn2cbp , fn2cbs , or, any similar user defined function. The first element of "wc" is the lower cutoff frequency and the second element is the upper.
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 2 lowpass prototype filter, fc = 1 [radian/sec]
Norder = 5;
Ap = 3d0;
As = 45d0;
b_in = novalue;
a_in = novalue;
fncheb2(Norder, Ap, As, b_in, a_in);
# Convert filter to a new bandpass cutoff frequency
b = novalue; # Declare output numerator polynomial
a = novalue; # Declare output denominator polynomial
flow = 800d0; # New lower cutoff frequency
fhigh = 2000d0; # New upper cutoff frequency
wc = 2d0*PI*[flow,fhigh]; # Equivalent radian frequency
fn2cbp(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 = 501; # Plotting information
n = seq(N)'-1d0;
f = logspace(log10(fmin),log10(fmax),N)';
H = gains(b,a,f);
HdB = db20(H);