Spectral Selection

From Audacity Development Manual
Revision as of 22:04, 16 January 2015 by Windinthew (talk | contribs) (Spectral edit shelves: Reply to Bill about definition of a shelf filter. It should have a Glossary entry I think)
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.

Bill 19Oct2014: Here's a start.

  • Peter 20Oct14: And a bloomin' good start Bill for what is (for me certainly) a fiercely complex "piece of kit". I've read this page several times now and I still only have a limited grasp of what's going on - down to the complex nature of the tools rather than your explanation Bill. I think you could do with a bit more in the intro note to explain just why you might need or want to use this for - the example is a good use-case, but that's right at the end when the reader may already have felt TLDR.
    1. I made a thorough spell check with Word
    2. I added divid anchors for the H2 sections
    3. I added a link in the intro to the spectral editing H2 section.
    4. Trying out a custom TOC so the user can see what the page covers - remove it if you don't like it.
  • Peter 20Oct14 later: Bill are you planning to provide full separate pages for the spectral editing commands? If not, then this page would probably need to be renamed "Spectral Selection and Editing" or even just "Spectral Editing".
  • Gale 21Oct14: I agree with Peter that more is needed in the intro on what type of audio and what type of glitches therein would benefit from only acting on a selected frequency range. The reason is to get finer control, correct? Also see Click removal using the Spectrogram view. When would one use that Tutorial rather than the tools here? Can you decide what tool to use by inspecting the glitches in Spectrogram View? If so what do you look for?
  • Bill 20Oct14:
    • The click tutorial uses spectrogram view to "see" the click, but does all the work in waveform view. The point of spectral editing is to do all the work in spectrogram view.
      • Gale 21Oct14: OK, though you could (with experience) do the work in spectrogram view there too, unless you actually heard a discontinuity after deleting the click.
        • Bill 21Oct14: I don't think you could do click repair in spectrogram view due to the time smearing inherent in that view.
    • Paul's video tutorial is worth watching and makes the case much better than I could.
      • Gale 21Oct14: But we have agreed not to link to that video, I think. The case needs to be made here and is as yet somewhat unclear to anyone coming new to this idea. Given the steep learning curve the case needs to be extremely clear, or users may not bother with it.
        • Bill 21Oct14: I agree that video as it stands is not appropriate as a tutorial - in it Paul is making a case for the feature, as much to the developers as to the users. If there was a video tutorial it would need to be a new one, done after the GUI and features have been finalized.
    • Paul has said (in one of the -devel threads) that he is using it to remove "mouth noises" from narration. I'd like to see how he does that.
      • Gale 21Oct14: +1. That should be the main use case, shouldn't it, rather than your "artificial" example? The files that contain the mouth noise should be available so that a Tutorial could be written.
    • My example, while somewhat artificial, is based on real experience with old cassette recordings of FM broadcasts that have "multiplex whistle" on them
    • In his video he removes a "clang" from behind his voice - quickly and effectively
    • It's hard to generalize, but I guess I'd say that any time you need to remove an extraneous sound, and the duration and frequency range of that sound can be identified in spectrogram view, then spectral editing is the way to deal with it
    • So the reason is not to get "finer control" but to have a better, faster, more effective work flow.
      • Gale 21Oct14: How is this faster than Paul L's De-clicker and De-esser or something else on an entire track? You know the complaints we get about using Repair on clicks one at a time. The case seems to me that this is "more effective".
    • Let's go to my example. How would I do this without spectral editing?
      • Make a selection then do Plot Spectrum, adjust the plot so I can see the whistle frequency (how do I do that? which controls do I adjust?), use the cursor and the peak display (assuming I've noticed it) to get the exact frequency and write that down, and hope I got the right peak
      • Select whole track and do Effect > Notch Filter; type in the frequency I wrote down and guess at the width factor I need.
      • Apply the effect, listen to the result, and undo and try again - the most likely mistake is to get the width factor too wide and damage the desired audio
        • Gale 21Oct14: I'm surprised that a normal steady noise like hum or whistle can't be picked out in Plot Spectrum. We imply elsewhere that it's easy - yes you may see multiple spikes but you probably want to deal with all of them anyway. So again I find the use case here unconvincing. Not your fault, but the most convincing use case should be presented on this page (I assume that "mouth noises" will be much harder to see in Plot Spectrum, if so that indeed makes the case).
          • Bill 12Oct14: One of the main points is that you don't have to Plot Spectrum, write down a number, do Notch Filter, and guess at the width. You don't have to call up any dialogs at all, and the notch parameters are set for you
    • With spectral editing:
      • Switch to spectrogram view; I can see the whistle right away
      • Drag a rectangle around the whistle, zoom in, refine the rectangle then do Effect > Spectral edit multi-tool; the center frequency and width of the notch are set from the display so I can be confident that I'm removing just the right frequency range
      • I can see right away that the whistle was removed and the desired audio was not appreciably damaged
  • Peter 21Oct14: Bill wrote: "Paul's video tutorial is worth watching and makes the case much better than I could." Having spent just over 32 minutes watching Paul's videos, and having learnt a lot from it, I agree with Bill here - but for most viewers that would be TLDV imo. Paul falls into the trap of many video tutorials by stating versions of Audacity and those inevitably drift out of date. Plus he includes his extended selection bar without really explaining that it is a non-standard (at this stage anyway) and some unnecessary side issues about Nyquist. It's hard enough keeping written tutorials up to date, but folk are very un-keen to keep maintaining video tutorials due to the work involved.

    Having seen Paul's videos I'm thinking that what we really need is a written tutorial based on the use case that he presented, it's fairly well scripted there - but it will be a lot of work and will end up being a long read. I am not averse to including a link to a video tutorial, or set of such, from Paul (he presents well and clearly) - but he would need to rework them once the functionality and GUI is finalized for a particular release (each time if it or the surrounding GUI environment changes).

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. Spectral Editing
  4. 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

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.
    • When you drag the centre frequency in log(f) mode, should the region stay the same height e.g. if the range is 100 Hz when at the bottom of the spectrogram is the range meant to be much greater when dragged to the top?
  • 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.
    • The bandwidth in terms of octaves around the center frequency is preserved when dragging the center frequency. So the box will get bigger vertically when dragging up in linear view and will stay the same size when dragging in log(f) view.
    • 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. 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

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.

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.

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

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: ToDo-1 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.
    ToDo-1 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 6 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 6 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 a rolloff of 6 dB/octave and 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 a rolloff of 6 dB/octave and 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 rolloff for both filters is 6 dB/octave. 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.