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

📄 pr3_35_ss_multipathdiversityprincipleillustration.m

📁 一些关于CDMA扩频通信的经典文章
💻 M
字号:
%Problem 3.35;
%Shows principle of multipath diversity;

clear all; close all;
t=[1:3000]/500; N=length(t); %time scale;
WD=[0,50]; %deviations of two bit pulses;
S=exp(i*pi*WD'*(t(1:500)-0.5).^2); %complex envelopes of two bit pulses with different frequency deviations;
Sbp=imag(S.*(ones(2,1)*exp(i*2*pi*25*t(1:500)))); %two bandpass bit pulses;
Dt=(-1).^unidrnd(2,1,6); %random data vector;
tau=[0.116,0.184]*500; %tau-profile, elements within [] are in terms of bit pulse duration;
for k=1:2 %the loop repeats the same for two bit pulses;
    Sbpke=[Sbp(k,:),zeros(1,N-500)]; %takes k-th bit pulse and extends it over all time range;
    YL=num2str(k); YL1=['bit pulse ',YL]; YL2=['BPSK sig ',YL]; YL3=['rec sig ',YL]; YL4=['MF sig ',YL];
    subplot(4,2,k); plot(t,Sbpke); ylim([-1.2 1.2]); xlim([0,3]); ylabel(YL1); grid; %plotting k-th bit pulse;
    SD=kron(Dt,Sbp(k,:)); %bit stream with data manipulation for k-th bit pulse;   
    subplot(4,2,k+2); plot(t,SD); ylim([-1.2 1.2]);  xlim([0,3]); ylabel(YL2); grid; %plotting bit stream;
    SR=SD+[zeros(1,tau(1)) SD(1:N-tau(1))]+[zeros(1,tau(2)) SD(1:N-tau(2))]; %superposition of three multipath signals;
    subplot(4,2,k+4); plot(t,SR); ylim([-5 5]); xlim([0,3]); ylabel(YL3); grid; %plotting resulting multipath signal;
    MF=filter(Sbp(k,500:-1:1),1,SR)/(norm(Sbp(k,:))^2); M=max(MF); %matched filtering;
    subplot(4,2,k+6); plot(t,MF); xlabel('t/T'); xlim([0.8,3.8]); ylim([-1.2,1.2]*M); ylabel(YL4); %plotting MF output;
end;

⌨️ 快捷键说明

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