If you vary the Window size in spectrogram preferences, you soon discover the tradeoff between time resolution (which is better with smaller windows) and frequency resolution.
The "reassignment" method for sharpening spectrogram displays is one way to escape the tradeoff between time and frequency resolution, and it can be made even more precise with zero-padding of the windows. In broad terms: perform FFT of waveform data, as now. The resulting coefficients contribute to brightness of pixels in the display. But by using two other FFTs, two corrections can be calculated, one horizontal and one vertical, to move the contributions from the first FFT to better sample times and frequency bins, before remapping that to the grid of pixels. Thus some pixels may receive contributions from more than one window and bin of the first FFT, and others may receive none.
Here is the reference I am consulting. http://perso.ens-lyon.fr/patrick.flandrin/0065-Ch05.pdf
I have only a partial implementation working, that performs the vertical corrections only, but already the results are striking.
Here is the Spectrogram Preferences dialog in my project. Note the "zero padding" drop-down, which can choose among powers of 2, and the "Reassignment" checkbox. With these settings, the new feature does not affect the display:
Here is a five-second chirp, from 20 to 2000 Hz, linear frequency ramp, amplitude 0.8, waveform is square no alias, viewed with settings as above. There is also a narrow click in the middle, made by moving just one sample with the pencil tool.
Here is the same with "Zero padding factor" increased to 8. There is eightfold better resolution along the vertical axis but not really more detail. Notice near the lower right that the lobes of the Blackman-Harris window are better resolved as ripples between the overtones. The waveform is still windowed only 256 samples at a time for each column of pixels, but that is inserted in a window of 2048 samples before FFT, giving more frequency coefficients. Thus too the time resolution of the click is no less precise.
The first spectrum, reassigned (vertically). Notice that the overtones are more precisely indicated but the click is not any more smeared horizontally!
More pictures to come...
Reassigned spectrograms -- preliminary results!
Reassigned spectrograms -- preliminary results!
Last edited by Paul L on Sun Feb 08, 2015 6:59 pm, edited 3 times in total.
Re: Reassigned spectrograms -- preliminary results!
Reassignment and padding factor 8 yield this picture:
A zoomed view of the last:
We see that when frequency resolution is very fine, the zoomed-out view may no longer indicate peak frequencies in white. That is because, when the vertical extent of one pixel covers more than one frequency bin, the display algorithm takes an average. Should it take a maximum instead?
A zoomed view of the last:
We see that when frequency resolution is very fine, the zoomed-out view may no longer indicate peak frequencies in white. That is because, when the vertical extent of one pixel covers more than one frequency bin, the display algorithm takes an average. Should it take a maximum instead?