Silicon ChipCircuit Surgery - February 2024 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Subscriptions: PE Subscription
  4. Subscriptions
  5. Back Issues: Hare & Forbes Machineryhouse
  6. Publisher's Letter: Teach-In 2024
  7. Feature: Cheeky chiplets by Max the Magnificent
  8. Feature: Net Work by Alan Winstanley
  9. Project: Active Mains Soft Starter by John Clarke
  10. Project: ADVANCED SMD TEST TWEEZERS by Tim Blythman
  11. Project: Active Subwoofer For Hi-Fi at Home by Phil Prosser
  12. Feature: Max’s Cool Beans by Max the Magnificent
  13. Feature: Circuit Surgery by Ian Bell
  14. Feature: MITCHELECTRONICS by Robin Mitchell
  15. Project: Audio Out by Jake Rothman
  16. PCB Order Form
  17. Advertising Index: Bush MB60 portable radio by Ian Batty

This is only a preview of the February 2024 issue of Practical Electronics.

You can view 0 of the 72 pages in the full issue.

Articles in this series:
  • (November 2020)
  • Techno Talk (December 2020)
  • Techno Talk (January 2021)
  • Techno Talk (February 2021)
  • Techno Talk (March 2021)
  • Techno Talk (April 2021)
  • Techno Talk (May 2021)
  • Techno Talk (June 2021)
  • Techno Talk (July 2021)
  • Techno Talk (August 2021)
  • Techno Talk (September 2021)
  • Techno Talk (October 2021)
  • Techno Talk (November 2021)
  • Techno Talk (December 2021)
  • Communing with nature (January 2022)
  • Should we be worried? (February 2022)
  • How resilient is your lifeline? (March 2022)
  • Go eco, get ethical! (April 2022)
  • From nano to bio (May 2022)
  • Positivity follows the gloom (June 2022)
  • Mixed menu (July 2022)
  • Time for a total rethink? (August 2022)
  • What’s in a name? (September 2022)
  • Forget leaves on the line! (October 2022)
  • Giant Boost for Batteries (December 2022)
  • Raudive Voices Revisited (January 2023)
  • A thousand words (February 2023)
  • It’s handover time (March 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • Prophecy can be perplexing (May 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • How long until we’re all out of work? (August 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • Holy Spheres, Batman! (October 2023)
  • Where’s my pneumatic car? (November 2023)
  • Good grief! (December 2023)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (February 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk (July 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk (November 2024)
  • Techno Talk (December 2024)
  • Techno Talk (January 2025)
  • Techno Talk (February 2025)
  • Techno Talk (March 2025)
  • Techno Talk (April 2025)
  • Techno Talk (May 2025)
  • Techno Talk (June 2025)
Items relevant to "Active Mains Soft Starter":
  • Active Mains Soft Starter PCB [10110221] (AUD $10.00)
  • PIC12F617-I/P programmed for the Active Mains Soft Starter [1011022A.HEX] (Programmed Microcontroller, AUD $10.00)
  • Firmware for the Active Mains Soft Starter [1011022A] (Software, Free)
  • Active Mains Soft Starter PCB pattern (PDF download) [10110221] (Free)
  • Active Mains Soft Starter lid panel artwork (PDF download) (Free)
Articles in this series:
  • Active Mains Soft Starter, Part 1 (February 2023)
  • Active Mains Soft Starter, Part 2 (March 2023)
  • Active Mains Soft Starter (January 2024)
  • Active Mains Soft Starter (February 2024)
Items relevant to "ADVANCED SMD TEST TWEEZERS":
  • Advanced/ESR Test Tweezers back panel PCB (blue) [04105242] (AUD $2.50)
  • Advanced SMD Test Tweezers PCB set [04106221+04106212 {blue}] (AUD $10.00)
  • PIC24FJ256GA702-I/SS programmed for the Advanced SMD Test Tweezers (0410622A.HEX) (Programmed Microcontroller, AUD $15.00)
  • 0.96in cyan OLED with SSD1306 controller (Component, AUD $10.00)
  • Advanced SMD Test Tweezers kit (Component, AUD $45.00)
  • Firmware for the Advanced SMD Test Tweezers [0410622A.HEX] (Software, Free)
  • Advanced SMD Test Tweezers PCB patterns (PDF download) [04106221+04106212] (Free)
  • Advanced SMD Test Tweezers sticker artwork (PDF download) (Panel Artwork, Free)
Articles in this series:
  • Advanced Test Tweezers, Part 1 (February 2023)
  • Advanced Test Tweezers, Part 2 (March 2023)
  • ADVANCED SMD TEST TWEEZERS (January 2024)
  • ADVANCED SMD TEST TWEEZERS (February 2024)
Items relevant to "Active Subwoofer For Hi-Fi at Home":
  • Bookshelf Speaker Passive Crossover PCB [01101201] (AUD $10.00)
  • Bookshelf Speaker Subwoofer Active Crossover PCB [01101202] (AUD $7.50)
  • Bookshelf Speaker Passive and Active Crossover PCB patterns (PDF download) [01101201-2] (Free)
  • Bookshelf Speaker System timber and metal cutting diagrams (PDF download) (Panel Artwork, Free)
Articles in this series:
  • Easy-to-build Bookshelf Speaker System (January 2020)
  • Building the new “bookshelf” stereo speakers, Pt 2 (February 2020)
  • Building Subwoofers for our new “Bookshelf” Speakers (March 2020)
  • Stewart of Reading (October 2023)
  • Stewart of Reading (November 2023)
  • ETI BUNDLE (December 2023)
  • Active Subwoofer For Hi-Fi at Home (January 2024)
  • Active Subwoofer For Hi-Fi at Home (February 2024)
Articles in this series:
  • Audio Out (January 2024)
  • Audio Out (February 2024)
  • AUDIO OUT (April 2024)
  • Audio Out (May 2024)
  • Audio Out (June 2024)
  • Audio Out (July 2024)
  • Audio Out (August 2024)
  • Audio Out (September 2024)
  • Audio Out (October 2024)
  • Audio Out (March 2025)
  • Audio Out (April 2025)
  • Audio Out (May 2025)
  • Audio Out (June 2025)
Circuit Surgery Regular clinic by Ian Bell Frequency shifting and superheterodyne receivers – Part 3 I n the last two issue we have been looking at superheterodyne radio receivers. We started with the principles of heterodyning (frequency shifting) and the mixers that provide this function. Last month, we discussed the structure and operation of superheterodyne radio receivers in more detail, up to the intermediate frequency stage. This month, we look at demodulation. Recap of superhet operation The principle of the superheterodyne receiver is based on frequency shifting (heterodyning) to a fixed intermediate frequency (IF) before further shifting to the baseband to recover the message signal. The fact that the IF is a fixed frequency makes the design of a receiver easier than if most of the circuitry has to cope with (be tuneable to) the full range of carrier frequencies which need to be received. Heterodyning is achieved using mixers. These are nonlinear circuits (ideally multipliers) that combine signals to produce new frequencies (heterodynes) not present in the input. With two input frequencies (two sinusoidal inputs) multipliers output just the sum and difference frequencies, whereas with other nonlinear circuits there may be many other output frequencies. Fig.1 shows the structure of a superheterodyne receiver to the IF stage. The mixer combines the received signal (carrier frequency, f c) with the local oscillator frequency (fLO), which may be at a higher (high-side injection) or lower (low-side injection) frequency than the carrier. With a high-side local oscillator, the mixer produces signals at (fLO – fc) and Fig.2. Waveform of filtered IF mixer output from the receiver in Fig.1. (fLO + fc), with their sidebands (message bandwidth). We only need to use one of these signals as the IF signal for further processing (eg, fIF = fLO – fc) so the other is removed by the IF filter. The IF filter also removes frequencies resulting from the presence of other radio stations/ channels and those due to non-ideal behaviour of the mixer. The receiver is tuned by the local oscillator frequency and the majority of unwanted signals are removed by the IF filter. The IF is at fixed frequency, so it is easy to create a filter with high performance at low cost. There is one unwanted signal which the IF filter cannot remove – this is called the image frequency and is due to the second received frequency (station/ channel) that the mixer will shift to fIF. For example, if we want fIF = fLO – fc then the image frequency fIm, where fIm = fc + fLO will also be shifted to fIF by the mixer. As this is at the same frequency as the wanted signal it cannot be removed after the mixer. This requires a filter before Mixer Image filter RF amp IF filter IF amp To detector the mixer, called the image filter or preselection filter, which may be tuneable to track with the local oscillator. However, the requirements for this filter are a lot less severe than if we tried to filter the required station/channel directly from the RF signal received from the antenna. Demodulation The process of recovering the message signal from the IF signal is called demodulation or detection. There are a range of modulation techniques – one or more of the carrier’s amplitude, frequency and phase can be modulated, and the demodulation used must be appropriate for the received signal. To keep things simple, we are only considering amplitude modulation (AM) here. Using AM and with a sinusoidal message signal the IF signal looks like the lower waveform in Fig.2. The upper waveform is the message that we need to recover. These waveforms are from the simulations discussed last month. As previously noted, the frequencies and Introduction to LTspice Fig.1. Superheterodyne receiver structure. Want to learn the basics of LTspice? Ian Bell wrote an excellent series of Circuit Surgery articles to get you up and running, see PE October 2018 to January 2019, and July/August 2020. All issues are available in print and PDF from the PE website: https://bit.ly/pe-backissues 48 Practical Electronics | February | 2024 Tuning Local oscillator Modulated signal D1 Ideal diode Rectified signal R1 Fig.6. Rectifying an AM signal. Fig.3. Spectrum of filtered IF waveform from the receiver in Fig.1. Magnitude As discussed last month, the message is in the sidebands of the modulated signal, which are above and below the centre frequency. This implies that one of the sideband will have negative frequencies (see Fig.4), which may seem strange. In fact, negative frequencies are a consequence of the mathematics of frequency domain representation of signals (Fourier transform) which is related to the use of complex numbers to represent signals and the need to consider both amplitude and phase. A sinusoidal wave has equal-amplitude positive and negative frequencies when plotted as a spectrum which includes negative frequencies. AM modulated signal centred on fIF 0 fIF Mix with fIF f Magnitude Original message signal 0 f Fig.4. Downshifting to DC can be used to demodulate an AM signal. relative frequencies used in our examples are chosen to make the waveforms easy to view and are not representative of typical radio signals. As discussed previously when discussing radio systems, it is common to look at the spectra (amplitude vs frequency plots) of the signals of interest. The spectrum of the IF signal from Fig.2 is shown in Fig.3. Looking at Fig.2 and Fig.3 we can see possible ways to recover the message signal. In Fig.2 we can see that if we ‘joint the dots’ of the signal peaks we obtain a sinusoidal at the message frequency. We can recover the message from an AM signal by following the amplitude envelope of the waveform – this is known as envelope detection, which we will look at in more detail shortly. Alternatively, looking at the spectrum, we could mix the received IF signal (at fIF) with an oscillator output at fIF. This will produce sum and difference frequencies of (fIF – fIF = 0; ie, DC) and (fIF + fIF = 2fIF). The 2fIF (and other unwanted frequencies) can be removed using a low-pass filter leaving the signal that is shifted to DC, which is the original message. This is illustrated in Fig.4. We will look at demodulation using this approach later. Envelope t Modulated signal Fig.5. Amplitude-modulated signal and its envelope. Fig.7. LTspice schematic for investigating the envelope detector. Practical Electronics | February | 2024 Envelope demodulator An envelope demodulator (or envelope detector) outputs a signal which tracks the peaks of a waveform, as shown in Fig.5. It should be clear that this only works if just the positive or negative peaks are tracked (Fig.5 uses the positive peaks). This implies that the envelope detector circuit must rectify the signal. Usually, in basic receivers, this is halfwave rectification (see Fig.6) which removes the peaks of one polarity, but full-wave rectification could be used. The circuit in Fig.6 shows a half wave rectifier using a single diode, which can form part of an envelope detector. The diode alone is not sufficient as the output does not track the envelope. The modulated signal must be larger in amplitude than the diode switch-on (forward) voltage, otherwise part of the signal will be lost. More specifically, with reference to Fig.5, the minimum envelope voltage must be greater than the forward voltage – however, for simplified simulations to illustrate principles of operation we can use an ideal diode (zero forward voltage). Fig.7 shows an LTspice schematic which can be used for investigating the envelop detector. This includes the rectifier just mentioned, and the envelope detector which we will discuss shortly. The AM signal is generated using the approach that was discussed last month. The simulation results for the rectifier are shown in Fig.8. This uses different frequencies for the sources from those shown in Fig.7 (1kHz modulated onto 20kHz). The .model statement is used to define a close-to-ideal diode. 49 Fig.9. Envelope detector. D C RO the effective resistance of the diode. Assuming that RD is much smaller than the output resistor RO we can ignore RO, and assume that the capacitor will charge to the input voltage via RD. This leads to a charging time constant of tc = RDC. An RC time constant (t) is the time required to charge a capacitor through a resistor from zero to about 63% of the value of an applied DC voltage and provides a figure for the ‘speed’ of the circuit. In this case, we need the charge time to be much faster than one cycle time of the carrier cycle time (1/fc) so that the voltage tracks the carrier (see Fig.10). This depends on the capacitor and effective diode resistance and should usually be straightforward to meet D as long as the value of Vi VO C is not very large. RO C When the diode Vi > VO Vi < VO is reverse biased the D reverse biased D forward biased envelope detector C slow discharge C fast charge τd = ROC τC = ROC behaves as the circuit RD shown on the bottom Vi VO Vi VO right of Fig.11, where the diode is open circuit. C RO C RO The circuit will enter this state once the input voltage falls below the capacitor voltage (strictly speaking below Fig.11. Equivalent circuits for envelope detector. the capacitor voltage plus diode forward voltage) as we pass a peak in the input waveform (see Fig.10). The capacitor will discharge through the output resistor with a discharge time constant of td = ROC. The discharge time constant must be much longer than the carrier cycle time (1/fc) but much shorter than the minimum message cycle time (1/ fm). Suitable choices of RO and C should be able to achieve this. Fig.12 to Fig.14 show waveforms for the envelope detector in Fig.7 with different time constants. The message frequency is 1kHz, which implies the discharge time constant must be much shorter than 1/1000 = 1ms. The carrier frequency is 100,000kHz, which implies the discharge time constant must be longer than 1/100000 = 10ms. A value between these, say td = 100ms, is a suitable choice. If we use a 100nF capacitor, then an output resistor of RO = 1/tdC = 1kΩ is suitable (as shown in Fig.7, where the output resistor is R1). Fig.12 shows the modulated and demodulated waveforms using these values. The envelope detector is working well. The ripple on the demodulated waveform can be removed using a lowpass filter to obtain a good copy of the original message signal. There is a DC offset which can be removed by AC coupling or high-pass filtering. Fig.13 shows the modulated and demodulated waveforms with R1 changed to 10kΩ. The discharge time constant is too long. When the envelope is rising the circuit works well, holding the peak value nearly constant, but as the envelope falls the circuit is not able to discharge fast enough and loses track of the envelop. Fig.13 shows the modulated and demodulated waveforms with R1 changed to 100Ω. The discharge time constant is too short so that the output follows the carrier too much, producing a very large ripple amplitude. An envelope detector can be used directly on the received radio signal, after a bandpass filter (or a set of tuned bandpass amplifiers to tune in the required station or channel). This approach was used in early receivers, and some radio ICs first developed in the 1970s, but has much lower performance than the superheterodyne approach because the whole system has to be tuned, and/or suffers reduced performance as the received frequency changes. 50 Practical Electronics | February | 2024 Fig.8. Simulation results for the rectifier from Fig.7 (using 1kHz modulated onto 20kHz). Fig.10. Peak detector operation (simulation results from Fig.7). To track the envelope, it is necessary to hold the voltage of the rectified waveform peak until the next peak. This can be achieved with a capacitor – see Fig.9. The capacitor must charge quickly, following the carrier waveform to the peak voltage, but must discharge more slowly to hold the peak voltage sufficiently well until the next peak (see Fig.10). The envelope detector has two states of operation depending on whether the diode is forward or reverse biased – we can draw two equivalent circuits, as shown in Fig.11. When the diode is forward biased the envelope detector behaves as the circuit shown on the bottom left of Fig.11, where R D is Fig.12. Waveforms for the envelope detector in Fig.7 with C1 = 100nF and R1 = 1kΩ. Fig.13. Waveforms for the envelope detector in Fig.7 with C1 = 100nF and R1 = 10kΩ. Fig.14. Waveforms for the envelope detector in Fig.7 with C1 = 100nF and R1 = 100Ω. Using mixers for demodulation As mentioned above, in theory we can demodulate AM by downconverting from the IF to baseband using a mixer. It is also possible to use a mixer to go straight from the received RF to baseband – this requires a local oscillator at exactly the same frequency as the carrier and is referred to as ‘direct conversion receiver’ (see Fig.15), it is also called a ‘homodyne receiver’. This approach will work, but there are a number of difficulties and non-ideal behaviours which must be taken into account. An LTspice simulation schematic for a direct conversion receiver is shown Mixer Bandpass filter RF amp Low-pass filter fc Practical Electronics | February | 2024 Fig.15. Direct conversion receiver. Fig.16. This has a structure very similar to the superhet circuit in Fig.8 last month; however, the local oscillator frequency is now equal to the carrier frequency, the filters are lowpass in baseband range (5kHz) because we are downconverting directly to baseband. We can also use a mixer to downconvert the IF to baseband in a superhet, in which case an oscillator at the IF is required. The direct conversion receiver has fewer blocks so is simpler to use. A difficulty with using a mixer to demodulate AM is that the phase difference between the carrier and local oscillator affects the amplitude of the demodulated signal; for this reason the carrier and local oscillator sources have the phase specified on 51 Fig.17. Carrier source from Fig.16 with phase set to 60°. Fig.16. LTspice simulation schematic for a simple direct conversion receiver. the schematic in Fig.16. The phase of a sinusoidal source can be set in LTspice by right clicking on the source symbol and entering the value (in degrees) in the Phi(deg) box of the source settings dialog. Fig.17 shows the carrier source phase set to 60°. Fig.18 to Fig.20 show the mixer output (demod) and filtered baseband signal for 0°, 60°and 90° phase difference between the transmitted carrier and local oscillator. At 60° the amplitude is diminished and at 90° the demodulated output is zero. Additional mechanisms are required to ensure the correct phase difference is maintained if this approach is used. Quadrature demodulation Fig.20. Simulation results from the circuit in Fig.16 with 90° phase difference between carrier and local oscillator. A solution to the phase difference problem is to use what is known as a quadrature demodulator. This uses two mixers fed with signals 90° out of phase (see Fig.21). The term quadrature comes from ‘quarter’ because 90° is a quarter of a complete rotation of 360°. The output of the mixers (after filtering to remove unwanted frequencies) are referred to as the in-phase (I) and quadrature (Q) signals. Quadrature demodulators are also referred to a I/Q demodulators. The I and Q signals can be combined to obtain a constant amplitude demodulated output by calculating √(I2+Q2) (they cannot simply be added because of the 90° phase difference). This could be done using analogue circuitry but is typically performed using digital signal processing (DSP). Although it is not required for simple AM demodulation, the I and Q signals can also be used to calculate phase, which can be used with phase or combined phase/amplitude modulation. Connecting the circuit in Fig.21 to the output of the superhet receiver in Fig.1 creates a ‘dual conversion receiver’ which requires two low-frequency (baseband) analogue-to-digital converters (ADCs) to digitise the I and Q signals for further processing. However, the DSP is not limited to the baseband and the functionality shown in Fig.21 can be implemented digitally with the IF digitised using a single high-speed ADC. Fig.22 shows an LTspice schematic based on Fig.22. Sources V 3 and V4 generate the two local oscillator signals with 90° phase difference. The demodulated output is calculated 52 Practical Electronics | February | 2024 Fig.18. Simulation results from the circuit in Fig.16 with 0° phase difference between carrier and local oscillator. Fig.19. Simulation results from the circuit in Fig.16 with 60° phase difference between carrier and local oscillator. Fig.22. LTspice simulation schematic for a quadrature decoder for AM. using behavioural source B 4 with V=sqrt(v(I)*v(I) + v(Q)*v(Q)). Other parts of the schematic are similar to previous examples. Fig.23 to Fig.25 show the Q and I and demodulated signals for 0°, 60° and 90° phase difference between the transmitted carrier and local oscillator. Mixer Low-pass filter Local oscillator Processing 90° phase shift Fig.23. Simulation results from the circuit in Fig.22 with 0° phase difference between carrier and local oscillator. Low-pass filter Mixer Fig.21. Basic quadrature demodulator. Fig.24. Simulation results from the circuit in Fig.22 with 60° phase difference between carrier and local oscillator. The I and Q signal amplitudes vary as phase difference changes, but the final demodulated output is constant. Quadrature techniques are widely used in radio systems and are not restricted to AM demodulation. Two inputs (I and Q) can be used to modulate both the amplitude and phase of a carrier at the transmitter, referred to as ‘QAM’. The quadrature demodulator can recover both phase and amplitude. This is commonly used for digital transmission because digital codes can be mapped to various combinations of phase and amplitude. Simulation files Fig.25. Simulation results from the circuit in Fig.22 with 90° phase difference between carrier and local oscillator. Practical Electronics | February | 2024 Most, but not every month, LTSpice is used to support descriptions and analysis in Circuit Surgery. The examples and files are available for download from the PE website: https://bit.ly/pe-downloads 53