# Calculating system bandwidth using Function "bandwidth"

11 views (last 30 days)
Alireza Aghdaei on 2 Nov 2022
Commented: Steven Lord on 2 Nov 2022
Hi,
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)).
%
% 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.
%
% Copyright 2013 The MathWorks, Inc.
% Built-in function.
"
Thank you
.

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])
sys = 1 ----- s + 1 Continuous-time transfer function.
fb = bandwidth(sys)
fb = 0.9976
% Example 2
B = tril(magic(5))
B = 5×5
17 0 0 0 0 23 5 0 0 0 4 6 13 0 0 10 12 19 21 0 11 18 25 2 9
[lower, upper] = bandwidth(B)
lower = 4
upper = 0
Steven Lord on 2 Nov 2022
You can confirm this using the which function.
% Example 1
sys = tf(1, [1 1]);
which bandwidth(sys) % Control System Toolbox bandwidth
/MATLAB/toolbox/control/ctrlanalysis/@DynamicSystem/bandwidth.m % tf method
% Example 2
B = tril(magic(5));
which bandwidth(B) % MATLAB bandwidth
built-in (/MATLAB/toolbox/matlab/matfun/bandwidth)

### Categories

Find more on Dynamic System Models in Help Center and File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by