• Stockwell transform in matlab


    https://ww2.mathworks.cn/matlabcentral/fileexchange/45848-stockwell-transform--s-transform-

     Compute S-Transform without for loops

    function ST=stran(h)
    
    % Compute S-Transform without for loops
    
    %%% Coded by Kalyan S. Dash %%%
    %%% IIT Bhubaneswar, India %%%
    
    [~,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);
    
    G=exp((-W.^2)/2); %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
    

      相比ST效率会更高一点

    但是,处理的矩阵长度大概都在10000左右,再多一点就报错,没有spectrogram高效。

    spectrogram可以处理更长时间的数据。

  • 相关阅读:
    常见的排序算法
    322. Coin Change
    C++ STL中的lower_bound,upper_bound使用小结
    滑动窗口题汇总
    1658. Minimum Operations to Reduce X to Zero
    739. Daily Temperatures
    240. Search a 2D Matrix II
    474. Ones and Zeroes
    221. Maximal Square
    javac不是内部或外部命令
  • 原文地址:https://www.cnblogs.com/gisalameda/p/9083846.html
Copyright © 2020-2023  润新知