Vocoder stompbox concept - crazy but it just might have legs.....

Started by frequencycentral, October 04, 2011, 12:53:01 PM

Previous topic - Next topic

frequencycentral

Ok, so recently I've been thinking about building/designing a minimum vocoder. Here's some background:

http://www.diystompboxes.com/smfforum/index.php?topic=81753.0
http://circuitworkshop.com/forum/index.php?topic=996.0

In case you can't be bothered to read those threads, my original idea was to make it managable by using a minimum number of bands, maybe as few a 4. But today I had a crazy idea........instead of multiple fixed BPFs, multiple envelope followers and VCAs........how about a multiplexing vocoder? So, only two BPFs, one carrier and one modulator - but they are both voltage controlled and swept simultaneously through the same frequency ranges by an oscillator. The oscillator would have to be running pretty fast to get any sort of useable 'sample rate' though. Here's a block diagram:



....all you have to decide is how fast the LFO needs to run to get to a workable resolution. In fact it won't be an LFO really, it'll have to be at least at the lower end of the audio range. Here's the rub - at those frequencies, the oscillator is certainly going to 'bleed' into the vocoder's audio path. I have used audio frequency oscillators as control voltages into VCFs on my modular system - the result is FM, which is not desirable here. So, any way to 'null' the oscillator? Maybe stick it through an inverter and mix the output into the audio path so that phase cancellation obliterates the bleed?

BTW, the HPF is there to add sibilance for added intelligability.

Hmmm, maybe it's actually a cross between a vocoder and a sample rate reducer? Anyway, if the challenges can be overcome it could be built with a couple of LM13700 and maybe a dozen opamps.

http://www.frequencycentral.co.uk/

Questo è il fiore del partigiano morto per la libertà!

Mark Hammer

There's two generic strategies for vocoder FX: one where the objective is to simply have something controlled in a frequency-dependent way by other content, and one where the objective is to have it sound as much like the controlling signal source (whether voice or other) as possible.  The former could be implemented with as few as one band, but the second requires noticeably more than 4 bands.

That doesn't make it musically invalid to work with 4, or even 2, but you need to be realistic about what you'll end up with.

How many do you need?  Much like graphic EQs vs parametric EQs, when you don't know specifically which frequency bands will be most pertinent for the task, you build in a lot of sliders and narrow-band filters.  The alternate strategy is to have variable center frequency and tune a handful of filters to the resonant bands in question.  If you're designing a vocoder for nobody's voice in particular, you aim for lotsa bands.  If you know the characteristics of the voice being used, then you may be able to get away with fewer bands, tuned to the regions that matter for that voice.

frequencycentral

#2
Mark, the point of this concept is that because the two BPF are swept it's a multiband vocoder, albeit multiplexed. ie the limit on bands/bandwidth is how fast you clock it.
http://www.frequencycentral.co.uk/

Questo è il fiore del partigiano morto per la libertà!

R.G.

Quote from: frequencycentral on October 04, 2011, 12:53:01 PM
The oscillator would have to be running pretty fast to get any sort of useable 'sample rate' though.

There's an issue lurking there. The time domain response gets to being a problem. If you blip the filters around, they don't have a chance to respond at their filter frequency before they're yanked away again. A filter that's suddenly changed in frequency takes some time to respond to the input at that frequency. If you change it faster than the frequency it's filtering, it doesn't have time to respond at that frequency.

I haven't done the math or looked this up, but my intuition is that it's not going to do what you want. Just guessing.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Mark Hammer

Kinda reminds me of something i saw in Popular Electronics or Radio Electronics some years back that was intended to provide a video image on a pair of glasses, for virtual reality effects.  It involved a very simple multiplexed vertical LED array, probably 16-dot.  The idea was that a tiny mirror surface on the glasses would be "fluttered", like a butterfly wing, by some reverse piezo-electric effect.  An image would be shone on the mirror surface as it moved, by the LED array.  Meanwhile, the image to be shown would be essentially scanned in vertical columns.  The content of each column would end up on a different spot on the retina, by virtue of the constant movement of the reflecting surface.  Naturally, the specific column being illuminated by the LEDs would be synchronized with the movement of the reflecting surface, such that a complex image could be projected, in perceptually stable fashion, on the retina.  It may have been only 16 dots high, but was the functional equivalent of hundreds of dots wide.  A teeny-tiny raster display with refresh, on a pair of glasses.

Of course, that was well before LCD screens.

frequencycentral

Quote from: R.G. on October 04, 2011, 02:31:11 PM
There's an issue lurking there. The time domain response gets to being a problem. If you blip the filters around, they don't have a chance to respond at their filter frequency before they're yanked away again. A filter that's suddenly changed in frequency takes some time to respond to the input at that frequency. If you change it faster than the frequency it's filtering, it doesn't have time to respond at that frequency.

Ok, I didn't consider that, thanks. So, maybe have the LFO drive a LM3914 to generate 10 stepped CVs instead of a continuous stream? The resolution would go down but the filters might have a fighting chance of keeping up. And maybe the bleed through would be less obvious?
http://www.frequencycentral.co.uk/

Questo è il fiore del partigiano morto per la libertà!

amptramp

Quote from: frequencycentral on October 04, 2011, 06:37:55 PM
Ok, I didn't consider that, thanks. So, maybe have the LFO drive a LM3914 to generate 10 stepped CVs instead of a continuous stream? The resolution would go down but the filters might have a fighting chance of keeping up. And maybe the bleed through would be less obvious?


You will hear the steps if you do it that way - the filter will attempt to settle on a final value then the next step will occur and it will always try to catch up.  You will get a step response superimposed on the filter response.

R.G.

Quote from: frequencycentral on October 04, 2011, 06:37:55 PM
Ok, I didn't consider that, thanks. So, maybe have the LFO drive a LM3914 to generate 10 stepped CVs instead of a continuous stream? The resolution would go down but the filters might have a fighting chance of keeping up. And maybe the bleed through would be less obvious?

Just thinking out loud, now.

Let's assume you have an ideal voltage controlled filter. Its pass band is whatever reasonable Q you want, and it can step instantly to the frequency requested by a control voltage. Moreover, it has a phase response which is always zero degrees with respect to the incoming signal. That last is impossible in this particular universe for any analog or real time digital filter. Real filters will have problems with these, but just for thought, we'll assume we can do it. So we're going to feed it a stepped control voltage to make it sample the incoming signal at different frequencies

If I have the idea right, we're going to see if there is any content at a given frequency by switching the filter to the frequency in question, letting some output come out, then stepping to another frequency and seeing if anything comes out there.

If the signal is, for instance, a sine wave at 1kHz, and we step the filter to 10, 20, 50, 100, 200, 500, 1000, 2000, 5000,... Hz, we want the output to be nothing everywhere the control voltage is not for 1000hz.

If we make each step be 1 second long, the thing works perfectly. Output is zero until we hit 1kHz. But that's too slow. We start stepping at 1/10 second, or every 100mS. That will still work for 1kHz. But look what happened to 10Hz. We didn't expect any output there, which is good, because 100mS is exactly one cycle of 10Hz. A really good hypothetical filter might output one cycle of 10Hz out for exactly one cycle in, but a real one won't. Real filters act like pendulums or tuning forks. If you blap in a hunk of energy, they ring. The higher the Q, the longer the ring. So we've just hit something that will count out all the real filters. You can't build an analog filter that will put out exactly one cycle of its resonant frequency. Mother Nature says (in Her usual subtle way, through the math that describes it.)

Things get uglier when we go to 10 mS. That's 10 cycles of the 1kHz that's really there, but only 1/10 of a cycle of 10Hz. If there does happen to be any 10Hz in the signal, It only gets to see it for 1/10 of a cycle before the filter moves on to another frequency. I don't know exactly what even an ideal filter would do, but what it probably would not do is put out 1/10 of a cycle of a 10Hz wave and then step nicely with no complaining to the next frequency.

And what you can see is that Nyquist's sampling theorm is intruding on you in another way. You can't tell if there is X frequency there if you sample it at less than 2 times per cycle. So if we're sampling to 10kHz, we have to sample at more than 20,000 times per second. What does a 10Hz (or 100, or 1000Hz) filter do if its frequency of resonance is only active for 1/20,000 of the time?

I've never seen the math on this, but I suspect that there is some criteria that says something like "if you feed a filter less than two cycles of its intended frequency, you can't tell what it's looking at". It may be as bad as Q times two cycles, just speculating.

I think you have to step the control voltage so slowly that it doesn't do what you think it's doing, being a vocoder in real time. And I think if you step it fast enough to do interesting vocoding, it ceases being the filter it's supposed to be.

... I think...  :icon_eek:
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

nexekho

Am I right in thinking that a vocoder uses a bank of filters to select lots of individual frequency bands, envelopes all of them and then uses those envelopes to control the volume of many simple synthesizers?  If so, could you pitch shift by intentionally mismatching the frequencies?
I made the transistor angry.

Mark Hammer

Close, but not quite.

A bank of bandpass filters are used to divide the signal to be processed.  Each bandpass filter is followed by a gain cell or VCA of some sort such that the output of each filter can be adjusted in level electronically.

The controlling signal has its own bank of identically-tuned bandpass filters, and the output of each of those filters has an envelope follower.

The individual envelopes of whatever goes into that second bank of filters is used to control the level of the same bands in the to-be-processed signal.

If the vocoder unit is complex enough, then yes, you CAN repatch the envelope outputs and VCA inputs so that a 1khz centre-freq bandpass is being modulated by something else, like say the envelope of a 400hz bandpass filter.  But typically you want a 4U rackmount package for that sort of flexibility.

R.G.

... and it's very much simpler and cheaper to do it by digitizing, pitch shifting, and then converting to analog. This can be done in real time on a 3" x 5" board, probably smaller, for under $50 I suspect.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

nexekho

Quote from: R.G. on October 04, 2011, 09:13:40 PM
... and it's very much simpler and cheaper to do it by digitizing, pitch shifting, and then converting to analog. This can be done in real time on a 3" x 5" board, probably smaller, for under $50 I suspect.

Yeah, I have had a pitch shifter running on my £13 Arduino  Nano clone + £5 of support hardware.  Wasn't terribly great but it works.  I also have a Behringer Ultra Shifter.

...but that's no fun ;]
I made the transistor angry.

earthtonesaudio

#12
I think I agree with R.G. regarding the idea that a filter can only work on signals if it has enough time.

However that doesn't mean the idea can't be useful as a vocoder-like thing.

How about this mod, which eliminates the free-running oscillator and instead sort-of tracks the dominant vocal frequency?  I think this would be similar to the first method described by Mark Hammer:

Quote from: Mark Hammer on October 04, 2011, 01:49:29 PM
There's two generic strategies for vocoder FX: one where the objective is to simply have something controlled in a frequency-dependent way by other content...


frequencycentral

^^^

Having trouble getting my head around that Alex! 

As the envelope follower is after the analysis BPF it will only receive the band of frequencies that the BPF is currently passing, therefore the envelope follower will put out a CV that will set the filter to that/those band(s)? Walk me though it and tell me why it's not an endless immovable loop. I feel I'm missing something - my brain hurts! ;)
http://www.frequencycentral.co.uk/

Questo è il fiore del partigiano morto per la libertà!

earthtonesaudio

Let me try it through it from the beginning, focusing on the vocal side:

0. initial conditions: no vocal; envelope voltage=0; filter freq=min
1a. user sings into microphone
1b. although the BPF is currently set to min. frequency, the Q is not infinite so SOMEthing gets through to the envelope follower
1c. envelope voltage increases, filter frequency increases
1d. the filter frequency is now passing more of the vocal; envelope voltage increases further, filter freq increases further, and will keep increasing UNTIL it becomes so high that hardly any vocal is passed though to the envelope follower - this is the negative feedback loop that brings the filter frequency back down
2a. in the case of a sustained loud vocal note, the filter frequency will stabilize (eventually) around some dominant frequency of the vocal signal
2b. in the case of a sustained soft vocal note, the filter frequency will stabilize (eventually) around some lower, subdominant component of the vocal
2c. in the case of a short transient vocal input, the filter will sweep up then back down

In parallel to all of this is the processed carrier, with amplitude and frequency sort of going together... hm, that might be a problem.  Probably would make it sound like a highpass, depending on the response time of the envelope follower.  That part's hard to figure out.

R.G.

Tracking filters can be done; I think this is the central idea you're after Alex.

There are a few practical problems with them too. They tend to either be slow or to latch on harmonics, or both, much in common with PLLs. And the human voice has at least three and probably four "formants" or resonant peaks in it. That's how we make vowels.

So one tracking filter which looks for max output by changing its resonant frequency tends to get trapped by the first peak it comes to, and may ignore a bigger peak a bit higher or lower. Then you have to figure out how to evaluate how much output there is at a frequency. This takes several cycles at least, longer if you use an analog signal level detector, and worse if you use a capacitor or integrator to filter the peaks. The three-way peak detector is good, but the timeout has to be set for the lowest possible frequency, again slowing things down.

I don't mean to be a consistent naysayer on this one. It's just that I can't figure out how to make it work.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

earthtonesaudio

Yes, kind of.  A "good" tracking filter would lock onto the fundamental of the input vocal.  I imagine my feedback path as a "poor" tracking filter, or one that has just a tenuous grip on the signal frequency.  Then you could exercise some control over the filter using only your vocal amplitude.  That would be kind of intuitive for those of us used to harmonic distortion; sing louder to get higher harmonics.

R.G.

R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.