27 lines
1.1 KiB
Matlab
27 lines
1.1 KiB
Matlab
clear all;
|
|
close all;
|
|
clc;
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%% 频域数字正交相干检波 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
%%********** 线性调频信号波形 **********%%
|
|
T=10e-6; %信号时宽
|
|
B=30e6; %信号带宽
|
|
fs=4*B; %采样频率
|
|
f0=3/4*fs; %载频频率
|
|
N=fix(T*fs); %采样点数
|
|
|
|
t=(-N/2:N/2-1)/fs;
|
|
sr=cos(2*pi*f0*t+pi*(B/T).*t.^2);
|
|
figure;
|
|
subplot(2,1,1);plot(t*1e6,sr); title('线性调频信号波形'); xlabel('t/us'); ylabel('sr');
|
|
%%********** 线性调频信号的频谱 **********%%
|
|
L=2^nextpow2(N);
|
|
Sf1=fftshift(abs(fft(sr,L)));
|
|
f=linspace(-fs/2,fs/2,L);
|
|
subplot(2,1,2);plot(f*1e-6,Sf1); title('线性调频信号频谱'); xlabel('f/MHz'); ylabel('Sf1');
|
|
%%********** 1.频谱搬移 **********%%
|
|
Sf=fftshift(abs(fft(sr.*exp(-1j*2*pi*f0.*t),L)));
|
|
figure;plot(f*1e-6,Sf); title('频谱搬移后的信号'); xlabel('f/MHz'); ylabel('Sf');
|
|
%%********** 2.频率滤波+抽取 **********%%
|
|
Sf_ex=[Sf(1:L/4),Sf(3/4*L+1:end)];
|
|
figure;plot(f(1:2:end)*1e-6,fftshift(Sf_ex)); title('滤波抽取后的信号'); xlabel('f/MHz'); ylabel('Sf_ ex');
|