📄 dgt.m
字号:
function [c,Ls]=dgt(f,g,a,M,L)%DGT Discrete Gabor transform.% Usage: c=dgt(f,g,a,M);% c=dgt(f,g,a,M,L);% [c,Ls]=dgt(f,g,a,M);% [c,Ls]=dgt(f,g,a,M,L);%% Input parameters:% f : Input data% g : Window function.% a : Length of time shift.% M : Number of modulations.% L : Length of transform to do.% Output parameters:% c : M*N array of coefficients.% Ls : Length of input signal.%% DGT(f,g,a,M) computes the Gabor coefficients of the input% signal f with respect to the window g and parameters a and M. The% output is a vector/matrix in a rectangular layout.%% The length of the transform will be the smallest multiple of a and M that is% larger than the signal. f will be zero-extended to the length of the % transform. If f is a matrix, the transformation is applied to each column.%% The length of the transform done can be obtained by L=size(c,2)*a; %% DGT(f,g,a,M,L) computes the Gabor coefficients as above, but does% a transform of length L. f will be cut or zero-extended to length L before% the transform is done.%% [c,Ls]=DGT(f,g,a,M) or [c,Ls]=DGT(f,g,a,M,L) additionally returns the% length of the input signal f. This is handy for reconstruction:% % [c,Ls]=dgt(f,g,a,M);% fr=idgt(c,gd,a,Ls);% % will reconstruct the signal f no matter what the length of f is, provided% that gd is a dual window of g.%% The Discrete Gabor Transform is defined as follows: Consider a window g% and a one-dimensional signal f of length L and define N=L/a.% The output from c=DGT(f,g,a,M) is then given by% % L-1 % c(m+1,n+1) = sum f(l+1)*exp(-2*pi*i*m*l/M)*conj(g(l-a*n+1)), % l=0 % % where m=0,...,M-1 and n=0,...,N-1.% % SEE ALSO: IDGT, DWILT, CANTIGHT% % EXAMPLES: EXAMP_DGT% % REFERENCES:% H. Feichtinger and T. Strohmer. Gabor analysis and algorithms. Theory and% applications. Birkhäuser, Boston, 1998.% % K. Gröchenig. Foundations of time-frequency analysis. Appl. Numer. Harmon.% Anal. Birkhäuser Boston, Boston, MA, 2001.% AUTHOR : Peter Soendergaard.% Assert correct input.error(nargchk(4,5,nargin));if size(g,2)>1 if size(g,1)>1 error('g must be a vector'); else % g was a row vector. g=g(:); end;end;assert_squarelat(a,M,1,'DGT',0);% Change f to correct shape.[f,Ls,W,wasrow,remembershape]=comp_sigreshape_pre(f,'DGT',0);Lwindow=size(g,1);if nargin<5 [b,N,L]=assert_L(-Ls,Lwindow,a,M,'DGT');else [b,N,L]=assert_L(L,Lwindow,a,M,'DGT');end;f=postpad(f,L); c=comp_dgt(f,g,a,M,L);c=reshape(c,M,N,W);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -