Перейти к основному содержанию

Удаление помех и шума

Удаление шума

Во время записи почти всегда присутствует шум. Хотя частотный спектр шума близок к так называемому "белому шуму" (равномерно распределенному по всем частотам), на практике это бывает не так - шум концентрируется на определенных частотах, которые можно вычесть из общего спектра.

В программе Audacity имеется достаточно мощный инструмент по удалению шума. Принцип его действия основан на том, что шум непрерывен, а в полезном сигнале есть паузы. Таким образом, нам нужно: 1. получить спектр шума в паузе и 2. вычесть его из общего спектра фонограммы.

Шаг 1. Получение модели шума.

Выделим участок в паузе (минимум 2048 выборок, т.е. 0.05 секунд при частоте сэмплирования 44100 Hz, а вообще - чем больше, тем лучше для точности статистики):

Откроем меню Эффекты -> Подавление шума...:

Откроется окно:

Жмем кнопку "Создать модель шума".

Шаг 2. Подавление шума.

Теперь выделим всю дорожку и снова откроем фильтр "Подавление шума".
Здесь можно указать три параметра фильтрации:

  • Noise Reduction (dB): степень подавления шума. Удаление шума затрагивает и "полезные" спектральные компоненты, поэтому, как правило, здесь необходим компромисс.
  • Sensitivity (чувствительность): не совсем понятный параметр ("как много аудио будет считаться шумом" - how much of the audio will be considered as noise), который устанавливается по шкале от 0 (off) до 24 (maximum) и также влияет на степень фильтрации. Большее значение будет означать, что больше шума будет удалено, однако, ценой потери и части "полезного" сигнала. Меньшее значение может привести к появлению артефактов*. Т.е. нужно найти наименьшее значение, при котором никаких артефактов не будет.
  • Frequency Smoothing (bands) (чвстотное сглаживание): при значениях от 1 и больше, этот параметр размывает шумоподавление на соответствующее число соседних спектральных полос. Это, с одной стороны, искажает полезный сигнал, однако, с другой - делает возможные артефакты более приемлемыми на слух. Иными словами, поскольку такое размывание делает сигнал менее "чистым" (clear), если возможно, лучше оставить этот параметр на нуле (off).
    Если при установке Sensitivity на максимально возможный (без уничтожения полезного сигнала) уровень, в обработанной фонограмме присутствуют артефакты, попробуйте установаить Frequency Smoothing на значения от 1 до 6. Ширина частотной полосы (в герцах) зависит от частоты сэмплирования трека: например, для 44100 Hz она равна 44100 / 2048 = 21.53 Hz.
    Временнóе сглаживание используется всегда (атака 20 миллисекунд и release 100 миллисекунд) и оно не настраивется. Частотное сглаживание применяется после временнóго.
    Значение по умолчанию - 3, меньшие значения, как правило, предпочтительны для музыки, а большие для речи.

Пункт "Шум" (Noise):

  • Reduce: выберите эту опцию, чтобы отфильтровать (удалить) шум.
  • Residue: выберите эту опцию, чтобы услышать то, что будет отфильтровано (удалено). Это полезно для нахождения оптимальных настроек, которые не испортят фонограмму - если слышны части полезного сигнала, вы указали слишком высокие значения Noise Reduction или Sensitivity.

Оригинальное руководство Audacity


* здесь - искажение сигнала, возникшее вследствие манипуляций с ним.

Способы удаления помех (щелчков и треска)

Audacity предоставляет различные способы удаления щелчков и треска из фонограмм. Даже поверхностный визуальный просмотр волноформы позволяет определить щелчки - они выглядят как выделяющиеся из общего уровня (вверх или вниз) очень тонкие (1-2 пиксела) пики. Основной инструмент удаления щелчков и треска в Audacity - эффект Click Removal. Щелчки, которые не получается удалить с помощью Click Removal, можно обработать индивидуально другими способами (хотя, конечно, индивидуальное удаление может быть эффективно только при сравнительно небольшом количестве помех):

  • Эффект Repair может восстанавливать короткие отрезки до 128 выборок длиной с использованием интерполяции.
  • Для трудноопределяемых помех можно попробовать Click removal using the Spectrogram view.
  • Для более длинных отрезков:
    • Silence Audio Заглушаемые отрезки должны быть достаточно короткими, чтобы не прерывать воспринимаемое на слух звучание фонограммы.
    • Draw Tool Принцип использования этого инструмента - вручную выровнять волноформу и таким образом ослабить помехи.

Эффект Click Removal

Сначала необходимо выделить область, к которой будет применен эффект. Это может быть целый трек или даже весь проект: меню Edit > Select > All или клавиатурное сокращение CTRL + A (CMD + A для Mac). Если помех много, возможно, более эффективно будет применять обработку к отдельным щелчкам или их группам, а не к целым трекам. Выделить часть трека можно мышкой или стрелками при нажатой клавише SHIFT. Однако, следует иметь в виду, что выделение только непосредственно области помехи не даст желаемого результата, необходимо расширить выделенную область, чтобы дать алгоритму достаточно данных (неповрежденной части фонограммы) для применения интерполяции.

Итак, вызовем Effect > Click Removal. Слайдер "Threshold" определяет чувствительность, т.е. степень отличия пика от обычного движения волноформы, при котором он интерпретируется как помеха. Слайдер "Spike Width" определяет длину пика по времени, при которой он считается помехой. Таким образом, если пик будет соответствовать обоим этим условиям, он будет ликвидирован с использованием интерполяции. Нажимаем "OK".
Менее заметные щелчки, чтобы избавиться от них, могут потребовать установить слайдер "Threshold" левее, однако, установка слишком низкого порога (Threshold) может удалить и много полезного сигнала.
Для удаления более продолжительных по времени помех, сдвинем слайдер "Spike Width" правее.

Перед тем, как применять эффукт к целому треку или всему проекту, удобно выбрать настройки, которые дадут наилучший результат, с помощью Preview.

Мягкие и легкие потрескивания, как от статического электричества, характерные для винила, с помощью Click Removal эффективно удалить не получится. Для этого лучше подойдет эффект Noise Reduction, найдите отрезок фонограммы, где нет ничего кроме этого шума, и примените эффект.

Подробнее.

Выделенная область для применения Click Removal должна быть больше 4096 сэмплов, это около 93 миллисекунд при частоте сэмплирования 44100 Hz.

 

Восстановление коротких отрезков

Audacity has a Repair effect which can be used to repair a short length of up to 128 samples long (for most audio, only a few thousandths of a second) by interpolating from the neighboring samples. You will need to zoom in to see the individual samples to use this effect.

Above this length, it becomes too hard to interpolate what should be going on in the section under repair. You will get an error message if you select too much audio to try and repair. In general, the shorter the section of audio you select to repair, the better the results will be.

The Repair effect is unusual because it requires there to be audio outside the selection region on at least one side of the section to be repaired. If the surrounding audio in the track is very short or non-existent there may not be enough information to make the interpolation, in which case an error message will be shown.

When using Repair it is often convenient to set Selection Toolbar bar to show hh:mm:ss + samples, then click the Length radio button to ensure you are only selecting up to 128 samples.

Silencing and Draw Tool

Sometimes an even better result can be obtained by zooming in to sample level and either silencing the click using Edit > Remove Special > Silence Audio (or the Ctrl + L shortcut), or using Draw Tool to smooth out the contours of the samples and so attenuate the click. Remember, the click will be visible as a "spike" in the waveform. Most discrete clicks up to 10 milliseconds long can actually be simply silenced or deleted without leaving an audible gap in the sound, although many clicks spread wider that that.

If the click is not suitable for silencing or deletion, enable Draw Tool by clicking the pencil icon Draw Tool button in the Tools Toolbar, or press F3 on your keyboard. The mouse pointer will change to a pencil while over the audio track. You must zoom in until you can see the individual sample dots before you can use Draw Tool.

Click in the track at the point you wish a sample to be redrawn to, and wait for the samples to be rejoined together. Alternatively, click in the area of track where the line of samples is not smooth and hold down ALT on your keyboard. The pointer will now change to a brush (or spray can on Linux).

Some patience may be needed with this tool, but the principle is to put samples back into line with their neighbors so that a smooth contour is presented.

Use Spectrogram view to identify clicks more easily

Click removal using the Spectrogram view is a workflow tutorial giving steps to remove hard-to-spot clicks using Audacity's Spectrogram view. In the default Waveform view, loud clicks often show up as easily seen spikes, but smaller, lower amplitude clicks can be very hard to find without zooming in to near sample level then scrolling the waveform to identify the exact location of the clicks. Considerable time can be saved by first using Spectrogram view which identifies clicky regions more readily.

Other techniques

Silencing highly zoomed areas or redrawing samples can get tedious even over a relatively short stretch of audio. Here are a few other tricks you can try if Click Removal did not help as much as you hoped.

Spectrum analysis

Analyse the area with Analyze > Plot Spectrum to see if any spikes are concentrated in particular frequencies and then use Effect > Equalization to reduce the volume of those frequencies.

You can do this more precisely with the Effect > Notch Filter.

Subtraction

Where the clicks sound equally loud in both left and right channels of a stereo recording (this often is not the case), but the music information in the channels is very different at that point, you can try to cancel out the click by making the affected section of track mono and inverting one of the channels:

  • First, select the area of track that has the click, then click in the track name by the downward-pointing arrow to open the Track Dropdown Menu (right). Choose choose Edit > Clip Boundaries > Split New. This moves the selected area into a new track underneath your original track.
  • Then click in the new track's in track name to open its Track Dropdown Menu and choose Split Stereo to Mono.
  • Now select one of the channels by clicking where it says "Mono". In the menus at the top, choose Effect > Invert.

When you export the result as a stereo track, the area you split out will be effectively mono (in the sense that the previous music signal in the left and right channels will be mixed into both channels), but the click should be sharply attenuated without harming the music too much.

Repair of broader clicks

Click Removal may not work well with broader clicks of 10 milliseconds or longer. Here are two Nyquist plug-ins you can try. Installation instructions for Nyquist plug-ins are here:

  • PopMute: heavily attenuates loud clicks and pops (and even hand claps or small bangs) to make them less obtrusive.
  • EZ-Patch: really loud and wide glitches may still sound too bad even if moderated with "Pop Mute". In that case, try "EZ-Patch" which lets you repair the damage by selecting the glitch together with some undamaged audio on one side of the glitch, then smoothly replaces the glitch with the undamaged part of the selection.

Alternative software

It is also possible to use other software than Audacity for click removal, while still using Audacity for the other editing tasks and to produce the final master. Export your audio track from Audacity as a lossless WAV or AIFF file, and also save the click-removed audio as a WAV or AIFF for import back into Audacity.

  • GoldWave: Though nominally not free it is a top class, free trial click remover as well as an excellent alternative audio editor. Its click removal is an effect, just like in Audacity, and there is a "Smoother" effect for broad unwanted noises and an excellent "Noise Reduction" effect for steady noise. The trial version limits you to a hundred or so commands per session, and a total number of several thousand commands before it expires, but if you export from Audacity as 32-bit WAV and just do Click Removal in it, you should be able to declick several hundred records for free.
  • Gnome Wave Cleaner: Only for Linux users. Digital restoration of CD-quality audio files. Dehiss, declick and decrackle in a GUI environment. It can also automatically mark song boundaries if required.
  • ClickRepair: An excellent tool for removing clicks and pops is Brian Davies' ClickRepair. Some new users may find it a bit intimidating as an entry level tool but, once you have understood the settings you want to use, it is effectively an automated tool. It requires Java and is not free, but many users report that it saves a lot of time and produces good results.
You may find the default settings for this application remove a little too much signal. An alternative recommendation:
  • DeClick = 30 (default is 50)
  • Pitch Protection = "on" (default is "off") though leave this "off" for brass recordings
  • Reverse = "on" (there is no processing penalty for this and it helps on percussive music)
  • Method = Wavelet

 

Оригинальное руководство Audacity