Does it matter? [Length of sample in noise reduction]

Post your questions & get help from friendly LibriVoxers
Post Reply
KevinS
Posts: 11237
Joined: April 7th, 2019, 8:32 am
Contact:

Post by KevinS » April 21st, 2021, 8:03 am

In keeping with the tradition of 'How many angels can dance on top of a pin...'


In selecting a portion of a recording for running the noise reduction effect in Audacity, does it matter how long of a selection is made? That is, when cleaning out the ambient noise of your machinery and room, should one highlight 1, 2, 5, etc. seconds of 'hiss' as an ideal?

I often selected a full 5 or 6 sections, which seems to work for me and I include a 'click' or two in the selection. I wonder if this is the best practice.

N.B. I'm putting this in the Off-Topic thread as I suspect that the answer from most will be that 'it doesn't really matter.'

lurcherlover
Posts: 1002
Joined: November 10th, 2016, 3:54 am
Location: LONDON UK

Post by lurcherlover » April 21st, 2021, 9:00 am

It doesn't matter too much but 5 secs is better than 1 sec - possibly ... On the other hand I rarely or never use noise cleaning. I don't have any hiss problems or noisy machinery, just damned aeroplanes occasionally - but much less now in these quieter times of the pandemic.

TriciaG
LibriVox Admin Team
Posts: 50496
Joined: June 15th, 2008, 10:30 pm
Location: Toronto, ON (but Minnesotan to age 32)

Post by TriciaG » April 21st, 2021, 9:03 am

I choose a portion that has the most "normal" noise: no breaths or clicks in it, and usually about 2-3 seconds' worth.

*shrug*
Bulwer-Lytton novel: The Caxtons
New York scenes, 1897: Darkness and Daylight
Boring works 30-70 minutes long: Insomnia Collection 5

DACSoft
Posts: 1469
Joined: August 17th, 2013, 8:51 am
Location: Connecticut, US

Post by DACSoft » April 21st, 2021, 9:29 am

At the end of my recordings, I usually let it run for about 7-10 seconds of ambient noise (like Tricia - no clicks, breathing, movement, etc.). Then I use about a 5-6 second slice of it for noise reduction. Works for me since I'll need some ending silence anyway; I don't like pure "dead" silence. :)

I guess it only matters how long a sample, if one finds a noticeable difference in the end result testing various lengths.
Don (DACSoft)
Bringing the Baseball Joe series to audio!

In Progress:
Baseball Joe in the Big League; Whispering Tongues; The Story My Doggie Told to Me
Next up:
Baseball Joe on the Giants; The Arrival of Jimpson

schrm
Posts: 3544
Joined: February 10th, 2018, 11:02 am
Location: Austria

Post by schrm » April 21st, 2021, 9:37 am

my long recordings have these strange..
differences in the sound quality and background noise.
sometimes, i copy several pauses from dfferent sections.
and sometimes i try to use the orginal silence parts i used for nr as an additional round of nr for copypasting words or sentences into the recording. which does some wonders, sometimes.

what i understood is: nr filters a sort of frequency (= hiss? = fan noises or street sound or...) and therefore, since editing your voice is possible with that too...

generally speaking, i use the 5-8 seconds of silence at the end at minimum.
and i know, that different silence parts of different parts of the recording have an effect. also, you can take different recordings and try to blend them into the recording, "better"? when using the noise reduction silence seconds of the raw recording version of the original recording (which i keep) for editing mistakes. (as a second nr or as a single nr round)

but if this is voodoo magic and autosuggestion i don't know...
cheers
wolfi
reader/12275

en: lay down your arms
de: sammlung prosa, das geschlecht der zukunft, hoffmann: sommerfrische, ostseemärchen
dpl: hoffmann*2
solo: na prost!

Penumbra
Posts: 1223
Joined: May 10th, 2016, 6:16 pm

Post by Penumbra » April 21st, 2021, 11:49 am

I understand that the way it works is audacity lowers the amplitudes of the frequencies in your selected noise profile wherever those amplitudes are already as low as what is in the profile. So you want the profile to be a representative sample of the noise, but it doesn't help to have more than a representative sample. In my experience a second or so is plenty. Longer profile lengths won't hurt, but also won't help, provided the noise is uniform across the sample. If it isn't uniform in amplitude, audacity will use the average amplitude for each frequency in the sample as the cutoff for that frequency. If it isn't uniform in frequency, then a longer sample will include more frequencies.

Having said all that, I confess that this is a simplification. The algorithm they use actually works in frequency bands and not individual frequencies, and there are sensitivity and frequency smoothing settings that affect behavior, but the principle is the same.

Including spikes in the profile is probably not a good idea. Spikes are often high frequency bursts that are not really noise in the sense used by the function. Including them in the noise profile can lead to distortion (although if the spikes aren't very large you won't notice it).
Tom Penn

GrayHouse
Posts: 511
Joined: October 6th, 2012, 3:27 pm

Post by GrayHouse » April 22nd, 2021, 10:24 am

I've done some work on noise removal techniques so I may have some insight on the matter.

Putting it simply: you get better noise removal (fewer noise artefacts) if you use a longer noise sample. Here's a brief explanation of the technical reasons.

The Noise Reduction effect works by building a spectral profile of the noise sample and then attenuating the parts of the original audio which fall below the noise threshold in each frequency band. It's a process called 'spectral gating'. So the effectiveness of the noise removal rests heavily on the accuracy of the noise profile.

So we need to answer the question: what length of noise sample should one use in order to build an accurate spectral profile?

Here are some images of spectral profiles made from different lengths of artificial noise. I created the profiles using exactly the same method as the Noise Reduction effect. These are pure white noise so the spectrum should appear flat.

You can see that the one-second profile (top chart) is quite uneven - there's a peak-to-trough variation of 3 or 4 dB. In contrast, the 10-second profile (lower chart) is much closer to the flat spectrum that we should see. That's not surprising. The 10-second sample contains much more data. As with all sampling, the accuracy increases with the sample size.

In the case of the one-second sample, the errors are quite large in relation to the amount of noise being removed by most people. Those errors cause the signal and noise to be wrongly classified. It's the main cause of the noise removal artefacts you sometimes hear.

Obviously you could go beyond 10 seconds if you wanted, but the improvements become marginal.

This applies more to 16-bit audio, but regardless of the bit-depth you use, a longer noise sample is always better.

The main conclusion here is that using a longer noise sample gives better noise discrimination, especially if you're removing high levels of noise. Other tests that I've done seem to confirm that longer noise samples give audibly better results.

My advice would be:
- Use noise removal sparingly.
- Use around 10 seconds of noise - it's no effort to record some extra noise during your session - just keep still and don't breathe near the mic.
- As others have said, the noise sample must be only the noise that's constant throughout the recording - don't be tempted to add any of the intermittent noises.

KevinS
Posts: 11237
Joined: April 7th, 2019, 8:32 am
Contact:

Post by KevinS » April 22nd, 2021, 10:28 am

This is all far more informative than I could ever expect. Thank you all!

lurcherlover
Posts: 1002
Joined: November 10th, 2016, 3:54 am
Location: LONDON UK

Post by lurcherlover » April 22nd, 2021, 12:19 pm

The post by GrayHouse is also what I would have expected and it makes sense. The spectral images really show how much better the 10 seconds sample is. So for people using noise cleaning this is worth knowing.

Penumbra
Posts: 1223
Joined: May 10th, 2016, 6:16 pm

Post by Penumbra » April 22nd, 2021, 2:04 pm

You can see that the one-second profile (top chart) is quite uneven - there's a peak-to-trough variation of 3 or 4 dB. In contrast, the 10-second profile (lower chart) is much closer to the flat spectrum that we should see. That's not surprising. The 10-second sample contains much more data. As with all sampling, the accuracy increases with the sample size.
Well, the devil is certainly in the details. I waved aside as not important the FFT sample size that the Audacity algorithm uses, and it actually makes a big difference. We can't control that, so I agree that a longer profile is useful provided it omits transients.
Tom Penn

GrayHouse
Posts: 511
Joined: October 6th, 2012, 3:27 pm

Post by GrayHouse » April 22nd, 2021, 3:19 pm

Penumbra wrote:
April 22nd, 2021, 2:04 pm

Well, the devil is certainly in the details. I waved aside as not important the FFT sample size that the Audacity algorithm uses, and it actually makes a big difference. We can't control that, so I agree that a longer profile is useful provided it omits transients.
I certainly learned a lot when I was trying to figure out the details of how it all works. And the DSP stuff is often unintuitive which doesn't help.

I think my results also explain some other things. There's a piece of Librivox folk wisdom which says that doing two shallow passes of noise removal (using different noise samples) is better than doing one deep pass. That appears to be true. The reason seems to be that, if you're lucky, the errors on the second pass fall in different parts of the spectrum so any artefacts are less noticeable. Obviously using a longer noise sample should give even better results, but it's satisfying when the theory and the practice agree.

TriciaG
LibriVox Admin Team
Posts: 50496
Joined: June 15th, 2008, 10:30 pm
Location: Toronto, ON (but Minnesotan to age 32)

Post by TriciaG » April 22nd, 2021, 3:51 pm

I'm going to move this thread to another forum, as I think it's info people will find interesting and useful. :)
Bulwer-Lytton novel: The Caxtons
New York scenes, 1897: Darkness and Daylight
Boring works 30-70 minutes long: Insomnia Collection 5

Post Reply