Making a generic envelope follower

Started by soggybag, September 27, 2005, 11:56:52 AM

Previous topic - Next topic

StephenGiles

All good stuff eh? Somewhere (how many times have I said that?) I have the circuits for the Top Gear Guitar synth, of which they only made about 20. So no doubt it will turn up at some point so I can see what they did about an envelopr follower. I remember trying one and it was pretty good.
Stephen
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

puretube

OK - spinning an idea (or even 2) further:
how to make a pair of quadrature signals (and then invert both, to obtain a quadruple...), that lack the group delay caused by a Dome-filter?
The third method ? comes to mind...

Gives you both: quadrature and (an intermediate) higher "pitch"...

speaking of pitch: once you have an audio-quadrature pair, and you`re already modulating anyways, you can go Bode/Moog, and introduce an envelope-controlled Frequency-Shifter, that uses the quadrature-follower...

"Pitch-Hoax" ?   :icon_razz:

Paul Perry (Frostwave)

These exotic rectifiers are all very well, but they dont (AFAIK) overcome the problem of low frequency 'trem' created by beating between different notes.

puretube

so first send the signal thru a hi-pass?

Mark Hammer

Quote from: puretube on October 20, 2005, 11:23:22 AM
so first send the signal thru a hi-pass?

HEY, Barmentloo!  That's MY question!!  You're cutting in on my territory.   :icon_lol: :icon_lol: ;)

puretube

#105
ok - bandpass it then!

and, err: I thought You were here for the answers,
and not for the questions...

:icon_wink:

Vsat

Had a chat with Harry yesterday who indicated that the problem may be even worse... low-freq ripple can be generated by feeding a single string into an env flwr. The ripple can be very low-freq (well below the pitch of the string) and is a consequence of the fact that the overtones in a vibrating guitar string are not perfectly harmonic... successively higher  overtones become increasingly  sharp with respect to the fundamental. eg  80 Hz fundamental, 161 Hz 2nd overtone (rather than ideal 160 Hz), 243 Hz 3rd.... feed this into rectifier and sum and difference will be produced betwen all the original frequencies, giving a real mess including 1 Hz 2 Hz and 3 Hz difference signals.
Mike

Vsat

Puretube,
Took a look at the SSB patent you ref'd... that is an interesting variant of the standard SSB stuff. Typically around 500 Khz for the "LFO" aka local oscillator... the bandpass filter is the most critical component for ensuring the opposite sideband is suppressed - a  "crystal filter" aka "quartz lattice filter" is normally used with very sharp attenuation at the bandpass response skirts.  That certainly would generate quadrature audio without the huge amount of group delay imparted by the Dome filter-phasing method.

The bandpass filter is the critical part...  300 Hz - 3 KHz audio is normally used for communications. The low freq response would be limited by how selective the bandpass filter is... we don't need 20 Hz-20 KHz for the env flwr though... 80 Hz for lowest string up to 5 Khz should be sufficient for envelope extraction. Unfortunately processing 80 Hz is even more demanding than the communications 300 Hz lowest freq. Heterodyne 100 Hz low note (for instance) with 250 KHz L.O. and get  250.1 Khz  and 249.9 KHz sum and diff freqs. This is only a 200 Hz spread centered about 250 KHz.... a very sharp filter is needed to remove the unwanted sideband... thus crystal filter is used. The crystal also has to pass a bandwidth wide enough to accommodate the original audio bandwidth.  Heterodyne this back down to baseband using quadrature version of the same local oscillator signal, low pass filter to remove new upper sideband (as patent shows)  and original signal is recovered in quadrature form. Rectify this separately from  original audio and combine rectifier outputs and ripple is reduced.

Three multipliers are needed (the "detectors" in the patent are also a pair of multipliers)... these could be CA3080 or perhaps even analog switches, no need for AD633 here.  Interesting, should give an improvement  but a lot of parts.
Cheers, Mike

Vsat

Thought about this some more.... the SSB quadrature method will give an improvement for strictly monophonic signals, but the "two-note beat" problem will remain. Could feed the recovered two-note beat signal into a 2nd quadrature generator for ripple reduction, but the beat frequencies will be so low that the quartz crystal filter will not be able to separate the sidebands properly  :(

Yikes, Mike


puretube

#109
wait... I had a brickwall bandpass-filter somewhere,
that goes down to zero Hertz...
ahh, but that one again is a part-intensive modulation/heterodyning thingy...

so: "neck-pickup/tone rolled down", and then hipass the sidechain above 60Hz...
(and artificially "recover" the missing overtones by distortion in the signal path),
or first have a quick-acting fundamental-extractor in the side chain... Stephen are you still with us?).

Or: forget about the (lousy group-) delays, and process the side-chain the best way possible,
and (full-bandwidth) delay the whole signal-path by those ms it needs, to have the control-voltage right - can add some nice flanging... - or lead to timing problems in a band-context... (anybody said: "latency"... ?)


btw: that "3rd method" for SSB-ing can be interesting for obtaining 90° audio signals
for other purposes...  :icon_wink:

Mark Hammer

Is it just me or do the requirements for a so-called generic envelope follower (at least in the analog domain) change depending upon what the heck it is you want to play?

I certainly trust Harry's chops and judgment (as I do Mike's and Ton's), but I ask myself "What does a 1hz or even 3hz subaudio component to the envelope matter?"  If I was going to hang onto a note for a while, probably.  The majority of people who seek out envelope-control, though, intend to use it for rhythmic emphasis.  Which is to say that unless it's a funeral dirge, or some experiment in which alternate occurrences of some signal are used to trigger/drive the envelope follower, and are held onto (deliberately lagged) over a bar or more, few people would want to assure ripple immunity for those sorts of durations.  I'm not saying that perfect ripple rejection is undesirable or unattainable, just that most anticipated uses do not require the sort of worst-case scenario preparation being discussed.

All of that being said, I'd be the first to admit that "pushing the envelope" in threads like this one can sometimes leads to insights and simple-but-elegant solutions that advance us in other areas by leaps and bounds.  So ignore my harumphing, and carry on.

puretube

naw, Mark: my "neck-pickup & rolldown tone" was meant exactly to express the same thoughts!

but: it is nice to congregate with the elusive thoughts of those,
who spent more thoughts on this kind of stuff in the synth-/studio surrounding,
than "us" here down at the floor- boxes boot-level...
:icon_smile:

Vsat

Any DSP people out there who can provide a ballpark figure for latency or frame update rate for an FFT with 1 Hz resolution good over the range of 50 Hz to 5 KHz? (12-bit amplitude resolution probably more than sufficient). Probably just looking at the first few lowest frequency components and summing them would be adequate for covering all cases from single note to 6 strings at once, no need to track individual notes or upper harmonics (unless you want to).
Cheers, Mike

davebungo

FFT frequency resolution (Hz) = sampling rate fs (Hz) / FFT size
This would also be the frame rate if you did FFTs one after another but in many systems the FFTs are overlapped in time so the frame rate can be whatever you desire/can achieve.

So, to achieve a 1Hz resolution your FFT length would have = the sample rate.  To achieve a 5KHz bandwidth you need an absolute minimum fs of 10KHz (although this isn't a practical minimum) so an FFT size of 10K would be required.  A 10K pont FFT is too memory hungry for most basic DSPs without some form of external memory (easy on a PC though)

I seem to remember that a 1K point FFT on a SHARC running at 40MOPS was about 1 or 2 mS or thereabouts, but it really depends on your DSP hardware.

Vsat

Thanks Dave!
That makes sense. Hmm..looking at your eqn's.... maybe do an FFT for the lower frequencies only (up to 1 or 2 KHz?)  and process the higher frequencies directly with a (hopefully simple) "absolute-value and average" routine, combine the two sets of results and send to D/A. Or use DSP for the lower freqs, and process the higher freqs in the analog realm  with the typical env follower circuit ( and the high freqs should cause less trouble than the lower freqs which are handled by the DSP, but this is getting a bit klugey).
Regards, Mike

Vsat

There's a "gotcha" in that idea as well.... if you have the FFT set up for 1 Hz resolution (to adequately separate low notes), it will take one second for an event occurring  at time "x" to be pumped out of the DSP chip as env information. The DSP maybe be computing the entire spectrum and sending out new info every millisecond, but there will still be a one-second latency, which will make it unuseable.

Maybe just look at the higher freq spectrum components, filter out the low freq stuff beforehand,  assign the harmonics to different notes based on a largest-common-divisor routine, and calculate the current amplitude for all notes present.???
Mike

A.S.P.

#116
information lost...
Analogue Signal Processing

davebungo

Firstly, sinAsinB = 1/2[sin(a+b) + sin(a-b)] i.e. if you multiply two sines together, you get a sum and difference frequency.  If the two frequencies are close together, then the difference "component" is low frequency.  You may ask why two signals would be multiplied in the first place; well this comes from the fact that a non-linear system (like say a diode I vs V curve will generally have terms which are powers of 2, 3, 4 etc. in varying amounts e.g. y=x^2.  When you apply two or more completely separate sine waves to this sort of system they intermodulate i.e. as per the equation above e.g.

y = x * x (or x^2) so if x = sinA+sinB you would get y = sinAsinA + 2sinAsinB + sinBsinB and you can substitute the above equation into this one to obtain the sum and difference frequencies.

In reality, this happens on a grand scale with a continuous spectrum of frequencies from a guitar or whatever all mixing together to produce all sorts of beat frequencies just as you get playing notes on diferent strings which are fairly close together through an overdriven amplifier.

Probably not a great explanation but that's how I see it.

A.S.P.

#118
information lost...
Analogue Signal Processing

Vsat

Dave and A.S.P.,
Yup... that's what I think is happening within the env follower. But with two strings playing nearly the same note you also have  beating taking place in a linear environment... the oscilloscope (and my ears) clearly show a periodic beat envelope before the signals are applied to the follower... simply a result of two nearly identical waves slowly going in and out of phase with each other, producing periodic reinforcement and cancellation at the difference freq. Since the two freqs are not the same (even if the amplitudes are), the null will not be perfect at the time of maximum cancellation, and the null becomes even less intense as the freq difference becomes larger. But the null can be nearly perfect when the two frequencies and amplitudes are very closely matched, giving a large change in overall level at the beat rate, which the follower does a nice job of "following". No need to invoke non-linearity of the air or non-linearity of the ear to explain acoustic beating. It is additive, and will behave the same at low or high sound pressure levels (or by simple summing in an op amp circuit). The rectifier in the env follower is non-linear however, and multiplication takes place and additional terms are generated. as you mention. So the beating has two separate origins in the follower circuit.
Regards, Mike