blackharrispulse.m

来自「用MATLAB语言开发的hariss窗函数,在探地雷达等技术中可以作为输入信号源」· M 代码 · 共 30 行

M
30 行
字号
function p = blackharrispulse(fr,t)
% blackharrispulse.m
%
% This function computes the derivative of a Blackman-Harris window given a time vector 
% and the desired dominant frequency.  See Chen et al. (1997), Geophysics 62, p. 1733 for 
% details.  Note that their formulation has been changed here to T = 1.14/fr, such that fr 
% represents the approximate dominant frequency of the resulting pulse.
%
% Syntax:  p = blackharrispulse(fr,t)
%
% where fr = dominant frequency (Hz)
%       t  = time vector (s)
%
% by James Irving
% July 2005

% compute the Blackman-Harris window as specified in Chen et al. (1997)
a = [0.35322222 -0.488 0.145 -0.010222222];
T = 1.14/fr;
window = zeros(size(t));
for n=0:3
    window = window + a(n+1)*cos(2*n*pi*t./T);
end
window(t>=T) = 0;

% for the pulse, approximate the window's derivative and normalize
p = window(:)';
p = [window(2:end) 0] - window(1:end);
p = p./max(abs(p));

⌨️ 快捷键说明

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