Discussion:
[SoX-devel] noisered vs Audacity's noise removal filter
Daniel Jensen
2012-10-26 19:21:08 UTC
Permalink
I find that Audacity's "Noise Removal" spectral noise gate filter gives
me much better results than SoX's noisered effect. However, since I have
over a thousand files requiring noise removal which could all use the
same noise profile, and since for that kind of a job Audacity's
rudimentary batch processing is tremendously inferior to using the
command line, I really wish I could use SoX.

The primary problem seems to be that SoX gives "tinkling" artifacts like
those in badly encoded mp3s. My preliminary guess was that this meant
that SoX is making the determination of whether frequencies are above or
below the profiled noise gate level independently for each FFT bin and
window, with the result that individual bins rapidly pop back and forth
across the threshold.

Glancing briefly at the noisered source (not enough to really tell what
it's doing) I see that ever since the initial checkin some barebones
attempt has been made to smooth out that decision, with the humorously
applicable comment "Audacity says this code will eliminate tinkle bells.
I have no idea what that means." I think this must mean that the code
was adapted from the method used by the old noise removal filter in
Audacity 1.0/1.2, without a lot of comprehension of what was going on.

At some point in their 1.3 beta cycle Audacity improved their noise
filter substantially by adding frequency smoothing and attack/decay time
and associated parameters. (Again, I haven't yet looked closely enough
to say how these are implemented.) In their wiki they say "if you set
both of the "smoothness" sliders to zero, you'll get something very
similar to the old noise removal algorithm in legacy Audacity 1.2.x
which is prone to artifacts and distortion..." Sure enough, setting both
the frequency smoothing range and the attack/decay time to zero gives
results basically identical to SoX's.

It would also be nice to have a more comprehensible scale. Audacity's
effect asks you to specify "noise reduction" in dB; this is much more
intuitive than noisered's 0-1 scale and does a decent job of allowing
you to match noise levels between different clips. (A sharp transition
where the background noise level suddenly changes can in many
circumstances be more of a problem than the noise itself).

Obviously since Audacity's filter is GPL'd while SoX's effects are
LGPL'd, code can't be shared. (Even if SoX decided that this could go
under the GPL, since Audacity's filter is in WxWidgets-heavy C++ this
wouldn't help much.) I know very little about how clean-room one has to
be in reimplementing their ideas to avoid the result becoming a
derivative work.

Thoughts?
Eric Wong
2012-10-27 18:17:14 UTC
Permalink
Post by Daniel Jensen
Obviously since Audacity's filter is GPL'd while SoX's effects are
LGPL'd, code can't be shared. (Even if SoX decided that this could go
under the GPL, since Audacity's filter is in WxWidgets-heavy C++ this
wouldn't help much.) I know very little about how clean-room one has to
be in reimplementing their ideas to avoid the result becoming a
derivative work.
I suggest writing a standalone LADSPA or lv2 plugin. This way the
filter can be useful to different programs.

I've also made patches which improve LADSPA support in SoX:
https://sourceforge.net/tracker/?func=detail&atid=310706&aid=3534109&group_id=10706

SoX doesn't have lv2 support, yet; but lv2file ought to fill the gap
nicely (though I haven't needed/tried lv2, yet)
Eric Wong
2014-12-30 11:42:49 UTC
Permalink
Post by Eric Wong
Post by Daniel Jensen
Obviously since Audacity's filter is GPL'd while SoX's effects are
LGPL'd, code can't be shared. (Even if SoX decided that this could go
under the GPL, since Audacity's filter is in WxWidgets-heavy C++ this
wouldn't help much.) I know very little about how clean-room one has to
be in reimplementing their ideas to avoid the result becoming a
derivative work.
I suggest writing a standalone LADSPA or lv2 plugin. This way the
filter can be useful to different programs.
Did you ever get around to doing this as a plugin? :)

Two years passed, I barely touched audio editing in that time,
but today I used noisered for the first time.

I have a recording made with excessively low levels
(around -30dB Pk, -57dB RMS); yikes.

So far, I've only found some quiet 100ms sections to make a noise
profile with (due to people moving/talking around me). At first, the
result was littered with nasty artifacts with the default noisered
"amount" parameter (0.5).

However, I found the results are pretty good with an "amount" value set
to zero. Using a >0 amount seems to introduce unpleasant artifacts.

I'll try to get a cleaner "silent" sample to noise profile with
(recording a new silent track may be necessary). Most of the noise I'm
trying to reduce is from my recording gear and mics. The blessing in
that is it ought to be easy to make a good profile track once I get
myself into a quiet room.

Hopefully I can avoid doing any more coding if I find a better sample to
noiseprof with, since the artifacts in my current work-in-progress track
are barely noticeable.

But if push comes to shove, I'll see if I can improve the sox
effect or port the Audacity one to LADSPA...
Post by Eric Wong
https://sourceforge.net/tracker/?func=detail&atid=310706&aid=3534109&group_id=10706
Applied in 14.4.2rc1 \o/

Loading...