📄 noise_amp_e2.m
字号:
function [e]=noise_amp_e2(qf,qfnummt,qfdenmt,T,m,order,Na,y,mq)
% [e]=noise_amp_e(q,qnummt,qdenmt,order,Na,y)
% This function compute the filter time constant to satisfy noise amplification.
% where
% q = string variable represent controller q
% qnummt = a matrix representing part of the process numurator to be inverted.
% qdenmt = a mertix representing part of the process denominator to be inverted.
qfnum=mt2poly(qfnummt,y);
qden=mt2poly(qfdenmt,y);
l=length(qfnum);
n=length(qden);
while qden(n)==0
n=n-1;
end
qden=qden(1:n);
e=(qden(1)*qfnum(l)/qden(n)/qfnum(1)/Na)^(1/order); % Noise amplification of q only.
temp=e; % save the previous filtertime constant
[qd,qdnum,qdden] = qd_mat(T,mq,e,1,y);
qfden=conv(qden,qdnum);
n=length(qfden);
m=length(roots(T));
e=(qfden(1)*qfnum(l)/qfden(n)/qfnum(1)/Na)^(1/(order+m));
while abs(temp-e) > 1e-5
temp=e; % save the previous filtertime constant
[qd,qdnum,qdden] = qd_mat(T,mq,e,1,y);
qfden=conv(qden,qdnum);
n=length(qfden);
e=(qfden(1)*qfnum(l)/qfden(n)/qfnum(1)/Na)^(1/(order+m));
end
filter=[1];
for i=1:(order+m)
filter=conv(filter,[e 1]);
end
qfnum=conv(qfnum,filter);
qx=tf(qfden,qfnum);
[mp,w]=sigma(qx);
[max_mp,index]=max(mp);
if max_mp/mp(1) > 1.1*Na
temp='There is a high peak of the frequency response';
temp=strvcat(temp,['of the controller at the frequency of' num2str(w(index))]);
warndlg(temp);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -