Using Vamp Plugins and Hosts > Host Forum: Sonic Visualiser

How are the spectrogram time stamps calculated?

(1/1)

jean-louis:
Hi everyone,

I was wondering something, for some time now. In order to annotate some audio data, I display a layer of annotations ("a value at a time") on top of a spectrogram (computed using the built-in layer). The annotations I use have time stamps that correspond to the center of the analysis window. I noticed that sometimes there seems to be an offset between the stream of values (fundamental frequencies) and the displayed spectrogram. I however failed to find out how the time stamps were computed: do they correspond to the beginning of each frame, or to the center of the frames?

Cheers!

Jean-Louis

cannam:
Sorry to have taken so long to reply to this -- this is the sort of question that makes me really want to go back and review the behaviour of the program carefully, and take a look at the source code, and I'm afraid I haven't had time during the last month to do any of that having been somewhat swamped with other things.

In a 1024-point spectrogram with zero overlap, you should find that column N that is aligned with samples N*1024 to (N+1)*1024-1 in the audio waveform contains the data calculated from samples N*1024 and (N+1)*1024.

With overlap, the intention is to centre the displayed column on the centre sample of the source frame.  That is, given a 1024-point spectrogram with 50% overlap, the column N aligned with samples N*512 to (N+1)*512-1 should contain the data calculated from samples (N*512)-256 to (N+1)*512+255.


Chris

jean-louis:
Hi Chris,

Thanks for your answers. I might have some more questions about the time stamp returned by a plugin (first sample analyzed or middle of the frame?), but I need to get started with plugins and plugin development before I ask this sort of questions :D

Cheers !

Jean-Louis

Navigation

[0] Message Index

Go to full version