comp_pgauss.m

来自「linear time-frequency toolbox」· M 代码 · 共 45 行

M
45
字号
function [g]=comp_pgauss(L,w,center)%COMP_PGAUSS  Sampled, periodized Gaussian.%   %   Computational routine: See help on PGAUSS.%%   center=0  gives whole-point centered function.%   center=.5 gives half-point centered function.%%   Does not check input parameters, do not call this%   function directly.%   Author : Peter Soendergaard.if prod(size(center))==1  c_t=center;  c_f=0;else  c_t=center(1);  c_f=center(2);end;% c_t - time centering% c_f - frequency centeringg=zeros(L,1);sqrtl=sqrt(L);safe=4;% Outside the interval [-safe,safe] then exp(-pi*x.^2) is numerically zero.nk=ceil(safe/sqrt(L/sqrt(w)));lr=(0:L-1).';for k=-nk:nk    g=g+exp(-pi*((lr+c_t)/sqrtl-k*sqrtl).^2/w-2*pi*i*c_f*(lr/L-k));end;% Normalize it exactly.g=g/norm(g);% This normalization is only approximate%g=g*(w*L/2)^(-.25);

⌨️ 快捷键说明

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