What determines the number of points in the reconstructed signal found by stftmag2sig with the Method='gla' option?

1 view (last 30 days)
What determines the number of points in the reconstructed signal found by the stftmag2sig with the Method='gla' option? The size of the recovered signal varies drastically depending on the window length, number of FFT points, and overlap I select. I've tried reading "Signal Estimation from Modified Short-Time Fourier Transform" by Daniel W. Griffin and Jae S. Lim to find answers, but am having trouble making sense of it and how what's written relates to my problem. Any help or additional relevant resources would be greatly appreciated.
% x = clipped killer whale call, which was a .wav file read in with audioread(). length(x)= 39956
fs = 40960;
L = 64
M = 300
w = hamming(300, 'periodic');
myStft = stft(x, fs, Window=w, FFTLength=M, OverlapLength=L);
trial.reconstructed_x = stftmag2sig(abs(myStft), size(myStft, 1), Method='gla');
% plotting the top two plots; bottom two follow same convention
plot(trial.x)
stft(x, fs, Window=w, FFTLength=M, OverlapLength=L)

Accepted Answer

Paige
Paige on 5 Jun 2025
Though this doesn't explain all the intricacies behind what determines the number of points in the aforementioned reconstructed signal, I learned that the following equation governs whether the reconstructed signal has the same number of points as the original signal:
some integer = (N - L)/(W - L)
^^ must be true for # of pts in original signal to equal # of pts in reconstructed sample.
  • N = number of samples in input signal
  • W = length of window (in number of sample points)
  • L = number of samples in between where one window starts and the next window starts. For example, there is 0% overlap when L = W.
I found this information in the MATLAB documentation for stftmag2sig under the "x - Reconstructed time-domain signal" dropdown section, which is for one of the output arguments. This documentation is linked below:

More Answers (0)

Products


Release

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!