复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59function[wpos,ypos]=bd_asymp(G,w) G1=zpk(G); wpos=[]; pos1=[]; if nargin==1,w=freqint2(G); end zer=G1.z{1}; pol=G1.p{1}; gain=G1.k; for i=1:length(zer); if isreal(zer(i)) wpos=[wpos,abs(zer(i))]; pos1=[pos1,20]; else if imag(zer(i))>0 wpos=[wpos,abs(zer(i))]; pos1=[pos1,40]; end end end for i=1:length(pol); if isreal(pol(i)) wpos=[wpos,abs(pol(i))]; pos1=[pos1,-20]; else if imag(pol(i))>0 wpos=[wpos,abs(pol(i))]; pos1=[pos1,-40]; end end end wpos=[wpos w(1) w(length(w))]; pos1=[pos1,0,0]; [wpos,ii]=sort(wpos); pos1=pos1(ii); ii=find(abs(wpos)<eps); kslp=0; w_start=1000*eps; if length(ii)>0 kslp=sum(pos1(ii)); ii=(ii(length(ii))+1):length(wpos); wpos=wpos(ii); pos1=pos1(ii); end while 1 [ypos1,pp]=bode(G,w_start); if isinf(ypos1),w_start=w_start*10; else break; end end wpos=[w_start wpos]; ypos(1)=20*log10(ypos1); pos1=[kslp pos1]; for i=2:length(wpos) kslp=sum(pos1(1:i-1)); ypos(i)=ypos(i-1)+kslp*log10(wpos(i)/wpos(i-1)); end ii=find(wpos>=w(1)&wpos<=w(length(w))); wpos=wpos(ii); ypos=ypos(ii);
调用:
复制代码
1
2
3
4G1=tf(2,[conv([2,1],[8,1])]); w=10e-3:0.1:100; [x1,y1]=bd_asymp(G1,w); semilogx(x1,y1),grid;
最后
以上就是坦率鸭子最近收集整理的关于MATLAB对数幅频渐近特性曲线脚本bd_asymp.m的全部内容,更多相关MATLAB对数幅频渐近特性曲线脚本bd_asymp内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复