• 大小: 3KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-06-04
  • 语言: Matlab
  • 标签: WVD  STFT  MATLAB  

资源简介

处理非平稳信号的两种使用方法WVD 和STFT 的matlab程序,出图效果好

资源截图

代码片段和文件信息

function [TFSP] = STFT(DMfm);

% y: input signal
% D: the data matrix: D(:1)=t; D(:2)=y;
% M: the lenght of the FT window
% [0 fm] The Frequency range for the signal
% SP: the spectogram (short time fourier transform) of D 

%fm % the maximum freq 

t=D(:1);y=D(:2);
N=length(y);

W=hanning(M);
ye=zeros(N+M1);
ye(M/2+1:M/2+N)=y;
%yea=hilbert(ye);
dt=t(2)-t(1);% time resolution
fs=1/dt; % the sampling frequency

df=fs/M; %frequency resolution
L=round(fm/df); % the index of the max freq.
f=[0:L-1]*df;

i=1;
while i<=N
   
   s=ye(i:i+M-1).*W;
   sa=hilbert(s);
   
   S=fft(sa);
   B(:i)=S(1:L);
   i=i+1;% increase by one (next sample)
end

SP = (1/N)*abs(B.*B);
SP = SP/max(max(SP)); % normalize it
T  = t;
F  = f;



% mesh(TFSP)
% contour(TFSP)





 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     目录          0  2005-03-01 17:21  WVD_STFT

     文件        818  2005-03-01 17:18  WVD_STFT\STFT.m

     文件        735  2005-03-01 17:17  WVD_STFT\Test.m

     文件       1286  2005-03-01 17:17  WVD_STFT\Wigner.m

     文件       1726  2005-03-01 17:08  WVD_STFT\WignerDist.m

----------- ---------  ---------- -----  ----

                 4565                    5


评论

共有 条评论