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

📄 cantight.m

📁 linear time-frequency toolbox
💻 M
字号:
function gamma=cantight(p1,p2,p3,p4)%CANTIGHT  Canonical tight window.%   Usage:  gamma=cantight(a,M,L);%           gamma=cantight(g,a,M);%           gamma=cantight(g,a,M,L);%%   Input parameters:%         g     : Gabor window.%         a     : Length of time shift.%         M     : Number of modulations.%         L     : Length of window. (optional)%   Output parameters:%         gamma : Canonical tight window, column vector.%%   CANTIGHT(a,M,L) computes a nice tight window of length L for a%   lattice with parameters a, M.%%   CANTIGHT(g,a,M) computes the canonical tight window of the Gabor%   frame with window g and parameters a, M.%%   CANTIGHT(g,a,M,L) pads or truncates g to length L before%   calculating the tight window. gamma will also be of length L.%%   If a>M then an orthonormal window of the Gabor Riesz sequence with%   window g and parameters a and M will be calculated.%%   SEE ALSO:  CANDUAL%   Author : Peter Soendergaard.wasrow=0;if nargin<3  error('Too few input parameters.');end;if nargin>4  error('Too many input parameters.');end;wasrow=0;if prod(size(p1))==1  % First argument is a scalar.      % Type 1: Nice tight win for sep system.  a=p1;  M=p2;  L=p3;  assert_squarelat(a,M,1,'CANTIGHT',0);  [b,N,L]=assert_L(L,L,a,M,'CANTIGHT');  % Create default window, a Gaussian.  g=comp_pgauss(L,a/b,0);else  % First argument assumed to be a vector.    g=p1;  L=length(g); % might be overwritten later.    % Take care of row/column preferences. Convert to column layout.  if size(g,1)==1    wasrow=1;    % Make g a column vector.    g=g(:);  end;    if size(p2,1)*size(p2,2)==1    % Second argument a scalar.        if nargin<3      error('To few input parameters.');    end;        a=p2;    M=p3;        assert_squarelat(a,M,1,'CANTIGHT',0);    Lwindow=length(g);    Ls=Lwindow;    if nargin<4      [b,N,L]=assert_L(-Ls,Lwindow,a,M,'CANTIGHT');    else      [b,N,L]=assert_squarelat(L,Lwindow,a,M,'CANTIGHT');      g=firextend(g,L);    end;         end;end;  % If input is real, output must be real as well.inputwasreal = isreal(g);if a>M  % Handle the Riesz basis (dual lattice) case.  gf=comp_wfac(g,M,a);  gammaf=comp_cantight_fac(gf,L,M,a)*sqrt(a/M);  gamma=comp_iwfac(gammaf,L,M,a);  else  % Handle the frame case  gf=comp_wfac(g,a,M);  gammaf=comp_cantight_fac(gf,L,a,M);  gamma=comp_iwfac(gammaf,L,a,M);end;if inputwasreal  gamma=real(gamma);end;   if wasrow  gamma=gamma.';end;

⌨️ 快捷键说明

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