Maybe Interesting dsp thing

158 views
Skip to first unread message

Alan Hopper

unread,
Sep 17, 2026, 12:52:01 PMSep 17
to Hermes-Lite
Hi group,
It is a very long time since I posted here. When this project started my son was a sweet young 10ish year old who in his brief interest in radio was more tempted by old school stuff with loads of knobs and switches. He is now halfway through a rather fine degree called the 'Tonmeister' which is a mix of electronics, acoustics, sound recoding and music and is now doing a placement year at a synthesiser company and creating software models of their hardware. So I'm having many good conversations with him about dsp stuff, very much helped by all the stuff this project got me into. The last one got me thinking as it had not crossed my mind before and I wonder if in some radio sw/firmware it maybe happening. The issue is fairly basic, if you create a square wave in code by the obvious on/off approach it actually contains odd harmonics well beyond whatever sample rate you are using so if it is ever realised through a dac or some sorts of further processing it will contain aliases.
Food for thought.
73 Alan M0NNB

Clifford Heath

unread,
Sep 17, 2026, 9:43:57 PMSep 17
to Alan Hopper, Hermes-Lite
> On 18 Sep 2026, at 2:52 am, 'Alan Hopper' via Hermes-Lite <herme...@googlegroups.com> wrote:
> When this project started my son was a sweet young 10ish year old

That’s a great story - good to hear effects of positive parenting :)

> if you create a square wave in code by the obvious on/off approach

This is a well-known problem with all software defined radios. Image-cancelling downconverters use two mixers driven by square waves in quadrature. The cancellation comes by phase-shifting one of the IF signals and adding or subtracting it to the other to get the band above or below the frequency of the first conversion oscillator.

That initial conversion also down-converts all the odd multiples of the target frequency. 3LO is only 9dB less sensitive than the fundamental. That’s a feature of any converter which uses square-wave drive to the mixers. You need to filter out everything from 3LO up to get a clean signal.

In a really broad coverage receiver (such as the WilySDR I have under design presently) you must have analog filters at least every octave, to filter out the 3LO, 5LO, etc, before they get to the down-converter.

The actual down-converter will fail to adequately cancel the image if the quadrature isn’t good, if the mixers aren’t balanced, if the RF and IF signals are phase shifted, if the pair of low-pass filters which follow the mixer aren’t well-matched in attenuation and phase, or if the addition/subtraction is inaccurate. Most of the advanced chips which integrate these kinds of converters integrate I/Q correction: calibrated mathematical operations which they apply to the digitised I/Q streams. In the ADRV9xxx family, they use a 200MHz ARM CPU to do that, and the ADRV9104 provides 928kB of user-programmable memory in that CPU (presumably the calibration code fits in the 70kB which makes it up to 1MB).

Clifford Heath.

Alan Hopper

unread,
Sep 18, 2026, 2:52:15 AMSep 18
to Hermes-Lite
Hi Clifford,
this is a really good example of where the effect might happen, if you emulated this style of mixer in software and generated the square waves crudely, not only would you have the expected images of the early odd harmonics you could easily have images from the odd harmonics greater than the Nyquist limit aliased back close to the signal of interest at less obvious frequencies.  The discussion with my son was about how to efficiently generate a proper band limited sampled square wave, one simple (but slow) approach is to sum the odd harmonic sine waves up to half the sample rate.  I find it strange that in probably 35 years writing dsp code I don't think I've ever generated a square wave.
73 Alan M0NNB

Reply all
Reply to author
Forward
0 new messages