⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cp0202_transmitter_bpsk_ds.asv

📁 用MATLAB仿真DS-BPSK超宽带通信系统性能(DS-UWB发射信号)
💻 ASV
字号:
function [bits,DScode,Stx,ref]=cp0202_transmitter_BPSK_DS
Pow=-30;
fc=50e9;
numbits=1;
Ts=2e-9;
Ns=10;
Np=10;
Tm=0.5e-9;
tau=0.25e-9;
G=1;
bits=cp0201_bits(numbits);
repbits=cp0201_repcode(bits,Ns);
DScode=cp0202_DS(Np);
[DSseq,BPSKDSseq]=cp0202_DSseq_BPSKDSseq(repbits,fc,Ts,DScode);
power=(10^(Pow/10))/1000;
Ex=power*Ts;
w0=cp0201_waveform(fc,Tm,tau);
wtx=w0.*sqrt(Ex);
Sa=conv(BPSKDSseq,wtx);
Sb=conv(DSseq,wtx);
L=(floor(Ts*fc))*Ns*numbits;
Stx=Sa(1:L);
ref=Sb(1:L);
if G
F=figure(1);
set(F,'Position',[32 223 951 420]);
tmax=numbits*Ns*Ts;
time=linspace(0,tmax,length(Stx));
P=plot(time,Stx);
set(P,'LineWidth',[2]); 
ylow=-1.5*max(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)*Ns*Ts;
    L1=line([tj tj],[ylow yhigh]);
    set(L1,'Color',[0 0 0],'LineStyle','--','LineWidth',[2]);
for k=0:Ns-1
    if k>0
      tn=tj+k*Ts;
       L2=line([tn tn],[0.8*ylow 0.8*yhigh]);
       set(L2,'Color',[0.5 0.5 0.5],'LineStyle','-.','LineWidth',[1]);
   end
  end
end
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -