Calculating system bandwidth using Function "bandwidth"
11 views (last 30 days)
I need to calculate the bandwidth of a SISO system. For that there is a function bandwidth(sys,drop) in control toolbox. But MATLAB has also another built-in function with the same name which returns the lower and upper bandwidth of a matrix.
How can I specifically use the function from control toolbox?
Does MATLAB automatically distinguish between these two functions based on my inputs?
The descriptions of these two are as following:
%BANDWIDTH Computes the frequency response bandwidth.
% FB = BANDWIDTH(SYS) returns the bandwidth FB of the SISO dynamic
% system SYS, defined as the first frequency where the gain drops below
% 70.79 percent (-3 dB) of its DC value. The frequency FB is expressed
% in rad/TimeUnit (relative to the time units specified in SYS.TimeUnit,
% the default being seconds). For FRD models, BANDWIDTH uses the first
% frequency point to approximate the DC gain.
% FB = BANDWIDTH(SYS,DBDROP) further specifies the critical gain drop
% in dB. The default value is -3 dB or a 70.79 percent drop.
% If SYS is an array of dynamic systems, BANDWIDTH returns an array FB
% of the same size where FB(k) = BANDWIDTH(SYS(:,:,k)).
% See also DCGAIN, ISSISO, DYNAMICSYSTEM.
% Copyright 1986-2011 The MathWorks, Inc.
%BANDWIDTH returns the lower and upper bandwidth of a matrix.
% [LOWER,UPPER] = BANDWIDTH(X) returns the lower bandwidth LOWER, and the upper
% bandwidth UPPER of matrix X.
% LOWER = BANDWIDTH(X,'lower') returns the lower bandwidth LOWER of matrix X.
% UPPER = BANDWIDTH(X,'upper') returns the upper bandwidth UPPER of matrix X.
% See also ISBANDED, ISDIAG, ISTRIL, ISTRIU.
% Copyright 2013 The MathWorks, Inc.
% Built-in function.
Sam Chak on 2 Nov 2022
The function can distinguish from the input type. One requires a Dynamic System Model, the other requires a Matrix.
% Example 1
sys = tf(1, [1 1])
fb = bandwidth(sys)
% Example 2
B = tril(magic(5))
[lower, upper] = bandwidth(B)