Mu Analysis and Synthesis Toolbox    
frsp

Calculate the complex frequency response of a linear system

Syntax

Description
frsp calculates the complex frequency response of a given SYSTEM matrix (sys) for a vector of frequency points (omega). The output matrix out is a frequency dependent VARYING matrix containing the frequency response of the input system sys at the frequency values contained in the vector omega . For systems with multiple inputs and outputs, a multivariable frequency response is returned.

Input arguments

sys
SYSTEM matrix

response calculated at these frequencies. If another VARYING matrix is input here, then its independent variables are used
T
0 (default) indicates a continuous system. A nonzero value forces discrete system evaluation with sample time T (optional)
balflg
0 (default) balances the SYSTEM A matrix prior to evaluation. A nonzero value for balflg leaves the state-space data unchanged (optional)
:

Output arguments

out
VARYING frequency response matrix

The vector of frequency points is assumed to be real and can be generated from the MATLAB command logspace or linspace. Given a continuous system sys, of the form

and an input vector, omega , with N frequencies, [1, 2,. . .,N], frsp evaluates the following equation

C(jiI - A)-1B + D, i = 1,. . .,N

You can specify a discrete time evaluation by specifying an optional sampling time, T. For the discrete time case each matrix in the VARYING output is given by

Note that setting T = 0 implies that a continuous frequency response is to be performed and not to evaluate

Examples
The SYSTEM matrix sys is constructed to have two inputs and two outputs with poles at -2 and -10. A frequency vector omega is constructed with 30 points log spaced between .1 and 100 rad/s. The complex frequency response of sys is calculated and its values between 3.5 and 4.6 rad/s are displayed.

A frequency response is performed using frsp with the default variables set. A plot of the frequency response is shown with the four line types corresponding to the sysg(1,1), sysg(1,2), sysg(2,1), and the sysg(2,2) elements.

To demonstrate the calculation of a discrete frequency response, convert this system into a digital system via the bilinear transformation. The sample frequency is chosen as 100 radians/second.

For digital filter design, you can examine the transfer function from 0 to by specifying T = 1. A Chebyshev type II filter is designed and its magnitude is plotted to demonstrate this feature.

Algorithm
The algorithm to calculate the complex frequency response involves an matrix inverse problem, which is solved via a Hessenberg matrix. If balflg is set to 0, the frequency response balances the SYSTEM A matrix (using the MATLAB balance command) prior to calculation of the Hessenberg form.

Note:
Balancing the system may cause errors in the frequency response. If the output of frsp is questioned, compare the results with balancing and without balancing the SYSTEM prior to calculating the frequency response.

Reference
Laub, A.J., "Efficient Multivariable Frequency Response Computations," IEEE Transactions on Automatic Control, vol. AC-26, No. 2, pp. 407-408, April, 1981.

See Also
balance, hess, samhld, tustin, vplot



fitsys gap, nugap