马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
根据mathwork提供的st函数stran改写的,理论上将高斯窗求导,不知道对不对,希望能得到各位大佬的指点,主要是为了计算S变换的同步挤压,求出能够挤压的瞬时频率点。
function ST=istran(h)
% Compute S-Transform without for loops
%%% Coded by Kalyan S. Dash %%%
%%% IIT Bhubaneswar, India %%%
h=h';
[~,N]=size(h); % h is a 1xN one-dimensional series
nhaf=fix(N/2);
odvn=1;
if nhaf*2==N;
odvn=0;
end
f=[0:nhaf -nhaf+1-odvn:-1]/N;
Hft=fft(h);
%Compute all frequency domain Gaussians as one matrix
invfk=(1./f(2:nhaf+1))';
W=2*pi*repmat(f,nhaf,1).*repmat(invfk,1,N);
dW=2*pi*repmat(invfk,1,N);
G=exp((-W.^2)/2);
G=(-W.*dW).*G;%Gaussian in freq domain
% End of frequency domain Gaussian computation
% Compute Toeplitz matrix with the shifted fft(h)
HW=toeplitz(Hft(1:nhaf+1)',Hft);
% Exclude the first row, corresponding to zero frequency
HW=[HW(2:nhaf+1,:)];
% Compute Stockwell Transform
ST=ifft(HW.*G,[],2); %Compute voice
%Add the zero freq row
st0=mean(h)*ones(1,N);
ST=[st0;ST];
end |