Ïðèëîæåíèå 3. Ïðîãðàììà ðàñ÷åòà îòíîøåíèÿ ñèãíàë/øóì.
% Estimation of the signal-to-noise ratio
clear all
% Modelling of sigma(omega)
t00=1.3;
ts=t00/150;
fmax=1/ts;
fchar=1/t00;
fcharmin=2.5*fchar;
fcharpl=2.6*fchar;
%alpfa=2*ts*fchar;
ffilin=[0 2*ts*fcharmin 2*ts*fcharmin 2*ts*fcharpl 2*ts*fcharpl 1];
m=[1 1 1.47 1.47 1 1];
%m=[1 1 1 1 1 1];
b=fir2(550,ffilin,m);
[h,freal]=freqz(b,1,512,fmax);
%freal=w./2./ts./pi;
%plot(freal, abs(h))
%figure
subplot(2,1,1);
plot(freal, abs(h).*abs(h))
zoom xon
grid on
xlabel('×àñòîòà, îòí.åä.');
ylabel('\sigma (f)');
title('à')
hnorm=abs(h)./max(abs(h));
% Signal
shirot=36;
dlitot=4;
mu=zeros(dlitot,shirot);
%mu1=zeros(dlitot,shirot);
norma=zeros(dlitot,shirot);
for kt=1:shirot
t0=2.0-(kt-1)./20;
fsig(kt)=1/t0;
omtr=2*pi/t0;
for kdlit=1:dlitot
dlitimp=kdlit*t0;
dlit=20*t0;
t=0:ts:dlit;
%y=gauspuls(t-2,1,1);
y=rectpuls(t-dlitimp/2-t0/2,dlitimp).*sin(omtr.*(t-t0/2-dlitimp/2));
%figure
%plot(t,y)
%zoom xon
yfft=abs(fft(y));
yfft2=yfft.*yfft;
yfft1=yfft/max(yfft);
df=1/dlit;
f=0:df:20/t0;
flenpl=length(f);
fmaxpl=max(f);
%figure
%plot(freal,hnorm,f,yfft1(1:flenpl))
%zoom xon
% Reflection of the signal from the target
%figure
%freqz(b,1)
sout=filter(b,1,y);
%sout=filtfilt(b,1,y);
%plot(t,sout)
%zoom xon
% Signal-to-noise ratio
sout1fft=abs(fft(sout));
sout1fft2=sout1fft.*sout1fft;
%mu(kdlit,kt)=0;
%mu1(kdlit,kt)=0;
for ks=1:flenpl;
if f(ks)>1/t0-1/dlitimp & f(ks)<1/t0+1/dlitimp
mu(kdlit,kt)=mu(kdlit,kt)+sout1fft2(ks).*df;
norma(kdlit,kt)=norma(kdlit,kt)+yfft2(ks).*df;
end
% if f(ks)>1/t0+1/dlitimp & f(ks)<1/t0+2/dlitimp
% mu1(kdlit,kt)=mu1(kdlit,kt)+sout1fft2(ks).*df;
% end
end
end
end
mu=mu./norma;
%[mumaxdlit,inddlit]=max(mu,[],1);
%[mumax,ind]=max(mumaxdlit);
%mumax=max(mumaxdlit);
%munorm=mu./mumax;
[mumindlit,indmdlit]=min(mu,[],1);
[mumin,indm]=min(mumindlit);
munorm=mu./mumin;
%mu1norm=mu1./mu1max;
%deltaf=fsig./fsig(ind)-1;
%figure
%plot(deltaf,munorm)
subplot(2,1,2);
plot(fsig,munorm)
grid on
xlabel('×àñòîòà ñèãíàëà, îòí.åä.');
ylabel('Âûèãðûø â îòíîøåíèè ñèãíàë/øóì');
title('á')
%figure
%plot(fsig,mu1norm)
zoom xon
Ïðåäûäóùèé ðàçäåë | Ñîäåðæàíèå |