Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Peak detector (is it good ??)

DSP related issues, mathematics, processing and techniques

Peak detector (is it good ??)

Postby Tepeix » Wed Nov 30, 2022 4:39 pm

Hi,
What do you think of this peak detector ??
I wanted one that could flash fastly, detect the transient, then stop fastly too.
Was struggling a lot to make it works like i want.
This is for overdrive/distortion that would affect more the transient.
Wanted also that one note or multiple notes does approximately the same think.
(one note would normally do less envelope)

I'd like the result for now but not sure if in some way it could be too much sensible, or do some bad think...
I already seen a little problem but with not so much disagreement : Sometime it would make a peak after some note, when there is no more signal; but that's not so much a problem to distort an inexistent signal.

Any advice to make it better or problem spotting ?
Attachments
Peakdd.png
Peakdd.png (61.11 KiB) Viewed 22364 times
Peak detector.fsm
(43.12 KiB) Downloaded 879 times
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Peak detector (is it good ??)

Postby Tepeix » Fri Dec 02, 2022 2:40 pm

I spot a little problem with bass..
When multiple bass notes are played the detector could continue to be up and down when we are no more on transient..
(Should have name this a transient detector more than a peak.)

I could make the release longer but not sure it's really what i want..
Separating bass and treble and treat them separately ? But this give more latency (even if it's a very little.)

I think about a cross detector that will adapt the release according to the frequency...
Attachments
TransientBass.png
TransientBass.png (64.46 KiB) Viewed 22308 times
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Peak detector (is it good ??)

Postby Tepeix » Mon Dec 05, 2022 3:06 pm

After day trying, i see more and more why this is difficult...

I really want to detect transient in the faster possible way. With no delay to the signal.
(I could use some and make the daw compensate..
But this is for overdrive, i'd like the idea that someone play it in real time,
also multiple filter might also be used that will add more latency... ...)

When only one note are played this is very easy.
The problem occur with multiple notes.
The resulting envelope will go up and down so much that it's hard to know if new note are done or not..
Also it's hard to know if we have a code that will works in any situation, what happens with other's waveform, dynamics, and more noise...

So the paradox of time come fastly in any direction..
If i separate the signal in band i get latency, but what happens to signal that are between the band ?
Image
Will some notes have more or less weight ??

But if not using band, it's difficult to have some setting that works well with treble and bass..

Also for the purpose of overdrive, it's really important that the detector do not oscillate when they are no transient.. Or we probably get some tremolo sound that ruin the realism..

So well it's very hard to get good result in any situation..

But finally, how an analog overdrive would do this ? Maybe it's not so much the new transient that are more affected but depending on the energy it will more overdrive when it have suddenly to produce more energy ?
Getting me to another direction...
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Peak detector (is it good ??)

Postby nmakinen » Tue Dec 06, 2022 8:26 pm

Hello,

I'm not sure I understand everything you're saying, but to me it seems that you might be overcomplicating the task. In my experience the best way to separate transients from the rest is by using a simple envelope follower. The parts in the input signal that are louder than the follower's output, are basically transients.

- Nikko
nmakinen
 
Posts: 5
Joined: Fri Oct 28, 2011 5:31 am

Re: Peak detector (is it good ??)

Postby Tepeix » Wed Dec 07, 2022 1:51 pm

Hum it's very possible that i overcomplicate.
But the problem i have with simple envelope is that with some setting,
fast treble notes will not trigger (when after another note), and multiple bass would be ok.
Or in a different setting, treble will trigger, but multiple bass would make the trigger on and off when there's no more transient.
I even try to make the envelope not going down for 8 cross zero cycle. But it doesn't change so much..
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Peak detector (is it good ??)

Postby Spogg » Thu Dec 15, 2022 11:31 am

I finally had a look at this and your example.

I’ve attached an envelope follower made by Martin Vicanek that I’ve used frequently when I needed such a thing.

Maybe you could use 2 of these set with different Window sizes then subtract the outputs to give a difference signal and amplify that. The difference would give the change of level corresponding to a transient.

As you point out though, this would not play well with chords, due to the addition and subtraction that happens when you mix 2 or more sounds at different frequencies.

You might be interested to look inside an old project of mine:

viewtopic.php?f=3&t=7698&p=32288&hilit=transient#p32288
Attachments
rms envelope follower by Martin Vicanek.fsm
3.06
(178.46 KiB) Downloaded 880 times
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Peak detector (is it good ??)

Postby Tepeix » Thu Dec 15, 2022 4:02 pm

Thanks, very interesting !

In fact i'm a very stupid cause i seen the envelope follower from Martin, but i notice there's a little latency, then i get the idea of some envelope that could have a very fast attack but in the end i finish with even more latency and another system !)
And now i also see that the latency is so much short that impossible to hear..

Like said Nmakinen, it's maybe not necessary to have 2 envelope, now i try to compare the original signal with the envelope, the signal is always a little louder but we could just multiply the envelope by a certain amount.
(Make me some time to understand this advice.)
..
I get some promising advancement, but as my typical problem working with flowstone, i get annother idea,
so i go to a very different region of dsp and let the project i work so much for later... Then maybe i forget some complexity of the project making hard to work again with... ...

But i hope i come back to this after finishing another code idea !)
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Peak detector (is it good ??)

Postby Spogg » Fri Dec 16, 2022 7:23 am

Oh dear! I forgot to attach the fsm. :oops:

Done now.
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Peak detector (is it good ??)

Postby Tepeix » Sat Dec 17, 2022 2:16 pm

Thanks, i found it but not sure i isolated it well.
I come back a little to the transient but would like to experiment more later.
Now i think about some way to separate the signal in multiple band to try avoid false trigger when a lot of note is played.. But this add more latency and not sure it's a good move..
Tepeix
 
Posts: 361
Joined: Sat Oct 16, 2021 3:11 pm

Re: Peak detector (is it good ??)

Postby Spogg » Sun Dec 18, 2022 8:20 am

Experimentation is a good thing and I learned a lot by doing just that. Even if you end up in a dead end the time isn’t wasted.

In my view it should be perfectly acceptable to offer a plugin as monophonic only (one note at a time). For example, pitch correction plugins are normally monophonic because to sort out a polyphonic signal is immensely difficult. I’m not convinced that band splitting would help, because the problem is worse when two or more pitches are close together so the combined signal will have higher peaks and a lower rate of interference. The side chain ripple would be less the further apart the notes are.
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England


Return to DSP

Who is online

Users browsing this forum: No registered users and 63 guests