This is something called charge injection and is a common problem with analogue switches. It's not very well documented anywhere. The Art of Electronics (editions 2 and 3) only gives it a glancing mention. You can mitigate against it by putting a resistor on the output. The lower the value, the better the performance, but the on resistance dominates so amplitude accuracy between the input and output goes completely out the window. You can see this on the ADG1223 datasheet - it's an analogue switch with extremely low charge injection. The test circuits load the outputs with 300 Ohms and I've seen (can't remember where) other test circuits loaded with 50 Ohms which gives horrible voltage drops across Rds(on).jvok wrote: ↑Sat Mar 18, 2023 1:05 am First results from 32x oversampled pilot, theres a lot of noise spikes all over the place. I think these are the stray capacitance charging up because the source impedance is so high coming through the resistor chainves things but I think the filter will clean most of this up anyway
jvok's Sleazy Listening stereo coder
- thewisepranker
- proppa neck!
- Posts: 573
- Joined: Fri Aug 22, 2014 12:53 pm
- Location: Brighton
Re: jvok's Sleazy Listening stereo coder
-
- proppa neck!
- Posts: 2957
- Joined: Tue Apr 05, 2016 1:23 am
Re: jvok's Sleazy Listening stereo coder
As ever, electronics is about compromise! If you look closely at the pilot waveform from the NRG Pro IV coder, you can see very slight glitches, but they are so tiny that they're insignificant.
I've been playing with a simplified Walsh circuit, that uses a 4060 and two 4030 EX-OR quad packages for (almost) all the logic. After a bit of messing, I've got a coder that works well, and is a minimum parts approach. Ideally the resistors biasing the analogue switches should be 1% types, and there are a couple of unusual values (using a couple of resistors in parallel), but "close enough" 5% resistors give reasonable results too! There's a little more to be done, and I'm contemplating a "third harmonic" stereo coder switch to invert and use to cancel the predominant harmonic at 114 kHz. If this is included, the spectral purity of the output will be absolutely "textbook"!
Incidentally - the Walsh Coder put up in the other thread wasn't the one we're playing with - I shouldn't let other people post for me on here (or anywhere else, for that matter). Circuits, board layouts and alignment details to follow over the next couple of days.
I've been playing with a simplified Walsh circuit, that uses a 4060 and two 4030 EX-OR quad packages for (almost) all the logic. After a bit of messing, I've got a coder that works well, and is a minimum parts approach. Ideally the resistors biasing the analogue switches should be 1% types, and there are a couple of unusual values (using a couple of resistors in parallel), but "close enough" 5% resistors give reasonable results too! There's a little more to be done, and I'm contemplating a "third harmonic" stereo coder switch to invert and use to cancel the predominant harmonic at 114 kHz. If this is included, the spectral purity of the output will be absolutely "textbook"!
Incidentally - the Walsh Coder put up in the other thread wasn't the one we're playing with - I shouldn't let other people post for me on here (or anywhere else, for that matter). Circuits, board layouts and alignment details to follow over the next couple of days.
"Why is my rig humming?"
"Because it doesn't know the words!"
"Because it doesn't know the words!"

-
- tower block dreamin
- Posts: 301
- Joined: Sun Aug 16, 2020 2:44 pm
Re: jvok's Sleazy Listening stereo coder
Making progress... phase sync'd 19khz and 38khz sine waves (still with the high value resistors)
You do not have the required permissions to view the files attached to this post.
- 3metrejim
- no manz can test innit
- Posts: 147
- Joined: Wed Feb 22, 2017 3:00 pm
Re: jvok's Sleazy Listening stereo coder
It's looking good so far.
I would like to ask though, why does the modulation always seem to be done by switching a variable part of the L+R signal instead of making the switches short the signal (part way along the resistor chains used) to ground, more like a switched balance control. There must be a reason. It would be interesting to know what that reason was.
I would like to ask though, why does the modulation always seem to be done by switching a variable part of the L+R signal instead of making the switches short the signal (part way along the resistor chains used) to ground, more like a switched balance control. There must be a reason. It would be interesting to know what that reason was.
-
- no manz can test innit
- Posts: 108
- Joined: Tue Mar 07, 2017 8:57 pm
Re: jvok's Sleazy Listening stereo coder
That's because when using analog switches, the ON resistance is not low enough to cause the required attenuation when shorting to ground (and using sensible resistor values at the other side), than attenuating by leaving the circuit open at their OFF state.3metrejim wrote: ↑Fri Mar 24, 2023 5:46 pm It's looking good so far.
I would like to ask though, why does the modulation always seem to be done by switching a variable part of the L+R signal instead of making the switches short the signal (part way along the resistor chains used) to ground, more like a switched balance control. There must be a reason. It would be interesting to know what that reason was.
- 3metrejim
- no manz can test innit
- Posts: 147
- Joined: Wed Feb 22, 2017 3:00 pm
Re: jvok's Sleazy Listening stereo coder
I guess that makes sense. There would be a small amount of cross-talk that you couldn't remove. It could be an advantage for the 2 state switching type though, where (at least in Albert's designs) there is a deliberate amount of cross-talk introduced to compensate for an imperfect amount of sub-carrier caused by the mathematics of the switching modulator.
-
- tower block dreamin
- Posts: 301
- Joined: Sun Aug 16, 2020 2:44 pm
Re: jvok's Sleazy Listening stereo coder
I finally caved and bought myself a better scope so heres some FFTs. First the 32x sampled pilot:
You can see the sample clock bleeding through which is at 32 x 19 = 608kHz. Then the alias frequencies appear either side of the clock:
The other random spikes are distortion caused by the limited number of steps (the technical term is quantisation noise) and also by slight resistor value mismatches. The more steps you have (higher oversampling) the lower the level of these spikes. Mostly these are at harmonics of 19kHz but there's also some at odd frequencies cause by intermodulation.
Now for the 38kHz subcarrier:
Not a fair comparison because the signal level is higher to start out with, but you can see how there's much more quantisation noise now because its only 16x sampled. The alias frequencies are in nearly the same place because the clock frequency is the same - thats the reason I went with 32x sampling for the pilot. If I'd used 16x sampling for the pilot too then the alias frequencies would have ended up at 285kHz and 323kHz and been much harder to filter out.
Of course most of this crap will be cut by the filter before it reaches the transmitter (FFTs of that to come).
You can see the sample clock bleeding through which is at 32 x 19 = 608kHz. Then the alias frequencies appear either side of the clock:
- 608 - 19 = 589kHz
- 608 + 19 = 627kHz
The other random spikes are distortion caused by the limited number of steps (the technical term is quantisation noise) and also by slight resistor value mismatches. The more steps you have (higher oversampling) the lower the level of these spikes. Mostly these are at harmonics of 19kHz but there's also some at odd frequencies cause by intermodulation.
Now for the 38kHz subcarrier:
Not a fair comparison because the signal level is higher to start out with, but you can see how there's much more quantisation noise now because its only 16x sampled. The alias frequencies are in nearly the same place because the clock frequency is the same - thats the reason I went with 32x sampling for the pilot. If I'd used 16x sampling for the pilot too then the alias frequencies would have ended up at 285kHz and 323kHz and been much harder to filter out.
Of course most of this crap will be cut by the filter before it reaches the transmitter (FFTs of that to come).
You do not have the required permissions to view the files attached to this post.
-
- tower block dreamin
- Posts: 301
- Joined: Sun Aug 16, 2020 2:44 pm
Re: jvok's Sleazy Listening stereo coder
Off air recording from the breadboarded coder (use headphones for full stereo effect):
Recorded through a ZoZo 1W exciter and Sony ICF-SW11 receiver. Audio source is WK-End web stream.
This is still with the higher value resistors, they make the waveform ugly but don't seem to affect the sound.
Recorded through a ZoZo 1W exciter and Sony ICF-SW11 receiver. Audio source is WK-End web stream.
This is still with the higher value resistors, they make the waveform ugly but don't seem to affect the sound.
-
- tower block dreamin
- Posts: 400
- Joined: Sat Feb 18, 2017 5:56 pm
Re: jvok's Sleazy Listening stereo coder
Would probably sound even better if the source wasn’t a web stream, just sayin.
Sony ST 920 QS
-
- proppa neck!
- Posts: 2957
- Joined: Tue Apr 05, 2016 1:23 am
Re: jvok's Sleazy Listening stereo coder
My latest oversampled coder design actually uses two sets of switches - the usual ones switched by (essentially) 38kHz and a second one centred on 114kHz. The third harmonic product at 114kHz is the predominant harmonic (second and fourth tend to "self-cancel") and by the time you get up to the fifth harmonic, the output filter has stripped all that off.... With careful dimensioning of amplitudes, the third harmonic can be completely cancelled, so that the transmitted spectrum is very clean, with no alias products produced at all, and the overall bandwidth very accurately conforms to the specification lain down by the various regulatory authorities.
I've been experimenting with various 15 kHz lowpass filters for the incoming audio, and have found that - if I use very high tolerance parts - I can open out the audio bandwidth to almost 16.5kHz! It's an interesting exercise, and there might be a slight improvement in sonic "clarity", but the fractional advantages are outweighed by the need to hand-select (and reject lots of) the passive components in the filters, and the need to use <<1% tolerance components!
The LPF design I prefer is gyrator based and has almost no measurable effect below the filter turnover point, and retains the precise phase accuracy of the passband that's needed for good stereo imaging.
I experimented extensively with switched-capacitor filters, but still haven't found one with the sonic quality of the boardful of op-amps I'm using!
There's still lots of work to do, and I'm considering a "first principles" coder, with subcarrier generation by double-balanced mixer, a sinewave oscillator with PLL tuning to keep it in place, and a wholly "analogue" approach to the audio. As I recall, I can get accurate frequency doubling (with high purity) by feeding both inputs of a double-balanced mixer with the same sinewave..... The phase accuracy of the 38kHz subcarrier won't be compromised by the need for extensive filtering.....
Watch this space!
I've been experimenting with various 15 kHz lowpass filters for the incoming audio, and have found that - if I use very high tolerance parts - I can open out the audio bandwidth to almost 16.5kHz! It's an interesting exercise, and there might be a slight improvement in sonic "clarity", but the fractional advantages are outweighed by the need to hand-select (and reject lots of) the passive components in the filters, and the need to use <<1% tolerance components!
The LPF design I prefer is gyrator based and has almost no measurable effect below the filter turnover point, and retains the precise phase accuracy of the passband that's needed for good stereo imaging.
I experimented extensively with switched-capacitor filters, but still haven't found one with the sonic quality of the boardful of op-amps I'm using!
There's still lots of work to do, and I'm considering a "first principles" coder, with subcarrier generation by double-balanced mixer, a sinewave oscillator with PLL tuning to keep it in place, and a wholly "analogue" approach to the audio. As I recall, I can get accurate frequency doubling (with high purity) by feeding both inputs of a double-balanced mixer with the same sinewave..... The phase accuracy of the 38kHz subcarrier won't be compromised by the need for extensive filtering.....
Watch this space!
"Why is my rig humming?"
"Because it doesn't know the words!"
"Because it doesn't know the words!"

-
- tower block dreamin
- Posts: 301
- Joined: Sun Aug 16, 2020 2:44 pm
Re: jvok's Sleazy Listening stereo coder
Sounded alright off air, I think its the multiple rounds of mp3 coding from uploading to vocaroo made it sound bad. Ill see if I can upload a wav file in insteadLeeCavanagh wrote: ↑Sun Apr 02, 2023 12:07 am Would probably sound even better if the source wasn’t a web stream, just sayin.
- 3metrejim
- no manz can test innit
- Posts: 147
- Joined: Wed Feb 22, 2017 3:00 pm
Re: jvok's Sleazy Listening stereo coder
I like Albert's idea, although I had a bit of trouble trying to make an analogue multiplier coder. I used the ancient mc1496 mixer IC, and although clean (as far as I could tell anyway), it had a problem with excessive noise because the signals had to be kept low to keep the 1496 linear. I also tried using two out of phase LM13700 VCAs but had trouble with them balancing correctly. Maybe the PWM vca technique would make an interesting hybrid - never tried that.
Not having a spectrum analyser at the time (close to 30 years ago now), I had an interesting way to see how 'clean' each attempt was (apart from using an oscilloscope). I would get an analogue FM stereo receiver, disable the afc, and then transmit a really weak signal (to avoid overloading the receiver). If the stereo coder was not very clean, I'd get multiple signals received when tuning slowly across where the transmission was (a sort of bumpy, signal/no signal response). I kept trying different circuits until I only got the main signal and a little each side. Very crude, but at least the signal was confined to a small area where it should have been and with similar characteristic to a legal station.
Not having a spectrum analyser at the time (close to 30 years ago now), I had an interesting way to see how 'clean' each attempt was (apart from using an oscilloscope). I would get an analogue FM stereo receiver, disable the afc, and then transmit a really weak signal (to avoid overloading the receiver). If the stereo coder was not very clean, I'd get multiple signals received when tuning slowly across where the transmission was (a sort of bumpy, signal/no signal response). I kept trying different circuits until I only got the main signal and a little each side. Very crude, but at least the signal was confined to a small area where it should have been and with similar characteristic to a legal station.
-
- proppa neck!
- Posts: 2957
- Joined: Tue Apr 05, 2016 1:23 am
Re: jvok's Sleazy Listening stereo coder
Way back in the dim 'n' distant past, I did a mixer coder using a bagful of BC109Cs - selected accurately for matching Hfe and configured as "long-tailed pair" balanced mixers. This didn't have the problems of the MC1496 and the mixing could happen at a couple of Volts p-p, but construction was incredibly labour-intensive because of the need to hand select every component! The results, however, were spectacularly good!
"Why is my rig humming?"
"Because it doesn't know the words!"
"Because it doesn't know the words!"

-
- no manz can test innit
- Posts: 237
- Joined: Tue Dec 02, 2014 11:03 am
Re: jvok's Sleazy Listening stereo coder
If I remember rightly, the first Stephen Moss stereo encoder I saw, was implemented that way. Would have been 1992. His exciter design was somewhat different then too. The push-pull oscillator / push-push doubler exciter came soon after.Albert H wrote: ↑Wed Apr 05, 2023 1:54 pm Way back in the dim 'n' distant past, I did a mixer coder using a bagful of BC109Cs - selected accurately for matching Hfe and configured as "long-tailed pair" balanced mixers. This didn't have the problems of the MC1496 and the mixing could happen at a couple of Volts p-p, but construction was incredibly labour-intensive because of the need to hand select every component! The results, however, were spectacularly good!
-
- tower block dreamin
- Posts: 301
- Joined: Sun Aug 16, 2020 2:44 pm
Re: jvok's Sleazy Listening stereo coder
Layout almost done, just a bit more routing to get right
You do not have the required permissions to view the files attached to this post.
- reverend
- tower block dreamin
- Posts: 282
- Joined: Sat Jul 25, 2020 12:03 pm
Re: jvok's Sleazy Listening stereo coder
Tidy looking board. Well done!
if it ain't broke, keep tweaking
-
- tower block dreamin
- Posts: 301
- Joined: Sun Aug 16, 2020 2:44 pm
Re: jvok's Sleazy Listening stereo coder
Shrunk the board a bit by condensing things down at the bottom, and added mounting holes
You do not have the required permissions to view the files attached to this post.
-
- tower block dreamin
- Posts: 301
- Joined: Sun Aug 16, 2020 2:44 pm
Re: jvok's Sleazy Listening stereo coder
Heres a capture from the board in the photo after modding. Audio source is UKBass livestream through a Zozo 1W driver, received through a Nooelec RTLSDR dongle. I wasnt using any limiting so its overmodulating a bit but doesn't matter just to demo the coder.
MPX spectrum looks pretty clean. Theres a bit of a spike around 76kHz which is caused by the DC level sagging in the middle of the resistor chain (I guess from charge injection in the 4051) but at 55dB down I'm not too worried.
Will post gerbers, hex files etc when I get the Rev2 boards back and tested.
You do not have the required permissions to view the files attached to this post.
- 3metrejim
- no manz can test innit
- Posts: 147
- Joined: Wed Feb 22, 2017 3:00 pm
Re: jvok's Sleazy Listening stereo coder
Seems like it works well and looks neat. Are we taking bets on how long it will be before it's copies appear on etsy or ali express once the files are posted? I guess you don't mind about that, and it was here first, so you can claim kudos and maybe compensation for commercial use.
- FMEnjoyer
- proppa neck!
- Posts: 517
- Joined: Sun Oct 12, 2014 1:33 pm
- Contact:
Re: jvok's Sleazy Listening stereo coder
A nice looking PCB is a thing of beauty, function meets art.
The dial is Glowing 88-108 , spin the wheel to light those Red LEDs , see signal needle rise.