zero crossing switching?

Started by tempus, March 26, 2011, 12:16:00 PM

Previous topic - Next topic

tempus

Hey all;

I'm thinking about adding a zero crossing detector to my PIC based switching system, so that switching would only occur when the signal was at zero volts. Has anyone ever tried this? Is it a worthwhile venture or is the guitar signal too complex to pull it off?

Thanks


amptramp

When you are switching an effect, the minimum switching noise comes when the input and output are at the same voltage.  Some delay-based pedals (chorus, echo, delay, flanger etc.) do not switch the input off.  For all other pedals, switching at zero would be a good idea.

R.G.

Quote from: tempus on March 26, 2011, 12:16:00 PM
I'm thinking about adding a zero crossing detector to my PIC based switching system, so that switching would only occur when the signal was at zero volts. Has anyone ever tried this? Is it a worthwhile venture or is the guitar signal too complex to pull it off?
Laudable ambition. However I'd be concerned that the PIC, by itself is not fast enough to tell when a zero crossing is. There is a maximum speed with which an audio signal changes that is directly dependent on the highest frequency in the signal. You have to be able to resolve that frequency without aliasing to be able to tell when a zero crossing happens. You also have to react and do your stuff before the signal gets appreciably away from the zero that you detected.

I haven't done the numbers on this particular example, but PIC A-D converters are not fast enough to digitize full range audio yet. Even limited band audio is a stretch for it. And then you have to be able to take the interrupt and do your switching before the signal wanders away from the zero that you wanted. Interrupt latency time is a problem there.

One thing that I do know works is to force the signal to be zero or nearly zero when you want to switch, do the switching, then un-mute. I used an H11F3 to mute audio, switch, then release the audio line. That took considerably less than a millisecond, and such a short dropout is very difficult to detect.
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.

cpm

FX switching usually its a single change in audio routing. I mean, as long as it doesnt "pop", it'll be fine

However, zero crossing might be useful if you are switching fast, back and forth (eg, a fast tremolo, etc). Here the repeated difference in levels may appear as a noticeable aliased low frequency if it approaches the psychoacoustic limit where you start hearing it as a tone on its own, instead of a faint "pop".

Gurner

#4
RG is quite correct... by the time the PIC has detected that zero has been crossed, the signal has already travalled further (& no loinger at zero)....it'd be better than nothing, but not optimum.

If you wish to go the PIC route for zero detect (say because your switching circuit already has one onboard)...then look at utilizing the PIC's onboard comparators in purely the analogue domain, but even then the PIC's onboard comparators are just genereic/basic ones (for optimum zero detect you need the fastest comparators you can get your hands on)

tempus

QuoteRG is quite correct... by the time the PIC has detected that zero has been crossed, the signal has already travalled further (& no loinger at zero)

My plan was to use a comparator to do the zero crossing detection, not the PIC (I don't have any free pins left on the PIC anyway). I was thinking of sending the signal from the PIC (which sends a logic high to switch a JFET when I'm switching) and the output of the comparator to an AND gate, then have the ANDed result of that sent to switch the JFET. I don't know if there's a more eloquent/better way to do this though.

QuoteOne thing that I do know works is to force the signal to be zero or nearly zero when you want to switch, do the switching, then un-mute. I used an H11F3 to mute audio, switch, then release the audio line. That took considerably less than a millisecond, and such a short dropout is very difficult to detect.

How do you wire up the H11F3 RG? Do you just have it shunt the signal to ground or is it in series with the signal? Is there an advantage to using this part over using a suitable JFET?

Thanks for all your replies.

earthtonesaudio

I don't know if this will help you, but if you use a window comparator you can have a region of "zero-enough" which gives you some elbow room for switching.  Works best with triangles, though, which are rare in guitar audio.

merlinb

Zero-crossing switching isn't much improvement over random switching; you still get a click. Can't you just use a CR filter to slow down the speed at which the FETs switch to a few milliseconds?