admin: First posted on 2017 02 22
How do you design a digital wah wah? You take a peak filter and move it down and up the frequency spectrum. From where to where? I do not know. How fast? I do not know.
This simple explanation of the wah wah mechanics is too simple. It confuses me. I can think of at least ten different parameters that can change in this design. Which ones are important? I am not sure. I included all.
Wah wah mechanics
A peak filter lets a narrow band of frequencies through, but stops all other frequencies. During the wah wah cycle, this filter moves down and up the frequency spectrum. Its output is mixed with the original signal.
In the start of the wah wah, the peak filter will allow a narrow band of high frequencies. As the wah wah progresses, the peak filter shifts down the frequency spectrum gradually, but probably quickly. It lets through mid and then low frequencies, rather than the high ones.
The wah wah then starts with a boost in some high frequencies that gradually becomes a boost in mid and then low frequencies. And then backwards.
Potential wah wah parameters
I tested them all.
For tempo and timing:
- The time it takes the filter to move down the frequency spectrum (i.e., the time to move a wah wah pedal down). Call this the wah wah "attack". In retrospect, the attack was not that important. I could have just fixed it at around 100 ms.
- The time the filter spends at the bottom. Call it "sustain down". This was useful, as it separated the attack from the release.
- The time it takes the filter to move up. Call this "release". As with the attack, not that useful.
- The time the filter spends at the top of the frequency spectrum (i.e., the wah wah pedal is not pressed). Call it "sustain up". Similar to the "sustain down", this parameter made a difference to the sound.
- A shift in the wah wah cycle forward or back in time. This was just practical. There must be a way to adjust the wah wah for the start of the recording independent of the song tempo. I called this "offset".
I ran a wah wah on an acoustic guitar track with a tempo of 70 beats per minute (850 milliseconds per beat). The attack, sustain down, release, and sustain up ended at about 100 ms, 300 ms, 100 ms, 350 ms.
If I was to fix the attack and release to 100 ms or so and make the two sustains even, I could just have one parameter: the wah wah "total time" or "rate".
With respect to the filter sweep across the frequency spectrum:
- The frequency where the filter starts its traversal through the spectrum. Call it "top cutoff". It made no sense to always start at the top (say, with 20 kHz). It seemed like a waste. Nothing audible happens in the wah wah itself there and it forces a quick move of the filter down, depending on the attack. This made the wah wah unnatural. It made sense to start somewhere at the top of the instrument range (maybe 2 kHz instead).
- The frequency where the filter stops its traversal through the spectrum – "bottom cutoff". Too much bottom made the wah wah muddier. Somewhere between 200 Hz and 500 Hz worked better.
For the filter itself:
- It was not clear to me why a peak filter and not a wider band pass filter. I called the width of the filter pass band "filter width". It seems to me that a wah wah is more noticeable on the acoustic guitar with a filter width of 300 Hz.
- If the filter does not start at the top of the frequency spectrum, does it just appear out of nowhere or does it bubble up slowly? I called this "filter attack". The filter attack (the time of the filter to reach its gain) was different from the attack above (the time of the filter to move down the frequency spectrum). The filter attack proved useless. For the most part, any positive filter attack made the wah wah less audible.
- Same with "filter release". Any positive amount of time used to make the filter disappear was not very useful.
- Does the stop band attenuation of the band pass filter matter? Not so much, as it turns out. I called this "filter depth", but this parameter also proved useless. The wah wah was audible mostly with good stop band attenuation (-60 dB up to -40 dB).
- Any "additional gain" on the filter itself? This made a difference to the sound, but I found the additional gain on the filter itself to be annoying.
Actual wah wah parameters
I kept the breakdown of the wah wah time or rate: attack, sustain down, release, sustain up. I also kept the offset, top and bottom cutoff frequencies, and the filter width.
A rate, a cutoff (top), and a depth (between the top and bottom) seem to be the standard. The offset is just to help the software to follow the tempo of the song. The filter width may also end up fixed.
I could stop here. I have spent a few days on this and seem to be reinventing the wheel.
But wait, there is more…
Not that a user will care, but the construction of the digital wah wah itself is tricky. You cannot just constantly adjust a peak filter to move it gradually up and down the frequency spectrum. If the filter is an infinite impulse response (IIR) one, it will be unstable – the wah wah sound will explode into noise. If the filter is a finite impulse response (FIR) one, constantly computing its coefficients will be slow.
We must work on pieces of the signal with some overlap and crossfade the result. There must be a "frame" size to control the size of these pieces. Larger frames are faster, but smaller ones produce a smoother wah wah.
What about some coloration? In principle, this is not a wah wah. However, I noticed that a wah wah could be more interesting if the original signal itself included a (small) drop in high frequencies during a wah wah attack. This drop will be reversed during a wah wah release. This coloration will need at least a "cutoff" and a "depth".
I will probably not include these parameters. As of now, I have an effect with too many controls that may sound good, but looks ugly. I thought of making it more appealing with visualizing the wah wah. How? With a spectrogram of course. The wah wah is just a change in the frequency content of the signal in time. But then the spectrogram will not be very interesting. We know what it will look like.