| Contents | Index |
[H,wout]
= freqresp(sys)
H = freqresp(sys,w)
H = freqresp(sys,w,units)
[H,wout,covH]
= freqresp(idsys,...)
[H,wout] = freqresp(sys) returns the frequency response of the dynamic system model sys at frequencies wout. The freqresp command automatically determines the frequencies based on the dynamics of sys.
H = freqresp(sys,w) returns the frequency response on the real frequency grid specified by the vector w.
H = freqresp(sys,w,units) explicitly specifies the frequency units of w with the string units.
[H,wout,covH] = freqresp(idsys,...) also returns the covariance covH of the frequency response of the identified model idsys.
In continuous time, the frequency response at a frequency ω is the transfer function value at s = jω. For state-space models, this value is given by
![]()
In discrete time, the frequency response is the transfer function
evaluated at points on the unit circle that correspond to the real
frequencies. freqresp maps the real frequencies w(1),..., w(N) to
points on the unit circle using the transformation
. Ts is
the sample time. The function returns the values of the transfer function
at the resulting z values. For models with unspecified
sample time, freqresp uses Ts =
1.
Compute the frequency response of the 2-input, 2-output system

sys11 = 0; sys22 = 1; sys12 = tf(1,[1 1]); sys21 = tf([1 -1],[1 2]); sys = [sys11,sys12;sys21,sys22]; [H,wout] = freqresp(sys);
H is a 2-by-2-by-45 array. Each entry H(:,:,k) in H is a 2-by-2 matrix giving the complex frequency response of all input-output pairs of sys at the corresponding frequency wout(k). The 45 frequencies in wout are automatically selected based on the dynamics of sys.
Compute the frequency response of the 2-input, 2-output system

on a logarithmically-spaced grid of 200 frequency points between 10 and 100 radians per second.
sys11 = 0; sys22 = 1; sys12 = tf(1,[1 1]); sys21 = tf([1 -1],[1 2]); sys = [sys11,sys12;sys21,sys22]; w = logspace(1,2,200); H = freqresp(sys,w);
H is a 2-by-2-by-200 array. Each entry H(:,:,k) in H is a 2-by-2 matrix giving the complex frequency response of all input-output pairs of sys at the corresponding frequency w(k).
Compute the frequency response and associated covariance for an identified model at its peak response frequency.
load iddata1 z1 model = procest(z1, 'P2UZ'); w = 4.26; [H,~,covH] = freqresp(model, w)
For transfer functions or zero-pole-gain models, freqresp evaluates the numerator(s) and denominator(s) at the specified frequency points. For continuous-time state-space models (A, B, C, D), the frequency response is
![]()
For efficiency, A is reduced to upper Hessenberg form and the linear equation (jω − A)X = B is solved at each frequency point, taking advantage of the Hessenberg structure. The reduction to Hessenberg form provides a good compromise between efficiency and reliability. See [1] for more details on this technique.
[1] Laub, A.J., "Efficient Multivariable Frequency Response Computations," IEEE Transactions on Automatic Control, AC-26 (1981), pp. 407-408.
Use evalfr to evaluate the frequency response at individual frequencies or small numbers of frequencies. freqresp is optimized for medium-to-large vectors of frequencies.
bode | evalfr | interp | ltiview | nichols | nyquist | sigma | spectrum

Learn more about resources for designing, testing, and implementing control systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |