jvok's Sleazy Listening stereo coder

Everything technical about radio can be discussed here, whether it's transmitting or receiving. Guides, charts, diagrams, etc. are all welcome.
User avatar
thewisepranker
proppa neck!
proppa neck!
Posts: 569
Joined: Fri Aug 22, 2014 12:53 pm
Location: Brighton

Re: jvok's Sleazy Listening stereo coder

Post by thewisepranker » Sun Mar 19, 2023 12:30 pm

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
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).

Albert H
proppa neck!
proppa neck!
Posts: 2778
Joined: Tue Apr 05, 2016 1:23 am

Re: jvok's Sleazy Listening stereo coder

Post by Albert H » Mon Mar 20, 2023 4:13 am

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.
"Why is my rig humming?"
"Because it doesn't know the words!"
;)

jvok
no manz can test innit
no manz can test innit
Posts: 220
Joined: Sun Aug 16, 2020 2:44 pm

Re: jvok's Sleazy Listening stereo coder

Post by jvok » Mon Mar 20, 2023 11:59 pm

Making progress... phase sync'd 19khz and 38khz sine waves (still with the high value resistors)
IMG_20230320_234319475.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
3metrejim
no manz can test innit
no manz can test innit
Posts: 147
Joined: Wed Feb 22, 2017 3:00 pm

Re: jvok's Sleazy Listening stereo coder

Post by 3metrejim » 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.

Krakatoa
big in da game.. trust
big in da game.. trust
Posts: 87
Joined: Tue Mar 07, 2017 8:57 pm

Re: jvok's Sleazy Listening stereo coder

Post by Krakatoa » Sat Mar 25, 2023 8:40 am

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.
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.

User avatar
3metrejim
no manz can test innit
no manz can test innit
Posts: 147
Joined: Wed Feb 22, 2017 3:00 pm

Re: jvok's Sleazy Listening stereo coder

Post by 3metrejim » Sat Mar 25, 2023 11:31 am

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.

jvok
no manz can test innit
no manz can test innit
Posts: 220
Joined: Sun Aug 16, 2020 2:44 pm

Re: jvok's Sleazy Listening stereo coder

Post by jvok » Sat Mar 25, 2023 6:50 pm

I finally caved and bought myself a better scope so heres some FFTs. First the 32x sampled pilot:
19khz spectrum.png
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
This pattern will also repeat for every multiple of the clock (so 1216kHz +/- 19kHz, 1824kHz +/- 19kHz, 2432kHz +/- 9kHz) but I'm less worried about those because they'll be lower level to start with and attenuated by the filter even more.

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:
38khz spectrum.png
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.

jvok
no manz can test innit
no manz can test innit
Posts: 220
Joined: Sun Aug 16, 2020 2:44 pm

Re: jvok's Sleazy Listening stereo coder

Post by jvok » Sat Apr 01, 2023 11:43 pm

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.

LeeCavanagh
tower block dreamin
tower block dreamin
Posts: 361
Joined: Sat Feb 18, 2017 5:56 pm

Re: jvok's Sleazy Listening stereo coder

Post by LeeCavanagh » Sun Apr 02, 2023 12:07 am

Would probably sound even better if the source wasn’t a web stream, just sayin.
Sony ST 920 QS

Albert H
proppa neck!
proppa neck!
Posts: 2778
Joined: Tue Apr 05, 2016 1:23 am

Re: jvok's Sleazy Listening stereo coder

Post by Albert H » Sun Apr 02, 2023 4:21 am

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!
"Why is my rig humming?"
"Because it doesn't know the words!"
;)

jvok
no manz can test innit
no manz can test innit
Posts: 220
Joined: Sun Aug 16, 2020 2:44 pm

Re: jvok's Sleazy Listening stereo coder

Post by jvok » Sun Apr 02, 2023 11:37 am

LeeCavanagh wrote: Sun Apr 02, 2023 12:07 am Would probably sound even better if the source wasn’t a web stream, just sayin.
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 instead

User avatar
3metrejim
no manz can test innit
no manz can test innit
Posts: 147
Joined: Wed Feb 22, 2017 3:00 pm

Re: jvok's Sleazy Listening stereo coder

Post by 3metrejim » Tue Apr 04, 2023 1:42 am

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.

Albert H
proppa neck!
proppa neck!
Posts: 2778
Joined: Tue Apr 05, 2016 1:23 am

Re: jvok's Sleazy Listening stereo coder

Post by Albert H » 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!
"Why is my rig humming?"
"Because it doesn't know the words!"
;)

Shedbuilt
no manz can test innit
no manz can test innit
Posts: 227
Joined: Tue Dec 02, 2014 11:03 am

Re: jvok's Sleazy Listening stereo coder

Post by Shedbuilt » Mon Apr 10, 2023 12:17 pm

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!
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.

jvok
no manz can test innit
no manz can test innit
Posts: 220
Joined: Sun Aug 16, 2020 2:44 pm

Re: jvok's Sleazy Listening stereo coder

Post by jvok » Tue Apr 11, 2023 1:14 am

Layout almost done, just a bit more routing to get right
mpx1.png
You do not have the required permissions to view the files attached to this post.

User avatar
reverend
no manz can test innit
no manz can test innit
Posts: 235
Joined: Sat Jul 25, 2020 12:03 pm

Re: jvok's Sleazy Listening stereo coder

Post by reverend » Tue Apr 11, 2023 12:50 pm

Tidy looking board. Well done!
if it ain't broke, keep tweaking

jvok
no manz can test innit
no manz can test innit
Posts: 220
Joined: Sun Aug 16, 2020 2:44 pm

Re: jvok's Sleazy Listening stereo coder

Post by jvok » Fri Apr 14, 2023 12:57 am

Shrunk the board a bit by condensing things down at the bottom, and added mounting holes
mpx1.png
You do not have the required permissions to view the files attached to this post.

jvok
no manz can test innit
no manz can test innit
Posts: 220
Joined: Sun Aug 16, 2020 2:44 pm

Re: jvok's Sleazy Listening stereo coder

Post by jvok » Sun May 21, 2023 1:01 am

IMG_20230512_202158201.jpg
Long time coming but the boards are finally in and had a chance to test it. Couple of issues on the last schematic - the pilot level pot should have been returned to half rail not ground, and some of the resistor values in the mix stage didn't work out.

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.

User avatar
3metrejim
no manz can test innit
no manz can test innit
Posts: 147
Joined: Wed Feb 22, 2017 3:00 pm

Re: jvok's Sleazy Listening stereo coder

Post by 3metrejim » Sun May 21, 2023 1:48 am

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.

Post Reply