# Combining spectrograms with different windows to getting arbitrary time and frequency resolution

Spectrograms convert an amplitude-time signal into a frequency-time signal using Short Time Fourier Transform (STFT). The window size L used in STFT is a design choice. As L increases, you get higher frequency resolution and lower time resolution and vice versa.

If you performed STFT with a large L to get spectrogram A with high frequency resolution then performed STFT with small L to get spectrogram B with high temporal resolution, can you combine spectrogram A and B somehow to get high temporal and frequency resolution?

My gut feeling is no, as changing L is simply "changing how you interpret the amplitude-time data."

• You could even take it to the next level and analyze the data for chirps so that you have high resolution on rising and falling frequencies. Those are smudged by STFT of any window size. – Olli Niemitalo Oct 31 '17 at 9:05
• One reasonable alternative is take the STFT's of length L every L/2 samples. That is to say, make the windows overlap. The window function applied will tend to 0 near the edges of the windows, so using this hop size of L/2 helps to ensure that each sample will be close to the middle of at least one STFT. This effectively doubles the temporal resolution without a loss of frequency resolution. – MSalters Aug 3 at 11:07

The ways you can combine such SFTF depend a lot on the exact processing or features you want to extract, as detailed by @hotpaw2. Here are a few pointers to references suggesting methods. The first one suggests a point-wise combination of two spectrograms as $$S_c(f,t) = (|S_1(f,t)||S_2(f,t)|)^{1/2},$$ and the second generalizes it to the geometric mean, the minimax or the reciprocal average. The third encompasses it in a more generic merging approach.