资源简介
时频重排同步压缩matlab,好用
代码片段和文件信息
function [tfr rtfr hat] = tfrrsp_sq(x t N h trace method)
%
% Reassignment and Synchrosqueezing based on tfrrsp.m
% [TFRRTFRHAT] = TFRRSP_SQ(X T N H TRACE METHOD)
% computes the STFT and its reassigned version.
%
% X : analysed signal.
% T : the time instant(s) (default : 1:length(X)).
% N : number of frequency bins (default : length(X)).
% H : frequency smoothing window H(0) being forced to 1
% (default : Hamming(N/4)).
% TRACE : if nonzero the progression of the algorithm is shown
% (default : 0).
% METHOD: PS: reassign power spectrum
% STFT: reassign STFT
% SQ: Synchrosqueezing
%
% TFR : STFT
% RTFR : reassigned version. When called without output arguments
% TFRRSP runs TFRQVIEW.
% HAT : Complex matrix of the reassignment vectors.
%
% Example :
% sig=fmlin(1280.10.4); t=1:2:128;
% h=tftb_window(17‘Kaiser‘); tfrrsp(sigt64h1);
%
% 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);
[trowtcol] = size(t);
if (nargin <= 2)
N = xrow;
end;
%% if h is not given evaluate window here
hlength = floor(N/4);
hlength = hlength+1-rem(hlength2);
if (nargin == 1)
t = 1:xrow; h = tftb_window(hlength); trace=0;
elseif (nargin == 2)|(nargin == 3)
99999
h = tftb_window(hlength); trace=0;
elseif (nargin == 4)
trace = 0;
end;
if (N<0)
error(‘N must be greater than zero‘);
end;
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)
fprintf(‘For a faster computation N should be a power of two\n‘);
end;
[hrowhcol] = size(h); Lh = (hrow-1)/2;
if (hcol~=1)|(rem(hrow2)==0)
error(‘H must be a smoothing window with odd length‘);
end;
if (tcol==1)
Dt=1;
else
Deltat = t(2:tcol) - t(1:tcol-1);
Mini = min(Deltat); Maxi = max(Deltat);
if (Mini ~= Maxi)
error(‘The time instants must be regularly sampled.‘);
else
- 上一篇:Matlab 区域标记与面积计算
- 下一篇:PMSM MatLab仿真模型
评论
共有 条评论