資源簡介
function [tfr,dgr,gam]=tfrgabor(sig,N,q,h,trace)
%TFRGABOR Gabor representation of a signal.
% [TFR,DGR,GAM]=TFRGABOR(SIG,N,Q,H,TRACE) computes the Gabor
% representation of signal X, for a given synthesis window H, on a
% rectangular grid of size (N,M) in the time-frequency plane. M and N
% must be such that
% N1 = M * N / Q
% where N1=length(X) and Q is an integer corresponding to the
% degree of oversampling.
%
% SIG : signal to be analyzed (length(SIG)=N1).
% N : number of Gabor coefficients in time (N1 must be a multiple
% of N) (default : divider(N1)).
% Q : degree of oversampling ; must be a divider of N
% (default : Q=divider(N)).
% H : synthesis window, which was originally chosen as a Gaussian
% window by Gabor. Length(H) should be as closed as possible
% from N, and must be >=N (default : Gauss(N+1)).
% H must be of unit energy, and CENTERED.
% TRACE : if nonzero, the progression of the algorithm is shown
% (default : 0).
% TFR : Square modulus of the Gabor coefficients. When
% called without output arguments, TFRGABOR runs TFRQVIEW.
% DGR : Gabor coefficients (complex values).
% GAM : biorthogonal (dual frame) window associated to H.
代碼片段和文件信息
function?[tfrrtfrhat]?=?tfrrgab(xtNNhtraceK);
%TFRRGAB?Reassigned?Gabor?spectrogram?time-frequency?distribution.
% [TFRRTFRHAT]?=?TFRRGAB(XTNNHTRACEK)?
% computes?the?Gabor?spectrogram?and?its?reassigned?version.
% This?particular?window?(a?Gaussian?window)?allows?a?20?%?faster
% algorithm?than?the?TFRRSP?function.
%??????????????????
% X?????:?analysed?signal
% T?????:?the?time?instant(s)???????????(default?:?1:length(X))
% N?????:?number?of?frequency?bins??????(default?:?length(X))
% NH????:?length?of?the?gaussian?window?(default?:?N/4))
% TRACE?:?if?nonzero?the?progression?of?the?algorithm?is?shown
%?????????????????????????????????????????????(default?:?0).
% K?????:?value?at?both?extremities?????(default?0.001)
% TFR??:?time-frequency?representation?and?its?reassigned
% RTFR????version.?When?called?without?output?arguments?
% ????????TFRRGAB?runs?TFRQVIEW.
% HAT???:?Complex?matrix?of?the?reassignment?vectors.
%
% Example?:
% ?sig=fmlin(1280.10.4);?tfrrgab(sig1:128128191);
%
% See?also?all?the?time-frequency?representations?listed?in
% ?the?file?CONTENTS?(TFR*)
% F.?Auger?May-July?1994?July?1995.?
%???????Copyright?(c)?1996?by?CNRS(France).?
%?
% -------------------?CONFIDENTIAL?PROGRAM?--------------------
%? This?program?can?not?be?used?without?the?authorization?of?its?
%? author(s).?For?any?comment?or?bug?report?please?send?e-mail?to?
%? f.auger@ieee.org
if?(nargin?==?0)
?error(‘At?least?1?parameter?required‘);
end;
[xrowxcol]?=?size(x);
if?(nargin?<=?2)
?N=xrow;
end;
hlength=floor(N/4);
hlength=hlength+1-rem(hlength2);
if?(nargin?==?1)
?t=1:xrow;?
end;
if?(nargin?<=?3)
?Nh=hlength;?trace=0;?K=0.001;
elseif?(nargin?==?4)
?trace?=?0;?K=0.001;
elseif?(nargin?==?5)
?K=?0.001;
end;
if?(N<0)
?error(‘N?must?be?greater?than?zero‘);
end;
[trowtcol]?=?size(t);
if?(xcol~=1)
?error(‘X?must?have?only?one?column‘);
elseif?(trow~=1)
?error(‘T?must?only?have?one?row‘);?
elseif?(2^nextpow2(N)~=N?&?nargin==6)
?fprintf(‘For?a?faster?computation?N?should?be?a?power?of?two\n‘);
end;?
if?(rem(Nh2)==0)?
?error(‘Nh?must?be?odd‘);?
elseif?length(Nh)~=1
?error(‘Nh?must?be?a?scalar‘);
end;
Nh2=Nh-2;
TFTBcontinue=1;
while?TFTBcontinue
?Nh2=Nh2+2;
評論
共有 條評論