📄 stft.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -