Bandwidth returns inf with discrete time transfer function

I am trying to find the 3dB frequency of discrete time transfer function using bandwidth but it returns inf. Here is the code:
alpha1=0.9;
ts = 0.1;
z = tf('z',ts);
H = ((1-alpha1)/2)*(1-z)/(1-alpha1*z);
fb = bandwidth(H,-3);
Am I doing anything conceptually wrong?

4 件のコメント

Mathieu NOE
Mathieu NOE 2021 年 9 月 30 日
Hi
read the doc
fb = bandwidth(sys) returns the bandwidth of the SISO dynamic system model sys. The bandwidth is the first frequency where the gain drops below 70.79% (-3 dB) of its DC value.
seems that this function cannot be used if you hae a high pass filter behaviour in your tf; because then the dc gain is 0 (-Inf in dB)
you have to write your own function for bandwith that overcomes this limitation
I recognize it's strange that this case is not dealed correctly in the native matlab function (shame on you TMW !)
all the best
Shivanshu Sahoo
Shivanshu Sahoo 2021 年 9 月 30 日
Yeah I also thought the same but thought there must be something which I must be missing, so asked to confirm. Thanks for confirming.
Mathieu NOE
Mathieu NOE 2021 年 9 月 30 日
see the results of low pass vs high filters
bandwith works ok only for the low pass case
% high pass digital filter
alpha1=0.9;
ts = 0.1;
z = tf('z',ts);
H = ((1-alpha1)/2)*(1-z)/(1-alpha1*z);
figure(1),bode(H)
fb = bandwidth(H,-3);
% low pass analog filter
sys = tf(1,[1 1]);
fb = bandwidth(sys)
figure(2),bode(sys)
% high pass analog filter
sys = tf([1 0],[1 1]);
fb = bandwidth(sys)
figure(3),bode(sys)
Shivanshu Sahoo
Shivanshu Sahoo 2021 年 9 月 30 日
Yes @Mathieu NOE you are correct. Bandwidth works only for low pass.

サインインしてコメントする。

 採用された回答

Star Strider
Star Strider 2021 年 9 月 30 日

1 投票

The -3 dB frequency is straightforward to calculate —
alpha1=0.9;
ts = 0.1;
z = tf('z',ts);
H = ((1-alpha1)/2)*(1-z)/(1-alpha1*z);
fb = bandwidth(H,-3)
fb = Inf
[mag,phase,wout] = bode(H);
mag = squeeze(mag);
wdB3 = interp1(mag2db(mag/max(mag)), wout, -3)
wdB3 = 1.0591
magdB3 = interp1(wout, mag2db(mag), wdB3)
magdB3 = -28.5751
phase = squeeze(phase);
figure
semilogx(wout, mag2db(mag))
hold on
plot(wdB3, magdB3, '+r', 'MarkerSize',10)
hold off
grid
xlim([min(wout) max(wout)])
.

4 件のコメント

Shivanshu Sahoo
Shivanshu Sahoo 2021 年 9 月 30 日
What does wdB3 represent in our code?
Star Strider
Star Strider 2021 年 9 月 30 日
It is the frequency corresponding to the -3 dB power.
.
Shivanshu Sahoo
Shivanshu Sahoo 2021 年 9 月 30 日
Ok thank you so much
Star Strider
Star Strider 2021 年 9 月 30 日
As always, my pleasure!
.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by