📄 amtriang.m
字号:
function y = amtriang(N,t0,T);%AMTRIANG Generate triangular amplitude modulation.% Y = AMTRIANG(N,T0,T) generates a triangular amplitude modulation % centered on a time T0, and with a spread proportional to T.% This modulation is scaled such that Y(T0)=1.% % N : number of points.% T0 : time center (default : N/2).% T : time spreading (default : 2*sqrt(N)).% Y : signal.%% Examples:% z=amtriang(160);plot(z);% z=amtriang(160,90,40);plot(z);% z=amtriang(160,180,50);plot(z);%% See also AMEXPO1S, AMEXPO2S, AMGAUSS, AMRECT.% F. Auger, July 1995.% Copyright (c) 1996 by CNRS (France).%% This program is free software; you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation; either version 2 of the License, or% (at your option) any later version.%% This program is distributed in the hope that it will be useful,% but WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the% GNU General Public License for more details.%% You should have received a copy of the GNU General Public License% along with this program; if not, write to the Free Software% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USAif (nargin == 0), error ( 'The number of parameters must be at least 1.' );elseif (nargin == 1), t0=N/2; T=2*sqrt(N);elseif (nargin ==2), T=2*sqrt(N);end;if (N<=0), error('N must be greater or equal to 1.');else tmt0=(1:N)'-t0; L=sqrt(10.0/pi)*T/2.0; y = max(0.0,min([L+tmt0';L-tmt0']))'/L;end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -