?? fashe.asv
字號:
function THfasheji=fashe()
Pow = -30; % Average transmitted power (dBm)
fc = 50e9; % sampling frequency
numbits = 4; % number of bits generated by the source
Ts =5e-9;
Nh = 3; % cardinality of the Time Hopping code
Np = numbits; % periodicity of the Time Hopping code
Tc = 1e-9; % chip time [s]
Tm = 2e-9; % pulse duration [s]
B=4e9;
G = 1;
bits =bits(numbits);
THcode=TH(Nh,Np);
THseq=THseq(bits,fc,Tc,Ts,THcode);
power = (10^(Pow/10))/1000; % average transmitted power % (watt)
Ex = power * Ts;
w0=zeros(1,Ts*numbits*fc);
for i=1:numbits
if bits(i)==0
w1=waveformdown(fc,Tm,B)
w0((THcode(i)*Tc*fc+Ts*(i-1)*fc+1):(fc*Ts*(i-1)+THcode(i)*Tc*fc+fc*Tm))=w1(1:fc*Tm);% Energy Normalized pulse
else
w2=waveformup(fc,Tm,B);
w0((THcode(i)*Tc*fc+Ts*(i-1)*fc+1):(fc*Ts*(i-1)+THcode(i)*Tc*fc+fc*Tm))=w2(1:fc*Tm);
end % waveform
end
wtx = w0 .* sqrt(Ex); % pulse waveform
% ---------------------------
% ---------------------------
if G
F = figure(1);
set(F,'Position',[32 223 951 420]);
tmax = numbits*Ts;
time = linspace(0,tmax,length(wtx));
P = plot(time,wtx);
set(P,'LineWidth',[2]);
ylow=-1.5*abs(min(wtx));
yhigh=1.5*max(wtx);
axis([0 tmax ylow yhigh]);
AX=gca;
set(AX,'FontSize',12);
X=xlabel('Time [s]');
set(X,'FontSize',14);
Y=ylabel('Amplitude [V]');
set(Y,'FontSize',14);
for j = 1 : numbits
tj = (j-1)*Ts;
L1=line([tj tj],[ylow yhigh]);
set(L1,'Color',[0 0 0],'LineStyle', ...
'--','LineWidth',[2]);
end
end % end of graphical output
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -