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

📄 pr2_58.m

📁 Spread Spectrum and CDMA Principles and Applications 书籍和代码
💻 M
字号:
%Problem 2.58
%ambiguity function of arbitrary plain pulse;

clear all; close all;
t=[0:0.01:1];  N=length(t); %time scale;
S=ones(1,N); S=S/max(S); %signal real envelope;
F=[0:0.1:4.9]; %frequency scale;
for k=1:length(F)
   f=F(k); SF(k,:)=S.*exp(-i*2*pi*t*f); AM(k,:)=xcorr(SF(k,:),S); %calculate correlation of two frequency-detuned by fixed F signal replicas;
end;
AM=abs(AM)/(S*S'); %
tau=[-1:0.01:1]; %delay axis;
subplot(221); mesh(tau,F,AM); xlabel('tau/T'); ylabel('FT'); zlabel('rho(tau,F)'); ylim([0 4.9]); %3D plotting ambiguity function;
CSt=[zeros(1,30) AM(1,:) zeros(1,30)]; t1=[-1.30:0.01:1.30]; %cros section along tau, tau nicer for plotting;
subplot(222); plot(t1,CSt); xlim([-1.3 1.3]); ylim([-0.2 1.2]); grid; xlabel('tau/T'); ylabel('rho(tau,0)');
CSf=[AM(50:-1:2,101);AM(1:50,101)]; F1=[-F(50:-1:2),F]; %cross-section along F, F nicer for plotting;
subplot(223); plot(F1,CSf'); ylim([-0.2 1.2]); grid; xlabel('FT'); ylabel('rho(0,F)'); %plotting frequency crossection;
AM1=[AM(50:-1:2,201:-1:1);AM]; %to come to closed chart necessary to build ambiguity diagram;
subplot(224); contourf(tau,F1,AM1,[0.5,0.5]); grid; xlabel('tau/T'); ylabel('FT'); %ambiguity diagram;

⌨️ 快捷键说明

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