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

📄 w_pulse_compress_lfm.m

📁 matlab仿真匹配滤波器程序
💻 M
字号:
close all;
clear all;
% ========== 线性调频信号数字化正交解调 ========================
    % ========= 产生线性调频信号 ===================
t=10e-6;                       % 信号的时间长度, 单位s
fs=30e6;                        % 采样频率,单位Hz
ts=1/fs;
fc=5e6;                         % 线性调频信号的起始频率
f0=7.5e6;                        % 本振信号的中心频率
B=5e6;                          % 调频带宽
ft=0:1/fs:t-1/fs;               % 时间序列步长
N=length(ft);
k=B/fs*2*pi/max(ft);          % modulate 函数产生
y=modulate(ft,fc,fs,'fm',k);

%k=B/t;                         % 直接公式产生
%y=cos(2*pi*(f0*ft+k*ft.^2/2));
y_fft_result=fft(y);
figure,subplot(2,1,1),plot(ft,y),xlabel('t(单位:秒)'),ylabel('y(单位:伏)'),title('线性调频信号y(t)');
subplot(2,1,2),plot((0:fs/N:fs/2-fs/N),10*log(abs(y_fft_result(1:N/2)))),xlabel('频率f(单位:Hz)'),title('线性调频信号y(t)的频谱');
    
    % ========= 正交解调 ============================
n=0:N-1;
local_oscillator_i=cos(n*f0/fs*2*pi);       % i 路本振
local_oscillator_q=sin(n*f0/fs*2*pi);       % q 路本振
fbb_i=local_oscillator_i.*y;                % i 路解调
fbb_q=local_oscillator_q.*y;                % q 路解调
window=chebwin(51,40);                      % 设计50阶cheby窗的滤波器
[b,a]=fir1(50,2*B/fs,window);

fbb_i=[fbb_i,zeros(1,25)];       
% fir 滤波器有25个采样周期延迟,为保证所有信息全部通过滤波器,故补充25个0
fbb_q=[fbb_q,zeros(1,25)];

fbb_i=filter(b,a,fbb_i);                    % 低通滤波
fbb_q=filter(b,a,fbb_q);

fbb_i=fbb_i(26:end);
fbb_q=fbb_q(26:end);

figure,subplot(2,1,1),plot(ft,fbb_i),xlabel('t(单位:秒)'),title('解调后的I路信号');
subplot(2,1,2),plot(ft,fbb_q),xlabel('t(单位:秒)'),title('解调后的Q路信号');

fbb=fbb_i+j*fbb_q;
fbb_fft_result=fft(fbb);
figure,plot((0:fs/N:fs/2-fs/N),10*log(abs(fbb_fft_result(1:N/2)))),xlabel('频率f(单位:Hz)'),title('解调后信号的频谱');


%%%%%%%%%%% =========== 产生理想线性调频脉冲压缩系数 ==========================

M=4096;
D=B*t;
match_filter=ts*fliplr(conj(fbb))*sqrt(D)*2/t;
%加窗处理
w=hamming(300);
w=w';
w_match_filter=match_filter.*w;
w_match_filter_fft=fft(w_match_filter,M);
%未加窗处理

match_filter_fft=fft(match_filter,M);

figure,subplot(2,1,1),plot(real(match_filter_fft)),title('脉冲压缩系数(实部)');
subplot(2,1,2),plot(imag(match_filter_fft)),title('脉冲压缩系数(虚部)');

figure,subplot(2,1,1);plot(10*log(abs(match_filter_fft)));subplot(2,1,2);plot(match_filter);


% ================== 产生理想回波信号 ========================

t1=100e-6;
% signal=[zeros(1,(t1-2*t)/ts),y,zeros(1,t/ts)];      % 在13.5km处产生一个点目标
% signal=[zeros(1,(t1-4*t)/ts),y,zeros(1,t/ts),y,zeros(1,t/ts)];      % 产生2个独立点目标
% signal=[zeros(1,(t1-3*t)/ts),y,y,zeros(1,t/ts)];      % 产生2个相邻点目标



signal1=[zeros(1,(t1-2*t)/ts),y,zeros(1,t/ts)];      % 产生2个重叠点目标
signal2=[zeros(1,(t1-2.2*t)/ts),y,zeros(1,1.2*t/ts)];      % 产生2个重叠点目标
signal=signal1+signal2;
n=1:1:length(signal);%4000;
figure,subplot(2,1,1),plot(n,signal1,n,signal2);
subplot(2,1,2),plot(signal),title('发射的LFM信号');

n=0:t1/ts-1;


local_oscillator_i=cos(n*f0/fs*2*pi);       % i 路本振
local_oscillator_q=sin(n*f0/fs*2*pi);       % q 路本振
fbb_i=local_oscillator_i.*signal;                % i 路解调
fbb_q=local_oscillator_q.*signal;                % q 路解调
window=chebwin(51,40);                      % 设计50阶cheby窗的滤波器
[b,a]=fir1(50,2*B/fs,window);

fbb_i=[fbb_i,zeros(1,25)];                  % fir 滤波器有25个采样周期延迟,为保证所有信息全部通过滤波器,故补充25个0
fbb_q=[fbb_q,zeros(1,25)];

fbb_i=filter(b,a,fbb_i);                    % 低通滤波
fbb_q=filter(b,a,fbb_q);

fbb_i=fbb_i(26:end);
fbb_q=fbb_q(26:end);

signal=fbb_i+j*fbb_q;

figure,subplot(2,1,1),plot(real(signal)),title('接收的LFM信号(实部)-I');
subplot(2,1,2),plot(imag(signal)),title('接收的LFM信号(虚部)-Q');

figure,plot(10*log(abs(signal))),title('接收信号幅度');

% ====================== 脉冲压缩处理 =====================

%没加窗处理
signal_fft=fft(signal,M);
pc_result_fft=signal_fft.*match_filter_fft;
pc_result=ifft(pc_result_fft,M);


%加窗处理
w_pc_result_fft=signal_fft.*w_match_filter_fft;
w_pc_result=ifft(w_pc_result_fft,M);



figure,subplot(2,1,1),plot(real(pc_result)),title('脉压后I路信号(实部)');
subplot(2,1,2),plot(imag(pc_result)),title('脉压后Q路信号(虚部)');
n=1:M;
figure,plot(n,10*log(abs(pc_result)),'r',n,10*log(abs(w_pc_result)),'b'),title('脉冲压缩后结果');

figure,plot(n,10*log(abs(w_pc_result)),'b'),title('脉冲压缩后结果');

⌨️ 快捷键说明

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