Please help with de-sser.

Share your Audacity/Nyquist plug-ins here, or test drive the latest plug-ins submitted by Audacity users.

After testing a plug-in from this forum, please post feedback for the plug-in author.

Please help with de-sser.

Permanent link to this post Posted by Felipe Zanabria » Fri Mar 16, 2018 6:59 pm

Today I send you a very useful plugin for music producers and announcers. It is the De-sser, an effect to reduce the sivilances in the voice, mainly when increasing treble to the audio.
De-sser.ny
(2.28 KiB) Downloaded 6 times

It has the following controls:
Listen: processed sound or removed parts (default processed sound), this switches between listening to the effect applied to the audio or the frequencies that will be attenuated.
Frequencies above: 5000 to 12000 (default 6000) controls the frequencies that will be affected.
Threshold: 0 to -24 db, (default -10 db) controls the noise threshold that will be attenuated. The higher the value of this control, the less audio will be taken, the lower the value, the more autio will be taken.
Mute Level: 0 to -100 db (default -6 db) controls how much the detected audio will be attenuated.
Look ahead: 1 to 100 ms (default 16 ms) controls how fast the sound dims.
Release time: 1 to 1000 ms (default 20 ms) controls how fast the sound returns to normal after passing the sivilance.
Note:
Use the removed parts option to listen to how much audio is attenuated, while adjusting the threshold and cutoff frequency. In general, Aehad look and release times work well in most cases. Set the Mute Level to a value that the sivilances sound balanced compared to the rest of the audio.
In this plug-in I have used a high-pass filter to filter high frequencies, and I have almost good results.
How can I use eq-band or eq-highshelf to do my de-sser?
Can I implement a simpler code than the de-sser already published in the forum?
Greetings.
Felipe Zanabria
 
Posts: 7
Joined: Fri Mar 16, 2018 1:38 am
Operating System: Windows 7

Re: Please help with de-sser.

Permanent link to this post Posted by Trebor » Sat Mar 17, 2018 5:21 am

Felipe Zanabria wrote: De-sser.ny (2.28 KiB)

When it reduces frequencies above specified value, (4kHz-12kHz),
it is also increasing the frequencies between ~1kHz & the specified value ...

Felipe Zanabria's De-esser plugin.gif
Oddly frequencies between 1kHz & 6kHz are being increased, (they should be untouched by the De-esser)
Felipe Zanabria's De-esser plugin.gif (423.41 KiB) Viewed 183 times

That increase doesn't seem right to me.
Trebor
 
Posts: 4343
Joined: Sat Dec 27, 2008 5:22 pm
Operating System: Windows Vista

Re: Please help with de-sser.

Permanent link to this post Posted by Felipe Zanabria » Sat Mar 17, 2018 7:19 am

Trebor wrote:When it reduces frequencies above specified value, (4kHz-12kHz),
it is also increasing the frequencies between ~1kHz & the specified value ...

That increase doesn't seem right to me.


Maybe it happens because I put this code in the plug-in for an experiment.
Code: Select all
(setq freq (/ freq 1.6))

Another reason may be because I am using the high and low pass filters, these change the sound a bit apart from cutting at a given frequency.
Below I leave the file without this line.
De-sser changed.ny
(2.25 KiB) Downloaded 3 times

Remember, I want to use eq-band or eq-highshelf instead of this:
Code: Select all
; Applying the de-sser:
          (case apply
(0 (diff (lowpass2 * track * freq) (multichan-expand # 'de-sser (highpass2 * track * freq))))
(1 (SUM (MULT (highpass2 * track * freq) -1)
(multichan-expand # 'de-sser (highpass2 * track * freq)))))
)))

The function that controls the volume is already defined in the plug-in.
regards
Felipe Zanabria
 
Posts: 7
Joined: Fri Mar 16, 2018 1:38 am
Operating System: Windows 7

Re: Please help with de-sser.

Permanent link to this post Posted by steve » Sun Mar 18, 2018 7:00 pm

Some comments from going through your code:
  • You don't need to wrap the main part of the script in a "progn" block.
  • You don't need to check that user values are within the ranges specified by the controls as slider controls are validated by default to disallow out of range values.
  • You probably don't want to scale the frequency by 1.6. The filter "corner" frequency of the Nyquist high-pass and low-pass filters is the -3dB cut-off point. For shelf filters, the specified frequency is the half-gain frequency. I'd suggest not scaling the frequency so that the frequency that the user selects is the frequency that the effect uses.
  • You should check that the filter frequency is not too high so as to avoid bad things happening if the track has a low sample rate.
  • Your "de-sser" function is actually an "inverted gate" function. Better to give it a name that accurately indicates what it is.
  • For effective de-essing, you will probably need to set the filter frequency lower than 4000 Hz. I'd suggest a range starting at around 1800 Hz up to around 8000 Hz.
  • The release time should probably be a bit longer than the default so as to avoid "flutter" when the signal level is close to the threshold level.
  • You could use integer controls as fractional values are not really required.

I don't think your algorithm is correct at the end of the program.
I think what you intend is that for the "processed sound" to be composed of the sum of non-gated low frequencies, plus gated high frequencies.

The built-in Nyquist filters are pretty close to "ideal" Butterworth filters, but summing a low-passed and high-passed signal does not precisely reconstruct the full frequency band because of phase shifts through the filter. Rather than writing the low-pass filter as (lowpass2 signal Hz), it would be better to write it as (diff signal (highpass2 signal Hz)). This will ensure that below the gate threshold, the two signal paths combine to precisely reconstruct the full frequency range. This technique also has the benefit that if you use a different type of filter (for example a shelf filter or a band filter), that the pass-band signal will still be complimentary to the gated signal (they will still sum to the original signal below the threshold).

The attached file has the changes listed above:
deesser.ny
(1.68 KiB) Downloaded 9 times


However, I think this could be improved further. Currently, the effect cuts in and out as an all or nothing effect, which tends to draw attention to the effect as the signal crosses the threshold. This can be mitigated by using a slower attack / release, but possibly a better approach would be to make the effect more "progressive", so that the high frequencies are attenuated proportionally to how far above the threshold they are. To do that you would need to modify the amplitude follower (the "inverse-gate" function).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 46554
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Please help with de-sser.

Permanent link to this post Posted by Felipe Zanabria » Mon Mar 19, 2018 3:30 am

Thanks Steve, you are a genius. :)
The effect improved a lot.
With my code the audio is amplified a little and now it is diminished, but I know that it is because of the sivilances and I can amplify later.
Yes, it is a reverse gate. I am not an expert in Nyquist and I could not find ways to do this, until I remembered that the Audacity wiki is the one that I have based on.
steve wrote:
  • You do not need to check that user values are within the ranges specified by the controls as slider controls are validated by default to disallow out of range values.

I think this plug-in was made before audacity put limits on controls in Nyquist. I was more interested in the effect and I did not make many changes. What I did was remove the help screen and put in a new code.
I do not understand much how I can do what I said below.
To do that you would need to modify the amplitude follower (the "inverse-gate" function).
Felipe Zanabria
 
Posts: 7
Joined: Fri Mar 16, 2018 1:38 am
Operating System: Windows 7

Re: Please help with de-sser.

Permanent link to this post Posted by Felipe Zanabria » Fri Mar 23, 2018 2:41 pm

Hello Steve, I was trying the plugin and I have some concerns.
The cut filter does not reduce the s or sh much. To see it closely I tried the simple difference of the sound and the filter to see how accurate it is.
Code: Select all
(diff *track* (highpass2 *track* 2500))

This means that high frequencies should be reduced completely.
I try to increase the value of q, but it has a lot of resonance.
One effect that has the filter well defined and without recognition is the Tonman de-sser.
Can I approach this effect with the Nyquist filters?
Thank you
Felipe Zanabria
 
Posts: 7
Joined: Fri Mar 16, 2018 1:38 am
Operating System: Windows 7

Re: Please help with de-sser.

Permanent link to this post Posted by steve » Fri Mar 23, 2018 3:37 pm

If you want a wider notch, decrease the Q.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 46554
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Please help with de-sser.

Permanent link to this post Posted by Felipe Zanabria » Fri Mar 23, 2018 5:23 pm

steve wrote:If you want a wider notch, decrease the Q.
I do not want that, rather I want the frequency cut to be more aggressive. For example, when I want to attenuate 3 db per octave, I want more attenuation, it's like the filter is of more poles like highpass4, highpass6 or highpass8.
I have tried to make a difference with these with the original sound but it does not work.
Below I leave an mp3 with what I want to get.
The first sound is using highpass2, and the second one using highpass8, which I'm going to replace with lowpass8 since I can not make the difference with the sound.
Sound test.mp3
(185.35 KiB) Downloaded 4 times

Try to do:
Code: Select all
(diff *track* (highpass8 *track* 2000))
It does not work.
I understand that this is complicated because there are 4 filters in a loop.
Felipe Zanabria
 
Posts: 7
Joined: Fri Mar 16, 2018 1:38 am
Operating System: Windows 7

Re: Please help with de-sser.

Permanent link to this post Posted by steve » Sun Mar 25, 2018 8:39 pm

I don't think that this is really a good approach for making a de-esser.

Certainly you need some sort of envelope follower to track the amplitude, and you need to use that to modify the gain of the "S" frequency band, but using a "gate" type control will abruptly switch the effect on / off, which I would not expect to work well.

The way I would approach this would be to create an amplitude follower using "snd-avg" (http://www.audacity-forum.de/download/e ... l#index494) This is a little bit tricky because you need the envelope to precisely match the timing of peaks in the audio and "snd-avg" is always looking ahead to the next block of samples. To get synchronization it will be necessary to offset the envelope by the length of "blocksize".

Then I would clip the envelope so that only those parts above the threshold remain, and scale the envelope to a range equivalent to the amount of attenuation required.

The envelope can then be used as a control signal for "eq-band" (http://www.audacity-forum.de/download/e ... l#index351).

This is actually quite an ambitious project.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 46554
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Please help with de-sser.

Permanent link to this post Posted by Trebor » Sun Mar 25, 2018 11:17 pm

A simple de-essing strategy is to band-pass the sibilant frequencies, invert their waveform, then mix them back with the original audio.
Assuming the original & band-passed waveforms remain in-phase, then when inverted they will be in anti-phase and will attenuate any excessive sibilance.

No envelope-followers necessary.
Trebor
 
Posts: 4343
Joined: Sat Dec 27, 2008 5:22 pm
Operating System: Windows Vista

Next

Return to New Plug-Ins



Who is online

Users browsing this forum: No registered users and 2 guests