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

📄 mat_noise_tao.m

📁 实现匹配滤波仿真的两个程序
💻 M
字号:
%chapter 2(5) add noise and delay tao0
clear;
%%%%%%%%%%%%%%%%%%%%%%%%1
t=1:0.01:100
T=50;
s1=rectpuls(t,T);
%%%%%%%%%%%%%%%%%%%%%%%%2
f0=0.5;
w0=2*pi*f0;
s2=s1.*cos(w0*t);
%%%%%%%%%%%%%%%%%%%%%%%%3
k=1;
s3=s1.*cos(w0*t+0.5*k*t.^2);
%%%%%%%%%%%%%%%%%%%%%%%%4
N=100;
tao=T/N;
s4=0;
for index=1:N
    rect=rectpuls(index*tao,T);
    c=round(rand)*2-1;
    s4=s4+c*rect.*cos(w0*t);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

for s_num=1:4
figure(s_num)
switch s_num
    case 1
        signal=s1;
    case 2
        signal=s2;
    case 3
        signal=s3;
    case 4
        signal=s4;
end

tao0=1000;
signal_t=[zeros(1,tao0) signal];%delay tao0
[m,n]=size(signal_t);
noise = wgn(m,n,10); % white Gaussian noise
signal_noise=signal_t+noise;
%%%%%%%%%%%%%%%
subplot(221)
plot(signal_t)
xlabel('t');
ylabel('s(t-t0)')
title('signal with tao')
%%%%%%%%%%%%%%%
subplot(222)
plot(signal_noise)
xlabel('t');
ylabel('n(t)');
title('add Gaussian noise')
%%%%%%%%%%%%%%%%%%%%%%%%%%
f1=fft(signal_noise);
f2=fft(fliplr(signal_t));
sig_mat=ifft(f1.*f2);
subplot(223)
plot(fliplr(signal_t));
xlabel('t')
ylabel('h(t)');
title('matched filter')
%%%%%%%%%%%%%%%%%%%
output=ifft(f1.*f2);
subplot(224)
plot(output)
xlabel('t')
ylabel('y(t)')
title('output signal')
end

⌨️ 快捷键说明

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