Analyze Menu

From Audacity Manual

Jump to: navigation, search
The Analyze menu contains tools for finding out about the characteristics of your audio, or labeling key features. Plug-ins that accept input but produce no audio output will also be placed in the Analyze menu.

Built-in analysis effects

Most of the analysis tools included in Audacity are Nyquist plug-ins. You can download some additional Nyquist analysis plug-ins from the Download Nyquist Plug-ins page on our Wiki. Some LADSPA analysis plug-ins for Linux can be downloaded from the LADSPA site.

Contrast ...

Contrast Analysis is designed to analyze a single mono or stereo speech track to determine the average rms difference in volume (contrast) between foreground speech and background music, audience noise or similar). The purpose is to determine if the speech will be intelligible to the hard of hearing. Note that if you have multiple tracks open, Contrast Analysis will calculate rms values based on all of the tracks, whether they are selected or not.

To use Contrast Analysis, click on the menu item, then:

Step One:

  • Select a region containing the speech (this is the "foreground" selection)
  • Click on the "Measure selection" button in the 'Parameters' box in the "Foreground:" row; the start and end times of the selection will be displayed
  • The average rms of the selected foreground audio will be displayed in the "Volume" box at the end of the row

Step Two:

  • Select a region containing only the background sound (this is the "background" selection)
  • Click on the "Measure selection" button in the 'Parameters' box in the "Background:" row ; the start and end times of the selection will be displayed
  • The average rms of the selected background audio will be displayed in the "Volume" box at the end of the row

Result:

  • Contrast Result: Shows if the difference between foreground and background gives a pass or fail against the "WCAG 2.0, Success Criteria 1.4.7" guideline for accessible audio. A pass is given if the difference is 20 dB or more.
  • Difference: The actual average rms difference value found
  • Reset: Clears all the parameters and result values
  • Export: Saves the foreground/background values and the result to a text file for proof that you checked your audio file. If you export again to the same file, the new result will be appended underneath the previous one.
  • WCAG2 Help: Links to an external illustrated tutorial for this tool
  • Close: Closes the Contrast Analysis window, retaining foreground/background and result values for the duration of the Audacity sesssion
To ensure the track is fully compliant with WCAG2, you should check the contrast between foreground and background in several places.

Plot Spectrum...

Frequency Analysis of a chirp tone followed by the word "Audacity"

This takes the selected audio (which is a set of sound pressure values at points in time) and converts it to a graph of frequencies against amplitudes. This is done using a mathematical algorithm known as a Fast Fourier Transform or FFT. This gives a value for each narrow band of frequencies that represents how much of those frequencies is present. All the values are then interpolated to create the graph.

Plot Spectrum take the audio in blocks of 'Size' samples, does the FFT, and averages all the blocks together.

There is an audio version of the Uncertainty Principle that says "Frequency_Resolution*Time_Resolution = 2." The PlotSpectrum tools lets you choose the FFT size which is the number of consecutive audio samples to be analyzed. If you choose 1024 samples, you will get 512 frequency bins covering the frequency range up to half the sampling frquency. Most projects use 44.1kHz sampling frequency. Thus, in this example, Time_Resolution = 1024/44.1 = 23.2 milliseconds and the frequency resolution is 44100/2/512 = 43 Hz.

Another PullDown is Function which offers choices like Rectangular, Hanning, Hamming, and others. We suggest you use Hanning (actually it is a Hann window, but Hanning is widely accepted) for most situations. The fundamental principle at work here is that the way we observe our data changes what we see. The "true spectrum" of your project would be computed over the entire project and would provide very detailed frequency resolution but essentially no time resolution at all. In other words, this "true spectrum" would offer an average frequency distribution over the entire project. If we select a short interval of audio, the short-time spectrum has frequency resolution limited by the observation window time AND the result is affected by the spectrum of the window itself. For general audio analysis, the Rectangular window is least desirable, and the other options offer slightly different effects.

I don't know who put this here, and I'm now hiding it from logged-out users. - Bill Nov 6/09
Aside: the Plot Spectrum seems to do some averaging over the selected window up to the 23.8 sec limit. -- I need to get the details to better explain what is happening. For example, the Rectangular window generates bumpy sidelobes and our PlotSpectrum smooths that out to invisibility. How?

Note that currently only the first 237.8 seconds of selected audio can be analyzed.

The image above is a spectrum of the word 'Audacity' spoken aloud. The same word used as part of the example on the Track Drop-Down Menu page, but by a different user.

The following controls let you configure the way the plot is calculated and displayed:

Algorithm

Determines what type of processing is done on the audio data.

  • Spectrum: (default) - Plots the FFT of the data as described above.
  • Autocorrelation: These options measure to what extent the sound repeats itself. This is done by taking two copies of the audio, and moving one forward by one sample. The two copies are then multiplied together, and all the values added up. This is repeated for two samples difference and so on, up to the number of samples in the size option. This gives a small result if the waveform is random (for example, noise) and a large result if it is repetitive (like a musical note). By looking at the peaks in the plot, the key frequencies present can be determined even if there is a lot of noise.
  • Cepstrum: The cepstrum of an audio signal is related to the spectrum, but presents the rate of change in the different spectrum bands. It's particularly useful for properties of vocal tracks and is used, for example, in software to identify speakers by their voice characteristics.

Size

This controls how many frequency divisions are used for the spectrum, or how many samples are used for autocorrelation. In Spectrum, a larger size gives more accurate frequency resolution (narrow bands), but averages the result over a longer period of time (because more samples are needed for the calculation). In Autocorrelation, a larger size looks for repeating patterns over a larger range of time offsets, and so will detect lower frequency patterns. With either algorithm, Audacity will show a warning if the selected region is too short for the chosen size.

Export ...

Exports the spectrum to a text file. You could open this text file in another program for further analysis.

Replot

Allows you to replot the spectrum when the selection changes.

Function

Selects which mathematical function is used to pre-process the data. The basic forms of the FFT and autocorrelation algorithm require infinitely long sections of audio to work on, and so take infinitely long to complete. Hence the available audio must be faded in and out so that the finite length of the audio has minimum effect. The available functions are known as "windows" and fade in and out using different methods. There is a trade-off between frequency resolution and spillage from one frequency band to another.

  • Rectangular: is the simplest - it just cuts off the given block of samples with a sharp cut (no fading), and so leaves a sharp click at each end of the data. This means that you get a lot of spillage into other frequency bands. Not a good plan.
  • The rest fade in and out using various methods. The default (Hanning) is a good compromise, although opinions vary.

Axis

When using the Spectrum, the frequencies can be displayed on a linear scale (default, which gives equal width to each increment on the scale) or on a logarithmic scale.

Grids

Turn the measurement grids on and off.

Find Clipping...

Find clipping dialog

Displays runs of clipped samples in a Label Track, as a screen-reader accessible alternative to View > Show Clipping. A run must include at least one clipped sample, but may include unclipped samples too.

Start Threshold (default 3 samples) is the number of contiguous clipped samples that must be present before they will be labeled as an individual run. The higher the threshold, the less likely a clipped region will be recognized and the fewer labels that will be generated.

Stop Threshold (default 3 samples) is the number of contiguous unclipped samples that must be present before the run of clipped samples will be terminated. The higher the threshold, the longer a clipped region will be and the fewer labels that will be generated.

Each individual run of clipped samples is marked in the format "number of number". For example, "11 of 11" means there are 11 samples in this run of clipped samples and all of them are clipped, while "9 of 11" means only nine samples in the run of 11 are clipped. Note that in the case of a stereo track, each channel will have its own label, so if at one point both channels are clipped, two labels will appear above each other.

Note that unlike Show Clipping or Meter Toolbar, "Find Clipping" is not automatic, so after any editing that affects volume, or after import or recording of a new track, Find Clipping must be run again. Labels from another run of Find Clipping will be added to the existing label track - close the label track using the [X] on the left of the track if you want to view only labels for the current clipping.


Beat Finder...

Beat finder dialog

Beat Finder attempts to place labels at beats which are much louder than the surrounding audio. It's a fairly rough and ready tool, and won't necessarily work well on a typical modern pop music track with compressed dynamic range. If you don't get enough beats detected, try reducing the "Threshold Percentage" setting.

Regular interval labels...

Regular interval labels dialog

Places labels in a long track so as to divide it into smaller, equally sized segments. For example, this can be useful for distributing a large file on the internet. You can either choose the number of labels to be created, or the interval between them. Each label produced will contain the chosen label text prefixed by a number, starting with 0 for the first label. If choosing the option to make the final audio segment equal with others, this may slightly change your specified label interval.

After processing, File > Export Multiple... will export all the files in one process based on the label points.

Sample Analyze Nyquist Plug-in

This is an example of a Nyquist analyze plug-in (only available on Windows and OS X). All it does is put labels at the start and end of the selection. If you are interested in writing Nyquist analyze plug-ins, this provides a simple starting point. Open the "analyze.ny" file (found in the "Plug-ins" folder) in a text editor to see the Nyquist code. For more information on the Nyquist programming language and how to use it within Audacity, see Audacity and Nyquist and Nyquist in Audacity.

The following two effects "Silence Finder" and "Sound Finder" are related tools which are very useful to label the different songs or sections in a long recording, such as the tracks from an LP or cassette. The labels can contain the name of the album track or audio section, then File > Export Multiple... will export audio files in one process corresponding to each album track or section in the recording. See our tutorial Splitting a recording into separate tracks.

Silence Finder...

Gale: Image needs updating for modified wording in 1.3.11
Silence Finder dialog

Silence Finder divides a track up by placing point labels inside areas of silence. Use this if you just want to split the recording into tracks at a specific point without removing the silences between them.

If labels are produced in the middle of tracks, increase the silence level and duration. If some tracks don't have a label between them, reduce the silence level and duration. See Setting Parameters for more help choosing values to place the labels correctly.

Sound Finder...

Sound Finder dialog

Sound Finder divides a track up by placing region labels for areas of sound that are separated by silence. Use this to make the labels show the exact region of each track to be exported. This lets you remove some or all of the silence between the tracks.

If any tracks have more than one label, increase the silence level and duration. If any labels extend into other tracks, reduce the silence level and duration.

Vamp Analysis Plug-ins

You can also add some additional analysis tools in the Vamp plug-in format for viewing and analysing the descriptive contents of music audio files. Typical things that a Vamp plug-in might calculate include the locations of moments such as note onset times, visual representations of the audio such as histograms, or curve data such as power or fundamental frequency.

Vamp can process selected audio and produce a label track with particular parts annotated with labels, based on various criteria.

Currently Audacity cannot load Vamp plug-ins from the Audacity Plug-Ins folder. Vamp plug-ins are loaded from the standard directories defined by the Vamp SDK as follows:

  • On all platforms: any directories listed in the VAMP_PATH environment variable
  • additionally on Windows:
    • %%PROGRAMFILES%%\Vamp Plugins (a directory named "Vamp Plugins" within the system Program Files directory, however localized and on whatever drive is relevant to this install of Windows)
  • additionally on OS X:
    • ~/Library/Audio/Plug-Ins/Vamp (user plug-ins)
    • /Library/Audio/Plug-Ins/Vamp (system-wide plug-ins)
  • additionally on Linux/Unix:
    • $HOME/vamp
    • $HOME/.vamp
    • /usr/local/lib/vamp (user plug-ins)
    • /usr/lib/vamp (system-wide plug-ins)
Personal tools