Spectral Selection

From Audacity Development Manual
Revision as of 10:30, 29 January 2015 by PeterSampson (talk | contribs) (Spectral Editing: purged the two stale (text only) P1s)
Jump to: navigation, search
Bill 19Dec2014: I'm pretty much done with this page. Let's hear your comments. If you think something needs to be changed, please change it.
Spectral selection is used to make selections that include a frequency range as well as a time range on tracks in one of the spectrogram views. Spectral selection is used with special Spectral edit effects to make changes to the frequency content of the selected audio. Among other things Spectral selection and editing can be used for cleaning up unwanted sound, enhancing certain resonances, changing the quality of a voice or removing mouth sounds from voice work.

All of the time-based selection techniques (horizontal selection) are still available when doing spectral selection.

Contents

  1. Making a Spectral Selection
  2. Adjusting a Spectral Selection
  3. Toggling a Spectral Selection on or off
  4. Spectral Editing
  5. Example

Making a Spectral Selection

Gale 20Oct14: Do we need to be mention here that it is often best *not* to draw the selection in the waveform first? It's some way down the page before you find out how to preserve the time range when creating a frequency range.
  • Bill 11Dec2014: I think that's an added complication. People who find spectral selection useful will quickly figure it out. If you feel strongly about it please add a note or advice.

Here is a track with a few seconds of speech shown in waveform view:

Spectral 01.png

To define a time range change the track to spectrogram view, hover at a vertical position that you want to be the approximate center frequency to act on then click and drag a selection horizontally. A horizontal line appears beside the I-Beam mouse pointer that defines the center frequency.

Drag vertically (with or without continuing to drag horizontally) to define the bandwidth (range of frequencies) to be acted on. A "box" containing a combined frequency and time range is now drawn in a yellowish tint as shown below:

Spectral 02.png
The center frequency is proportionally in the center and is a geometric mean (which is appropriate for filtering purposes) rather than an arithmetic mean. Thus in the linear Spectrogram view as in the above screenshot, the center line will appear below the visual center of the frequency range, but will be visually centred in Spectrogram (log f) view.

A spectral selection may begin or end either at 0 Hz or at the maximum allowable frequency for the track (the Nyquist frequency), in which case no center frequency will be shown. In the illustration below the frequency selection goes from 0 Hz to about 5000 Hz:

Spectral 02a.png

Adjusting a Spectral Selection

Peter 20Oct14: Bill, do you think we need in the sentence below an image of the double-triangle cursor "... it changes to <image> to indicate ..."? Or do you fell that the image below is sufficient?
  • Gale 20Oct14. Made that change. Is the envelope icon photoshopped? It looks much smaller than on Windows.
  • Ed 20Oct14 : Audacity's image grabbing tool has the ability to capture the pointer; maybe we should include the pointer in these images where appropriate.
  • Bill 20Oct14:
    • Yes, the icon is photoshopped in. It looks the same as the actual Audacity window on my computer.
    • ATM Audacity's screen capture tool produces black PNGs for me
  • Bill 11Dec2014: New images with latest (yellow) highlighting. Cursors are now the Windows/Linux (larger) ones (but still photoshopped in).

Ed 19Dec14 : I think someone who knows more about this needs to expand on "center frequency will snap to frequency peaks".
Ed 19Dec14 : looking at the three images in this section I feel it might help if we had "before and after" images and that they would not need to be images of complete tracks.

When you hover the mouse pointer over the center frequency line it changes to a double triangle to show that the center frequency can be dragged. When you click and drag to move the center frequency and the current frequency range to a new position, the center frequency will snap to frequency peaks. To move the center frequency smoothly (without snapping to frequency peaks) hold down the SHIFT key then left click and drag.

Spectral 03.png
The bandwidth in octaves around the center frequency is preserved when dragging the center frequency. Therefore the frequency range will expand when dragging the center frequency to higher frequencies and will contract when dragging to lower frequencies, but in Spectrogram log(f) view the vertical height of the frequency/time box will remain constant.

To adjust the bandwidth of the selection hover the mouse over the upper or lower boundary until the pointer changes to a double triangle then left click and drag. This moves the upper and lower frequency boundaries so they remain equally spaced around the center frequency (thus not changing the center frequency).

Spectral 03a.png

To adjust the upper or lower boundary while holding the opposite boundary constant hold down the SHIFT key then hover the mouse near the upper or lower boundary until the pointer changes to a single triangle then click and drag (this will change the center frequency).

Spectral 03b.png
Bill 19Dec2014: ToDo-2 The following three paragraphs describe selection techniques but do not have images to go with them. Is this OK? Do they stand out enough?

When the lower boundary is at 0 Hz you can drag that boundary up by carefully hovering the mouse near the bottom of the track until the single down-arrow pointer appears then left clicking and dragging up.

When the upper boundary is at the Nyquist frequency of the track you can drag that boundary down by carefully hovering the mouse near the top of the track until the single up-arrow pointer appears then left clicking and dragging down.

You can use the Spectral Selection Toolbar to create and/or precisely adjust a spectral selection using the keyboard.


Toggling the Spectral Selection on and off

Press the Q key to change from a defined spectral selection (one that has at least the lower or upper boundary defined) to one where the lower boundary is 0 Hz and the upper boundary is the Nyquist frequency of the track. In this case there is no longer a spectral selection (all frequencies are selected which is the same as making a time selection in waveform view). Press the Q key to restore the previous upper and lower boundaries.

Spectral Editing

Gale 20Oct13: ToDo-1 My general impression of this section is that more explanation of the technicalities will be needed, especially what a shelf filter is and what rolloff is. Adding Glossary entries might be best. I am not seeing a strong enough message in the "note" at the top of this section that even the frequency based effects will apply to all the selection rather than only the selected frequencies.
  • Gale (later): More important perhaps, we should say when we would prefer to use the multi tool or the shelves instead, and when we might want to use spectral EQ. This may need a Tutorial or Wiki page but I think it must be touched on here. Also center frequency and bandwidth might need explaining.

Bill 11Dec2014: Perhaps we should create a page of each of these effect where we can go into more detail about things like bandwidth, shelf filters, band cut, band boost, notch filters, etc.

To make use of the frequency range defined in a spectral selection you will usually use one of the effects (listed below) whose name begins with "Spectral edit". Most other effects, as well as all the time-based editing commands (such as Cut, Copy, Delete or Trim) are available when there is a spectral selection but these effects and commands will not usually take into account the frequency range of the spectral selection. Currently, Noise Reduction is the only non-spectral-edit effect that takes into account the spectral selection.
Gale 27Oct14: Why do Spectral edit multi tool and shelves now insist on specifying the Low and High Frequency, showing a dialog to enter that, whereas as per below, this was not previously required?
  • Bill 10Dec2014: They no longer do.
    The dialog images need updating since they now include a Preview button.
  • Bill 11Dec2014: Please note changes in above note. At the moment the Noise Reduction effect knows about the spectral selection, so the note had to be changed.
Bill 19Dec2014: ToDo-2 The three spectral edit effects now have their own pages. That raises the issue of the duplication of information here, on the Effect Menu page, and on the individual effect pages.

Spectral edit multi tool

Depending on how the track is displayed and what spectral selection has been made, this effect will do one of the following:

  • When the track is not in spectrogram or spectrogram log(f) view an error message will be displayed.
  • When the spectral selection has a center frequency and an upper and lower boundary this effect performs as a notch filter with the center frequency defined by the center frequency of the spectral selection and the width defined by the upper and lower boundaries of the spectral selection.
  • When the spectral selection begins at 0 Hz this effect performs a high pass filter with a rolloff of 12 dB/octave and with the cutoff frequency defined by the upper boundary of the spectral selection.
  • When the spectral selection ends at the Nyquist frequency of the track this effect performs a low pass filter with a rolloff of 12 dB/octave and with the cutoff frequency defined by the lower boundary of the spectral selection.
  • When the spectral selection begins at zero Hz and ends at the Nyquist frequency the error message "Please select frequencies" will be displayed.

See the Spectral edit multi tool page for more information and examples.

Spectral edit parametric EQ

Spectral edit parametric EQ.png
Gale 27Oct14: ToDo-2 It should be made clearer IMO what a "band cut" and "band boost" are.
  • Bill 13Dec2014: Glossary entries added. Please remove ToDo if these are sufficient.

Depending on how the track is displayed and what spectral selection has been made, this effect will do one of the following:

  • When the track is not in spectrogram or spectrogram log(f) view an error message will be displayed.
  • When the spectral selection has a center frequency and an upper and lower boundary this effect performs a band cut or band boost according to the value entered in the "Gain (dB)" control. The center frequency is defined by the center frequency of the spectral selection, the bandwidth is defined by the upper and lower boundaries of the spectral selection.
  • When either the upper frequency boundary is at the Nyquist frequency or the lower frequency boundary is at 0 Hz an error message will be displayed.

See the Spectral edit parametric EQ page for more information and examples.

Spectral edit shelves

Gale: ToDo-2 Not stated what the "Gain" control does here.
Spectral edit shelves.png

Depending on how the track is displayed and what spectral selection has been made, this effect will do one of the following:

  • When the track is not in spectrogram or spectrogram log(f) view an error message will be displayed.
  • When the spectral selection begins at 0 Hz this effect applies a low frequency shelving filter with the half-gain frequency defined by the upper boundary of the spectral selection. The gain control sets the amount of low-frequency boost or cut. This is similar to adjusting the bass control on a stereo.
  • When the spectral selection ends at the Nyquist frequency of the track this effect applies a high frequency shelving filter with the half-gain frequency defined by the lower frequency of the spectral selection. The gain control sets the amount of high-frequency boost or cut. This is similar to adjusting the treble control on a stereo.
  • When the spectral selection has a center frequency and an upper and lower boundary, this effect performs as both low- and high-frequency shelving filters. In this case the half-gain frequency of the low-frequency shelving filter is defined by the lower boundary of the spectral selection and the half-gain frequency of the high-frequency shelving filter is defined by the upper boundary of the spectral selection. The gain control sets the amount of boost or cut applied between the lower and upper frequencies.
  • When the spectral selection begins at zero Hz and ends at the Nyquist frequency the error message "Please select frequencies" will be displayed.

See the Spectral edit shelves page for more information and examples.

Advice Due to a limitation in Nyquist effects the effect dialog will be displayed before any error message.

Example

For these examples the window size was set to 2048 in Spectrograms Preferences. This gives finer frequency resolution. See Spectrogram View for more details.

Here is the same audio as in the images above, but this time contaminated by an annoying high-frequency whistle. You can see the whistle just above 5 kHz.

SpectralEdit 01.png

Start by making a rough selection around the whistle:

SpectralEdit 02.png

Click and drag on the vertical scale to zoom in on the offending frequencies:

SpectralEdit 03.png

The center frequency line is close (but not exactly on) the whistle and the range of frequencies extends too far above and below the whistle:

SpectralEdit 03a.png

Snap the center frequency line to the whistle by hovering the mouse over the center line until the double triangle cursor appears, then click and drag to snap the center line to the whistle frequency:

SpectralEdit 04.png

Hover the mouse over the upper or lower boundary until the double-triangle cursor appears, then click and drag to adjust the bandwidth of the selection to just cover the whistle:

SpectralEdit 05.png

Finally, select Effect > Spectral edit multi-tool which performs a notch filter effect on the selected frequencies.

SpectralEdit 06.png
The whistle is gone.