📄 matched.m
字号:
function matched(L, D, S)
%MATCHED Matched filter response using a pulse signal.
% MATCHED(L, D, S)
% L=number of samples D= delay of received pulse (in samples).
% S^2= variance of added Gaussian noise (added to delayed signal).
%
% Displays pulse, received pulse and and matched filter output.
%
% If no arguments given, uses default values : S=0.5, D=100,L=10
% ADSP Toolbox: Version 2.0
% For use with "Analog and Digital Signal Processing", 2nd Ed.
% Published by PWS Publishing Co.
%
% Ashok Ambardar, EE Dept. MTU, Houghton, MI 49931, USA
% http://www.ee.mtu/faculty/akambard.html
% e-mail: akambard@mtu.edu
% Copyright (c) 1998
if nargin<3,S=0.5;end
if nargin<2,if nargin<1,D=100; else, D=4*L;end,end
if nargin<1,L=10;end
N=2*max(L,D); n=0:N-1;
h = [ones(1,L) zeros(1,N-L)];
hd = [zeros(1,D-L) ones(1,L) zeros(1,N-D)];
[mm,nn]=size(hd);
hn=hd+S*randist(ones(mm,nn),'nor');
out1 = filter(h, 1, hd);
out2 = filter(h, 1, hn);
SNR = sum(h.*h) / (S^2);
subplot(221),plot(h),title('Transmitted signal')
subplot(222),plot(hd),title('Ideal received signal')
subplot(223),plot(hn),title('Noisy received signal')
subplot(224),plot(n,out1,n,out2)
title(['Matched filter outputs. SNR = ' num2str(SNR) ' dB'])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -