필터 지우기
필터 지우기

why bandwidth returns an "inf"?

조회 수: 8 (최근 30일)
Antonio Del Vecchio
Antonio Del Vecchio 2021년 12월 15일
답변: Star Strider 2021년 12월 15일
I have this tf with the following bode plot
k = 1
z = [-1 4 0]
p = [-10+4*j -10-4*j -3 -3 -3]
sys = zpk(z,p,k);
display(sys);
figure(1);
bode(sys);
grid
Why, in this case, the bandwidth(sys) retruns an "Inf"?
And is it only a problem in matlab to calculate the bandwidth or a bandpass exist but I have to calculate in another way?
it is not clear to me looking the plot.
thanks in advance.

채택된 답변

Star Strider
Star Strider 2021년 12월 15일
It returns Inf because the bandwidth function requires a monotonically-decreasing signal, not one with a passband.
Try this —
k = 1
k = 1
z = [-1 4 0]
z = 1×3
-1 4 0
p = [-10+4*j -10-4*j -3 -3 -3]
p =
-10.0000 + 4.0000i -10.0000 - 4.0000i -3.0000 + 0.0000i -3.0000 + 0.0000i -3.0000 + 0.0000i
sys = zpk(z,p,k);
display(sys);
sys = s (s+1) (s-4) ------------------------- (s+3)^3 (s^2 + 20s + 116) Continuous-time zero/pole/gain model.
[mag,phs,wout] = bode(sys);
smag = squeeze(mag)
smag = 61×1
1.0e+00 * 0.0001 0.0001 0.0002 0.0002 0.0002 0.0003 0.0003 0.0004 0.0004 0.0005
sphs = squeeze(phs)
sphs = 61×1
267.5632 267.3283 266.8726 266.3356 265.7005 264.9465 264.0464 262.9653 261.6568 260.0597
dB3 = 10^(-3/20)
dB3 = 0.7079
[maxmag,idx] = max(smag)
maxmag = 0.0061
idx = 28
wascdB3 = interp1(smag(1:idx), wout(1:idx), dB3*maxmag)
wascdB3 = 2.4349
wdscdB3 = interp1(smag(idx:end), wout(idx:end), dB3*maxmag)
wdscdB3 = 11.1138
bndwdh = wdscdB3 - wascdB3
bndwdh = 8.6789
figure(1);
semilogx(wout, mag2db(smag))
hold on
plot([wascdB3, wdscdB3], [1 1]*mag2db(maxmag*dB3), '+-r')
hold off
grid
xlabel('Frequency (rad/s)')
ylabel('Magnitude(dB)')
text(mean([wascdB3, wdscdB3]), mag2db(maxmag*dB3), sprintf('\\uparrow\nBandwidth = %.2f',bndwdh), 'Horiz','center', 'Vert','top')
The red line is between the -3 dB points on the passband.
.

추가 답변 (1개)

Chunru
Chunru 2021년 12월 15일
편집: Chunru 2021년 12월 15일
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. The bandwidth is expressed in rad/TimeUnit, where TimeUnit is the TimeUnit property of sys.
So this bandwidth is applicable for a low pass filter only.
For your system, DC response is 0, so the bandwidth is Inf
  댓글 수: 2
Antonio Del Vecchio
Antonio Del Vecchio 2021년 12월 15일
Ok, and this is now clear to me. Thnaks a lot.
So, THIS command "bandwith" acts in this way and, then, cannot work in this case.
But, looking at the plot, do you agree that there is a "bandpass point"? If yes, do we have a command to find it or I have to do it "manually" (and in which way)?
Chunru
Chunru 2021년 12월 15일
You can write a code to do that:
  • Find the peak response
  • Find the first points to the left of peak that is 3dB lower
  • Find the first points to the right of peak that is 3dB lower
  • Then compute the bandwidth.
Note that this is not full-proof bandwidth for arbitrary response.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Scopes and Data Logging에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by