|
发表于 2013-6-7 23:01:56
|
显示全部楼层
for Ampl=0.1:0.05:Vref
Vzero=zeros(1,8);
t0=clock;
fd=1;
yy1=zeros(1,N);
open_system('ONE_PATH')
options=simset('InitialState', zeros(1,5), 'RelTol', 1e-3, 'MaxStep', 2*Ts);
sim('ONE_PATH', (N+Ntransient)/Fs, options);
%**************************************************************************************%
%**************Calculates SNR and PSD of the bit-stream and of the signal**************%
%**************************************************************************************%
yy1=Output(2+Ntransient:1+N+Ntransient)';
ptot=zeros(1,N);
[snr,ptot,psigdB,pnoisedB]=calcSNR(yy1(1:N),f,fBL,fBH,w,N);
Rbit=(snr-1.76)/6.02;
s1=sprintf(' SNR(dB)=%1.3f',snr);
s2=sprintf(' Simulation time =%1.3f min',etime(clock,t0)/60);
disp(s1)
disp(s2)
VrefOUT=[VrefOUT;Vref];
SNROUT=[SNROUT;snr];
AmplOUT=[AmplOUT;Ampl];
Vref
end
end
ALLOUT=[VrefOUT,AmplOUT,SNROUT];
csvwrite('outputdata',ALLOUT);
ALLOUT |
|