⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fm_s.m

📁 matlab下的有用的时频分析工具箱
💻 M
字号:
function [y,iflaw]=fm_s(N,fnormin,fnormax);
%FM_S	Signal with s style frequency modulation.
%	[Y,IFLAW]=FM_S(N,FNORMIN,FNORMAX,T0,FNORM0,PM1)
%	generates a frequency modulation with a s style frequency.
%	This s style modulation is designed such that the instantaneous

%	N       : number of points.
%	FNORMIN : smallest normalized frequency          (default: 0.0) 
%	FNORMAX : highest normalized frequency           (default: 0.5)
%	Y       : signal
%	IFLAW   : its instantaneous frequency law (optional).
%
%	Example: 
%	 z=fm_s(140,0.05,0.45);plot(real(z));
%
%	See also FMCONST, FMLIN, FMODANY, FMHYP, FMPAR, FMPOWER.

%	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),
 fnormin = 0.05; fnormax = 0.45;
elseif (nargin == 2),
 fnormax = 0.45;
end;

if (N <= 0),
 error ('The signal length N must be strictly positive' );
elseif ((abs(fnormin) > 0.5)|(abs(fnormax) > 0.5)),
 error ('fnormin, fnormax and fnorm0 must be between -0.5 and 0.5') ;
elseif (fnormin > fnormax)
 error ('fnormin must be lower than fnormax');

else
 k=(fnormax-fnormin)/(N-1);
 delta  = 0.25*(fnormax-fnormin);
 time=(1:N);
 phase=(k/2) * (time-1).^2 +delta*N/(2*pi)*cos(2*pi*time/N);
 iflaw1=k*time-delta*sin(2*pi*time/N);
  a=  min(iflaw1);
 if a<fnormin
     iflaw1=iflaw1+(fnormin-a);
     phase=phase+(fnormin-a)*time;
 end
  b = max(iflaw1);
  if b>fnormax
      iflaw1= iflaw1/b*fnormax;
      phase = phase/b*fnormax;
  end
 y = exp(j*2*pi*phase).';
 if (nargout==2)
  iflaw=iflaw1    ;
 end
end

⌨️ 快捷键说明

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