📄 fmctan.m
字号:
function [y,iflaw]=fmctan(N,k,fnorm0,fnormax);
%FMCTAN Signal with Inverse tangential frequency modulation.
% [Y,IFLAW]=FMCTAN(N,K,FNORM0,FNORMAX)
% generates a frequency modulation with a tangential frequency.
% N : number of points.
% k : cofficient of frequency modulation (default: 0.5)
% FNORM0 : lowest frequency (default:0.0)
% FNORMAX : highest frequency (default:0.5)
% Y : signal
% IFLAW : its instantaneous frequency law (optional).
%
% Example:
% [z,iflaw]=fmctan(128,0.2,0,0.5);plot(iflaw);
%
% See also FMCONST, FMLIN, FMODANY, FMHYP, FMPAR, FMPOWER,FMSIN.
% 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 USA
if (nargin == 0),
error ( 'At least 1 parameter required' ) ;
elseif (nargin == 1),
k=0.5;fnorm0=0;fnormax=0.5;
elseif (nargin == 2),
fnorm0=0;fnormax=0.5;
elseif (nargin == 3),
fnormax=0.5;
end;
if (N <= 0),
error ('The signal length N must be strictly positive' );
elseif (fnorm0<0|fnormax>0.5),
error (' fnorm0 must higher than 0 and fnormax must lower than 0.5') ;
elseif (k <=0|k>=1),
error (' k must be between 0 and 1') ;
else
f0=(fnormax+fnorm0)/2;
B=(fnormax-fnorm0)/2;
time=(1:N)-N/2;
iflaw1=atan(k*time);
C=max(iflaw1);
if C>B
iflaw1=iflaw1/C*B;
end
iflaw2=iflaw1+f0;
phase=cumsum(iflaw2);
y = exp(j*2*pi*phase).';
if (nargout==2)
iflaw=iflaw2;
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -