資源簡介
雷達信號模擬。單頻信號,LFM,BPSK波,用matlab實現仿真并畫圖。
代碼片段和文件信息
%%
%無限脈沖寬度單頻余弦信號
clc;clear?all;
fs?=?10e6;
Tp?=?5e-3;
t?=?-Tp/2:1/fs:Tp/2?-?1/fs;
f0?=?4e3;
y?=?cos(?2?*?pi?*?f0?*?t);
figure?plot(ty);axis([t(1)?t(end)?-1.2?1.2]);
xlabel(‘時間/s‘);
ylabel(‘幅度‘);
title(‘無限脈沖寬度單頻余弦信號‘);
%%
%有限脈沖寬度單頻余弦信號
clc;clear?all;close?all;
Tp=100e-6;
fs=10e6;
t=-Tp/2:1/fs:Tp/2-1/fs;
Tr=1e-3;
tm=-Tp/2:1/fs:Tr-Tp/2-1/fs;
n=Tp*fs;
N=Tr*fs;
E=10;
x=zeros(1N);
f0=4e4;
x(1:n)=E*cos(2*pi*f0*t);
figureplot(tmx);
axis([tm(1)?tm(end)?-1.1*E?1.1*E])?????
xlabel(‘時間(秒)‘‘Fontsize‘12)
ylabel(‘幅度‘‘Fontsize‘12)
xf=fft(x);
Fs=-fs/2:fs/N:fs/2-fs/N;
figureplot(Fsfftshift(abs(xf)));
axis([-1e6?1e6?0?6000]);
xlabel(‘頻率(Hz)‘‘Fontsize‘12)
ylabel(‘幅度‘‘Fontsize‘12)
%%
%BPSK
clear?all;
g=[1?0?1?1?1?0?0?1];%基帶信號
f=100;??????????????%載波頻率
t=0:2*pi/99:2*pi;
cp=[];sp=[];
mod=[];mod1=[];bit=[];
for?n=1:length(g);
????if?g(n)==0;?
????????die=-ones(1100);???%Modulante
????????se=zeros(1100);????%
????else?g(n)==1;
????????die=ones(1100);????%Modulante
????????se=ones(1100);?????%
????end
????c=sin(f*t);
????cp=[cp?die];????
????mod=[mod?c];????
????bit=
評論
共有 條評論