NoiseRemoval.cpp

Audio software developers forum.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: NoiseRemoval.cpp

Post by steve » Sun Jul 27, 2014 5:03 pm

Most of my suggestions (along with the opinions of others) have been rolled into the documentation in the new 2.0.6 (alpha) manual: http://manual.audacityteam.org/man/Noise_Removal
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Paul L
Posts: 1788
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: NoiseRemoval.cpp

Post by Paul L » Sun Jul 27, 2014 5:31 pm

This is the first effect I have studied that follows this general procedure:

Apply FFT to windows of sound. (In this case 2048 samples stepped by 1024, and using a rectangular window function.)

Change frequency domain values.

Do inverse FFT.

Combine overlapping windows into a new signal. (Multiply each by a Hann window and then add.)

Paul L
Posts: 1788
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: NoiseRemoval.cpp

Post by Paul L » Sun Jul 27, 2014 5:44 pm

What are the advantages and disadvantages of variations in the above?

Why Hann and not just a simple triangular window? You want the sum of the weights of samples from different windows to be always 1. The triangular window would do that.

Is there any advantage in finer stepping than by half a width?

I wonder too what happens with shorter windows. Does that make more distortion in lower frequencies?

If you do this procedure with no change to the frequency domain values, how much change results in the signal? Is it a mathematical identity or not?

Nyquist gives me all the means to play with these ideas in Lisp.

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: NoiseRemoval.cpp

Post by steve » Sun Jul 27, 2014 6:36 pm

There's a proposal on the wiki that I think is worth reading: http://wiki.audacityteam.org/wiki/Propo ... se_Removal

I was particularly encouraged by the preliminary tests of "Spectral Subtraction" (the current effect is more like a "spectral gating" type effect). Though I don't think the current patch is correct - but probably worth looking at. I have used Spectral Subtraction in other software, and for certain types of material it can produce much better results than our current effect (though the current effect may perform better with other types of material, so this would want to be an "option").

Another idea that was put to me recently (not tested at all) was the idea of running multiple passes with different FFT sizes.
Q. How much does the unwanted "artefact" noise vary with FFT size? Would two passes with different FFT sizes result in less artefacts for a given amount of noise reduction than one pass?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Paul L
Posts: 1788
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: NoiseRemoval.cpp

Post by Paul L » Sun Jul 27, 2014 8:01 pm

steve wrote:What happens if you change it from 10 to 20?
...
What happens if you change it?
...
How would you explain that so that? [um, what?]
...
Does that work better?
Are you asking me all of this to quiz me, or because you don't know either and it's worth it to find out? :-)
steve wrote: Regarding the FFT window size, a larger window size can give (subjectively) better noise reduction with some material, so yes there is a case for making that an advanced control. On the other hand, many users already find this effect intimidating / too difficult and additional "advanced controls" would make that worse.
(I've not tested the 50 millisecond signal time)
In some programs you see something like an "Advanced options V" button which expands the dialog box if you click it and becomes "Advanced options ^". That's one way to cater to sophisticated users without intimidating most. Does this sort of thing occur in any Audacity dialogs?

Regarding the "isolate" button. The more I examine what it really does, the less sense it makes! I am browsing revisions of the file, and it appears the entire isolate feature was added in 11013 on March 22, 2011. That also added Sensitivity (which I find nothing wrong with), and changed how attack/decay was handled from something wrong to something less wrong but as I suspect, not quite right yet either.

Paul L
Posts: 1788
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: NoiseRemoval.cpp

Post by Paul L » Sun Jul 27, 2014 8:11 pm

... and it looks like revision 9298 not long before that made some major changes, INTRODUCING a bug in attack/decay, and also introducing the bug in handling the DC bin!

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: NoiseRemoval.cpp

Post by steve » Sun Jul 27, 2014 8:24 pm

Paul L wrote:Are you asking me all of this to quiz me, or because you don't know either and it's worth it to find out? :-)
I don't know the answer off the top of my head and it is rare that Audacity developers read topics on the forum. With your knowledge and experience of C++ you are probably in a better position than most to work out the answer.

If my question was: "I do not understand why division is by 10 not 20 when computing mOneBlockAttackDecay",
then to try and work out what was going on, I'd probably try changing it to see what happens. Similarly with the other points. In other words, I'm suggesting an approach to the question.
Paul L wrote:In some programs you see something like an "Advanced options V" button which expands the dialog box if you click it and becomes "Advanced options ^". That's one way to cater to sophisticated users without intimidating most. Does this sort of thing occur in any Audacity dialogs?
There has been one instance of something like that in the past, so it is possible using wxWidgets, but I don't think it is in the current code base. I don't recall exactly where or when, but I do recall how it was done. In order to "expand" the interface, the windows was destroyed, and a new "expanded" window created in its place.

An alternative approach that could be used would be to create a tabbed interface. I think there is an example in the wxWidgets "samples" folder.
Paul L wrote:Regarding the "isolate" button. The more I examine what it really does, the less sense it makes!
That does not surprise me. There's something a bit buggy in the behaviour of the "isolate" feature that I've noticed several times but have not found repeatable steps to reproduce the issue. "Sometimes" it does not switch correctly between remove / isolate.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Paul L
Posts: 1788
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: NoiseRemoval.cpp

Post by Paul L » Sun Jul 27, 2014 8:29 pm

... major changes by Dominic in 6047 introduced attack/decay and frequency smoothing to begin with, replacing some other frequency smoothing algorithm I haven't studied yet. Seems other cooks spoiled his broth later...

steve
Site Admin
Posts: 81609
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: NoiseRemoval.cpp

Post by steve » Sun Jul 27, 2014 8:32 pm

Paul L wrote:... and it looks like revision 9298 not long before that made some major changes, INTRODUCING a bug in attack/decay, and also introducing the bug in handling the DC bin!
In here :?
https://code.google.com/p/audacity/sour ... malize.cpp
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Paul L
Posts: 1788
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: NoiseRemoval.cpp

Post by Paul L » Sun Jul 27, 2014 8:38 pm

When I browse versions with Tortoise, the previous version in the trunk is 8591. I am still getting acquainted with the version control browsing.

Post Reply