I know STFT is generally applied to non-stationary signals but I tried to apply it to a stationary signal to get a working knowledge.
I created a stationary signal composed of three frequencies as below:
x = 3*cos(2*pi*30*t + phi1) + 2*cos(2*pi*45*t - phi2) + 1*cos(2*pi*70*t + phi3);
I then performed STFT (Short-Time Fourier transform) on this signal using hann window of
length = 128.
I have tried ranging the overlapping percentage from 75% to 0% (no overlap) but cannot see and difference in the spectrogram generated. Why could that be?
On varying the length of the window (keeping overlapping percentage same), the bright lines in the spectrogram thickens or thins. Why could that be?
I am using MATLAB's STFT function and documentation can be found here:1
I tried a signal with varying frequency over time. As pointed out, decreasing overlap percentage results in coarser time grid.
However, when increasing window size from 64 to 128 keeping overlap percentage same (75% for both), and 128-point FFT, in both cases the STFT is calculated for 65 frequencies (128/2 + 1). And the 64-hann window gives a better result. Does that mean that a smaller window gives better results almost everytime? Obviously, I understand that a smaller window would mean more computation cost.
Another experiment made me realize that keeping everything constant (window size, overlap), and increasing the N in N-DFT gives better results.