Index-> contents reference index search Up-> SPT_HELP AnalogFilterFunctions fn2clp Prev Next SPT_HELP-> SPTFunctionsByCategory Mathematical Functions Data Manipulation Functions SignalGeneratorMain AnalogFilterFunctions FIR Filter Design Window Functions IIR Filter Design FourierFunctions Plotting Functions Histogram Functions AnalogFilterFunctions-> fnbut fncheb1 fncheb2 fnbes fn2clp fn2chp fn2cbp fn2cbs fnbpole fnc1pole polbes gains makealog fn2clp Headings-> Description Example

Converting From A Normalized To Continuous Lowpass Filter [O-Matrix function]
 Syntax fn2clp(wc, b_in, a_in, b, a) Include: O-Matrix function. No include required. See Also fn2chp , fn2cbp , fn2cbs

Arguments:
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.

Description

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:

b => b(1) + n(2) * s + .. + b(n) * s^(n-1); similarly for a.

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.

Example

# 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);

A plot of the resulting filter appears as: