Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
初级会员
注册日期: 2008-10-08
年龄: 40
帖子: 5
声望力: 0 ![]() |
![]()
function smf = matchedfilter(s,r,fs)
% MATCHEDFILTER calculates the matched filter output % of signal s with replica r. % % smf = matchedfilter(s,r,fs) % % input: % s : the signal % r : the replica % fs : the sample frequency % output: % smf : the matchedfilter output ls = size(s); if (ls(1) ~= 1), s = s'; end ls = max(ls); r(r==0) = []; lr = size(r); if (lr(1) ~= 1), r = r'; end lr = max(lr); T = lr/fs; if (ls < lr), error('Replica must have smaller length than signal'); end % Normalize replica on energy 1 %r = r/sqrt(r*r'); % Normalize replica on maximum amplitude 1 r = r/abs(max(r)); % determine number of points in fft p = 2^ceil(log(ls)/log(2)); if p==ls, % remove wrap around effects when p=2*p; % signal is already 2^n in length end % correlation by multiplication in frequency domain y = conj(fft(r,p)).*fft(s,p); % perform Hilbert transform (stolen from hilbert.m) % throw away negative frequencies and double positive frequencies if p ~= 1 % freq>0 Nyquest freq<0 h = [1; 2*ones(fix((p-1)/2),1); ones(1-rem(p,2),1); zeros(fix((p-1)/2),1)]; y( ![]() ![]() end % matched filtered output smf = abs(ifft(y))'; % envelope这个应该是取包络的意思,可是我不太明白,请高手指教啊%smf1 = real(ifft(y)'); % real part %smf2 = imag(ifft(y)'); % imaginery part smf(ls+1 ![]() smf = smf*2/T/fs; % normalization according to amplitude signal %figure; %plot(smf); % end |
![]() |
![]() |
![]() |
|
|
![]() |
||||
主题 | 主题作者 | 版面 | 回复 | 最后发表 |
matlab工具箱函数汇总(很全) | chenjinyang | MATLAB论坛 | 17 | 2011-02-27 21:13 |
[求助]这个积分需要加点什么条件能够得到合理的结果 | 风雨浪涛 | MATLAB论坛 | 4 | 2009-04-01 22:39 |
[求助]sim函数 神经网络仿真的问题 | jitter | MATLAB论坛 | 0 | 2009-03-22 15:59 |
[讨论]哥德巴赫猜想-张俊龙的“0+0”全新的数学成果之4-《间接的个数“0+0”在直观条件下成立的奥妙》 | 龙舞山威 | 数学 | 0 | 2008-04-01 16:05 |