📄 comp_pgauss.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -