?? tayloro.txt
字號(hào):
動(dòng)態(tài)優(yōu)化窗函數(shù)。
程序中,fit數(shù)組為綜合指標(biāo)。停止準(zhǔn)則是設(shè)定的疊帶次數(shù)。程序結(jié)束時(shí),如仍不滿足指標(biāo),則將最佳結(jié)果代替初始參數(shù),重新執(zhí)行程序。以下是程序清單:
function tayloro
% 優(yōu)化組合參數(shù) ,用動(dòng)態(tài)優(yōu)選法優(yōu)化
clear
disp('輸入?yún)?shù)');
B=input( '帶寬 (MHZ):');T=input('時(shí)寬(us):');fc=input('抽樣率(*B):');
delt=1/fc;N=T/delt;M=5;
for z=1:50 % 設(shè)定總的疊代次數(shù)為50
g1(z)=1+(rand(1)-1)/10;g2(z)=1+(rand(1)-1)/10;g3(z)=1+(rand(1)-1)/10;g4(z)=1+(rand(1)-1)/10;g5(z)=1+(rand(1)-1)/10;
a=[0.42825,0.0002,0.00427,-0.00193,0.00074];
a(1)=a(1)*g1(z);a(2)=a(2)*g2(z);a(3)=a(3)*g3(z);a(4)=a(4)*g4(z);a(5)=a(5)*g5(z); % 在窗函數(shù)附近選定一組初始值
N1=1;
%以下求頻率調(diào)制函數(shù)f(t)
f(1)=-B/2;t1(1)=0;ff=-B/2; t(1)=0;tt=0;
for i1=-N/2:(N/2-1)
m=i1+N/2+1;
t1(m+1)=t1(m)+delt;
while (t1(m+1)-tt)>=0.0001,
ff=ff+0.0001;
tt0=0;
for j1=1:5
tt0=tt0+a(j1)*T/(pi*j1)*sin(2*pi*j1*ff/B);
end
tt=T/2+ff*T/B+tt0;
end
f(m+1)=ff;
t(m+1)=tt;
end
t(N+1)=T;
f(N+1)=B/2;
plot(t,f)
%求頻率調(diào)制函數(shù)f(t)完畢,以下求I、W支路信號(hào)及脈壓輸出
w(1)=0;
for m=1:N
w(m+1)=w(m)+2*pi*f(m+1)*delt;
end
for m=1:N+1
F1(m)=cos(w(m));
F2(m)=sin(w(m));
F(m)=exp(j*w(m));
end
xout=abs(xcorr(F,'coeff'));%pulse compress output and unitary
peak0=max(xout);
%求脈壓輸出完畢,以下求峰值點(diǎn)及主副比
for n=1:2*N+1 %求峰值點(diǎn)
if peak0==xout(n)
peakpoint0=n;
else
end
end
n=peakpoint0;
while 20*log10(xout(n))+3>=0.00001
n=n+1;
end
peakwide3=2*(n-peakpoint0)*delt
x1=xout(n);
x2=xout(n+1);
while x1>=x2
n=n+1;
x1=xout(n);
x2=xout(n+1);
end
for i=n:2*N+1
x3(i-n+1)=xout(i);
end
peak1(z)=max(x3);
if peak1(z)<=0.015 & peakwide3<0.85
fit(z)=100/(100*peak1(z)+peakwide3);%fit為綜合指標(biāo)
else
fit(z)=0;
end
end
for i=1:50
if fit(i)==max(fit)
z=i %尋找最好的指標(biāo),確定最佳參數(shù)
else
end
end
c1=g1(z)
c2=g2(z)
c3=g3(z)
max(fit)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -