Measuring short times in decimal seconds

Audacity 2.0.2 on Windows XP.

I am a physics teacher so my main use for Audacity is measuring/generating sound (pressure) waves with my students. We often want to measure the period of a wave, which tends to be a very short time on the order of 10-thousandths of a second. When I upgraded from 1.2.6 to 2.0.2, I was surprised to find that the option to measure time segments in units of less than milliseconds (the default for 1.2.6) is gone.

Here is the old version with times measured down to the millionths(!) of a second:

I know that I can use samples and the project rate to find time durations, but having to explain sampling to my middle school students tends to obscure the point, rather than illuminate it. Is there something I’m missing?

Right now I’m using 1.2.6 and having my students download this old version.

There’s some potential problems that I can see with adding decimals to 5 or more decimal places in the “time boxes”:

  • Other than for middle school physics teachers, either milliseconds or samples are more useful, so this would seem to be a small niche application.
  • The minimum time resolution for digital audio is 1 sample period, which for a sample rate of 44.1 kHz is a little over 0.00002 seconds. Periods shorter than this can only be determined by extrapolation, but you can’t select “half a sample period”. Going beyond 4 decimal places would mean that the selection could be adjusted in the Selection toolbar “time boxes” but there would be no change in the actual selection. This was not a problem in 1.2.6 because the time was for display purposes only.
  • 5 or more decimal places would make the “time boxes” very large and the three of them would not fit side by side on smaller monitors.

A possible workaround is that if you set the Project Rate (bottom left corner of the main screen) to 100000 (100 kHz), then “samples” will display as 100 samples per millisecond (100,000 samples per second). It would be easy to demonstrate that is the case without necessarily going into detail about sample rates.

Thanks for the relevant and helpful feedback! I can see how all of your points make sense, especially the small monitor size since I am a netbook user myself. I like the tip about setting the project sample rate to 100 kHz; that’s most likely what I will do.


If it is any use to you, it would be very easy to make a little plug-in for the Analyze menu that could give you the exact duration to as many decimal places as you like (well, up to about 12 decimal places :wink:)

Here’s a plug-in called “Show Duration” that will display the duration in seconds to 5 decimal places.
Installation instructions:
show-duration.ny (564 Bytes)

That plug-in would be great, but I also tried the 100 kHz workaround and I’m thinking it will work for what we need.

Thanks again.

I think you must have been typing while I was posting. See my previous post.

Hi Steve,

I’m time-stamping a lot of speech files, and I’m looking for a way to have audacity display the start and stop time of a selection in seconds + milliseconds as one number, for example: 1234.567 seconds (instead of the current way, hh:mm:ss.sss). It sounds like your plugin does this, but I can’t get it to install - any suggestions? (I followed the instructions on the Nyquist Plugins page: downloaded, saved in the plug-ins folder, and enabled it, but it doesn’t show up under “Effect” in audacity.) I’m using 2.1.2.


It’s an “Analyze” type effect, so when enabled, it is listed in the “Analyze” menu.

Aha! There it is indeed! Thanks!

But I realized that this doesn’t exactly do what I want - your plugin gives the duration out to 5 decimal points, but not the objective start and stop time. Is there a way to get this information from your plugin? Or do you know of a different way of doing it? (I want the start and stop time to show up just as a number of seconds.milliseconds, not hh:mm:ss.mmm, or I’d be fine with getting the time of the cursor location.)

Try this version:
show-selection-time.ny (899 Bytes)
Note that these lines in the file configure how the times are displayed. I think it is fairly obvious how to modify it if you need to.

;; Configuration settings:
(setf multiplier 1000)  ;multiply by 1000 for time in ms
(setf units "ms")       ;time units as appears in output string
(setf decimal-places 1) ;number of decimal places

Awesome, this is perfect Steve. Thanks so much!