Re: NoiseRemoval.cpp
Posted: Sun Sep 07, 2014 9:18 am
I've been testing the committed fix for this https://code.google.com/p/audacity/sour ... 23&r=13278 .Paul L wrote:Try this, to demonstrate that attack times are only half as long as they are supposed to be. (The particular numbers are not very important, we just need tone significantly louder than noise.)
New project. Generate 2 s of white noise, amplitude .5. View it in Waveform dB. Do Noise removal, Get Noise Profile.
Hit right arrow, generate tone, 440 Hz Sine wave amplitude .99, 2 seconds. Ctrl-f, ctrl-j, ctrl-a: Now tone follows noise in a single clip all of which is selected.
Now do noise removal with 48 dB reduction and 1 s attack/decay.
The envelope of the noise should drop from -6 to -54, and does nicely. It should rise in anticipation of the tone -- that is attack time. The rise in the envelope should be exponential, meaning a straight line in dB view, and that appears roughly so.
But the duration of this rise is about .5 seconds, not 1 second.
I have a question about how the decay and removal should work in noise after the tone in the above steps.
I am also getting weird behaviour (more or less reproducible) on Mac and Windows that seems to be not in 2.0.5.
So after Paul's steps on Mac (2.0.6-alpha), I undo application of Noise Removal and double-click the noise clip from 0s to 2s, Edit > Copy, K, then Edit > Paste.
Then CTRL + A and apply Noise Removal at the same settings by opening the effect. What should happen with the pasted noise after the tone? The noise is only brought down to about -20 dB and there is almost no fade down to that level. There is a short fade down of about 5 dB at the end of the pasted noise. What is the definition of decay?
Edit > Undo, double click the pasted noise and Effect > Repeat 10 times for noise of 22 seconds. CTRL + A, then apply Noise Removal at the same settings by opening the effect. The pasted/repeated noise is still at about -20 dB.
Edit > Undo then select from the right edge of the track to the right edge of the tone and apply Noise Removal at the same settings by opening the effect. There is now 1s of noise at -54 dB, 1s of fade in to about -20 dB, and then noise at -20 dB to the end.
In all cases the pasted or pasted/repeated noise after removal sounds much more phasey than the remaining noise before the tone.
Now I undid the Noise Removal and the Repeat and reapplied Noise Removal at the same settings by opening the effect. Same result. Now I Undo and Effect > Repeat Noise Removal. Same result. Now I undo and I see a white flash in the waveform in the clip between 8s and 10s (looks like envelope pointers) and the waveform does not change and I still see Edit > Undo Noise Removal.
Redo and Undo does not now undo the Noise Removal. Then I Effect > Repeat Noise Removal and Edit > Undo. The noise removal is undone and now I can undo the repeat. Still see the "white flash".
I then quit without saving as a project, but copied the AUTOSAVE file and the data before quit. I can't see an obvious problem with the AUTOSAVE file by looking at the contents.
I repeated all the steps but I used Effect > Repeat Noise Removal at each possible point instead of opening the effect. This time after Undo Noise Removal and Repeat Noise Removal a few times on the repeated noise, I changed to opening the effect to apply noise removal. Then I Edit > Undo Noise Removal and nothing happens until I Effect > Repeat Noise Removal then I can undo Noise Removal. I see no flashes this time.
I quit and reproduced the lockup of Undo in the above paragraph.
Quit and did the same steps except I stayed in Waveform View. Did not get the lockup of Undo.
Testing in 2.0.5, the not fully attenuated noise after the tone is also observed but there is a slightly greater fade of almost 0.5s down to -20 dB after the tone. I can't get the white flashes or locked undo.
On Windows I have tried the same steps several times in different sessions (each time after reboot). I have not seen the lockup of Undo yet, but in either Waveform or Waveform (dB) View, if after the Edit > Undo and Redo of Noise Removal on the repeated noise, I select all and apply Noise Removal from the effect, the entire track is brought down to -54 dB. It may take a few Undo and Redo's on the entire track, but it will happen. 2.0.5 does not do it. I can't reproduce this behaviour on Mac in 2.0.6.
Can't spend any more time on this now. Can Steve or Paul try this noise - tone - repeated noise setup?
Gale