stft.m
来自「时频分布算法中的短时fourier变换和维格纳变换的程序。」· M 代码 · 共 17 行
M
17 行
function X_stft = stft(x, sigma, Ts)
%**************************************************************************
% X_stfrft : the short-time fractional Fourier transform
% x : the input sequence
% sigma : the standard deviation of the Gaussian window funcion
% Ts : the time sampling interval
% 2007.11.13 by Li Yanlei
%**************************************************************************
[R,C] = size(x);
if R ~= 1, x = x.'; L = R; else L = C; end % make sure that x is row vector
if mod(L,2) ~= 0, L = L+1; x = [x,0]; end % make sure that L is even
n = -L/2+1 : L/2;
t = Ts*n;
for m = -L/2+1 : L/2
window = (2*pi*sigma^2)^(-0.25)*exp(-(t-(m*Ts)).^2/(4*sigma^2));
X_stft(:,m+L/2) = fftshift(fft(x.*window))/sqrt(L);
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?