The Spin auto-wah peak detector, part III
Last updated
Last updated
In our last episode we discovered that there is a slightly filtered (52.4 Hz) rectified audio signal which feeds a peak detector with about a 4 second decay time to go to 10% of the signal level.
I'm going to use the following WAV file I created in Audacity (220 Hz tone bursts) to provide a repeatable signal to see just what's happening.
When the Sensitivity pot is at zero, the output is 1.
When the Sensitivity pot is all the way up, at 1.0, each one of these signals has its log taken, but the slow one (the peak held signal) has 0.002 added to it first. 0.002 is about -54.0 dB. So if avg = 0.002 also, the adjusted lavg' will be 0.004. avg/lavg' = 0.5.
We saw that taking the exponent of the result of subtracting the log of lavg' from the log of avg gives avg/lavg'.
Here's a chart that shows the ratio going up really fast after avg reaches the threshold value 0.002. So 0.002 is the threshold level above which the trigger slams up really fast. Might be worth messing with that to see if it makes any sense to have it be adjustable. Or it might not. But this clearly warranted a better comment than "never let lavg go to zero".
So as avg is increasing (the front edge of a note) avg/lavg' gets closer and closer to 1.0 but never reaches it. It's a very fast non-clipping trigger. I also wonder as to how sensitive this is to real signals, as -50 something dB is pretty quiet. I'll have to look closer and try some things out.
What I can see, that makes this code so special, is that at minimum sensitivity , the output is 1. As you turn up the sensitivity, the output level starts to drop when there is no input. With the input signal above the magical threshold you get back to an output rapidly approaching 1.0. This means you can set your filter's top frequency (the "wah-to" frequency) rather than the base frequency of a from-zero envelope detector (the "wah-from" frequency).
The sensitivity sets the width of the sweep but we always end up at the same place. Certainly this is going to have a different sound than the "from-zero" envelope detector and most likely both have their place. In fact I'm tempted to use both of them at one time on two filters!
Here's a screen recording that shows me increasing the sensitivity with the pot2 slider. Note that the signal starts at 1 and goes down. Here I have added an output of the "exp" instruction, which I send to the right output. The input goes to the left output.
The next shot shows the filtered output just after that. Notice that it is quite a bit smoother than the raw signal in the first recording. There is some attack time on the front edges of the tone bursts now.