Vamp Plugins Forum
February 09, 2012, 06:02:41 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How are the spectrogram time stamps calculated?  (Read 907 times)
jean-louis
Newbie
*
Posts: 16


View Profile WWW
« on: July 28, 2010, 07:06:41 »

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
Logged
cannam
Administrator
Full Member
*****
Posts: 189


View Profile
« Reply #1 on: August 25, 2010, 20:56:22 »

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
Logged
jean-louis
Newbie
*
Posts: 16


View Profile WWW
« Reply #2 on: September 25, 2010, 15:23:27 »

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 Cheesy

Cheers !

Jean-Louis
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.14 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!