The Short time fourier transform(STFT) splits the signal(x) into overlapping segments and reconstruct the original signal by adding the transformed segments.
The STFT divides 'x' into overlapping frames/windows. The number of frames depends on:
- Length of 'x'
- Window length
- Amount of overlap('noverlap')
The number of frames is approximately:
When the number of frames is an integer, the signal x is perfectly segmented using the specified window and overlap. If not, the last frame is partial or padded, leading to a reconstructed signal that differs in length from the original.
Example
- Window length = 128 samples
- Overlap (noverlap) = 96 samples (which is 75% overlap)
Case 1: length(x) = 1024
The ratio is 29, so the STFT divides the signal into 29 complete overlapping windows, allowing accurate reconstruction with the original signal length.
Case 2: length(x) = 1000
The ratio is 28.25, resulting in an incomplete final window that requires padding or truncation. As a result, the reconstructed signal may be shorter or longer than the original.
I hope this resolves the query.