Sensitive Wideband AM detector

Can also be used as RF-millivoltmeter

Published in SPRAT#200

In many of our short wave radios the simple diode envelope detector is used for amplitude demodulation. It is build from a single diode and some passive parts. It is a very low cost and simple circuit block. Because of this favourable characteristics it can be found in many radios. However, it also comes with drawbacks. Detection of low signals are not handled very well. A Schottky diode has a turn on voltage of circa 0.2V – 0.3V and a standard silicon diode has a knee voltage of around 0.6V. Although it is true that the diode will start to conduct before this, the transfer characteristic is highly non-linear (the so-called quadratic region). It will enable detection of lower level AM signals but at the expense of increased distortion at these levels. The proposed circuit seeks to remedy this.

Concept
The core of the problem is that the voltage to be rectified must be above the threshold value. However, when a current instead of a voltage needs to be rectified, the threshold voltage is no longer important.
In a common emitter amplifier stage, changes in input voltage are translated to changes in the collector current. These current changes are then translated by the collector resistor to changes in the collector voltage. If the collector resistor is swapped with a DC current source as load (figure 1), changes in the collector current (the AC current) will be forced to the load. In this circuit the load of Q1 is formed by a diode rectifier circuit.

Fig.1 – PA3COR – Active Rectifier


Because this stage is current driven, the threshold voltages of D1 and D2 have become largely irrelevant. The resistors R2 converts the rectified current back to a voltage. Another way of looking at this stage is to say that due to the high dynamic resistance of the current load, the open loop gain of Q1 is extremely high. The closed loop gain is determined by R2 and R1 such that Av = R2/(rbe + R1). The values for R1 and R2 are chosen quit low to help in achieving a high bandwidth. With the current values, this translates to a gain of circa 2x.

Continue reading Sensitive Wideband AM detector

Simulating with real audio is awesome and easy!

LTSpice is a fantastic simulation tool that can greatly help in your circuit design. For example, you easily get a bode-plot from a Cauer-filter:

Circuit diagram of two-stage elliptical SSB filter. A cut-off frequency of circa 3.1 KHz and over 80 dB attenuation at 7.5kHz.
Figure -1 – Circuit diagram of two-stage elliptical SSB filter. A cut-off frequency of circa 3.1 KHz and over 80 dB attenuation at 7.5kHz.
Bodeplot of two-stage elliptical SSB filter. Red trace is input, green trace is after first stage, violet trace is final output.
Figure-2 – Bodeplot of two-stage elliptical SSB filter. Red trace is input, green trace is after first stage, violet trace is final output.

To determine how suited an audio filter is for a Morse code, get the impulse response after a tone burst. You can then see how much ringing there is in the filter.

Two-stage CW filter according to the multiple feedback topology. Center frequency is set at 1kHz.
Figure-3 – Two-stage CW filter according to the multiple feedback topology. Center frequency is set at 1kHz.
Input (red) and output (green) traces of a 10 millisecond tone burst of the CW filter. The filter time (63%) is circa 7 ms.
Figure-4 – Input (red) and output (green) traces of a 10 millisecond tone burst of the CW filter. The filter time (63%) is circa 7 ms.

However, one of the really cool, but nevertheless lesser known, features of LTSpice is the ability to use real audio as a source for your circuit simulations. You can thus capture some amateur radio broadcast using your favorite receiver. Be it a crystal receiver or a web SDR receiver and save it as an audio file (wav). This file can now be used as the input for the circuit you are currently simulating. You can thus verify how good your audio filter is before soldering a single component!

Let’s see how the simulation works…

We need to change three small things. First we need to tell the voltage source in our simulation to use a WAV file. Then we need to tell LTSpice to record the output to another WAV file. Finally, we need to change the simulation time to match the length of the input WAV file (more or less).

1. For excitation of the filter an ordinary voltage source can be used. To assign the voltage signals from the WAV file, hold down the CTRL key and right click on the voltage source. This will reveal the Component Attribute Editor, as shown in the figure below.

Component Attribute Editor with the input set to the SSB recording.
Figure-5 – Component Attribute Editor with the input set to the SSB recording.

Change the value line of the Voltage source to wavefile="C:\NameOfYourWaveFile.wav". The full syntax of wavefile command is wavefile="FileName.wav" [chan=<chan#>]. The “FileName.wav” parameter is mandatory. However, you can omit the quotes if there are no spaces in the file or directory name. The channel parameter is optional. Channel can have a value between 0 … 65.535. Channel 0 is used by default if this parameter is omitted. In a stereo file, channel 0 is assigned to the left channel and channel 1 is assigned to the right channel. LTSpice will figure out the sample rate and the number of bits from the file by itself from the file header.

2. Next we need to capture the output and send it to a file. This is done using the LTSpice .wave command.

“Syntax:  .wave <filename.wav> <Nbits>  <SampleRate> V(out) [V(out2) …]

example: .wave C:\output.wav 16 44.1K V(left) V(right)

<filename.wav> is either a complete absolute path for the .wav file you wish to create or a relative path computed from the directory containing the simulation schematic or netlist.  Double quotes may be used to specify a path containing spaces.  <Nbits> is the number of sampling bits.  The valid range is from 1 to 32 bits.
<SampleRate> is the number of samples to write per simulated second.  The valid range is 1 to 4294967295 samples be second. The remainder of the syntax lists the nodes that you wish to save. Each node will be an independent channel in the .wav file.  The number of channels may be as few as one or as many as 65535.  It is possible to write a device current, e.g., Ib(Q1) as well as node voltage.  The .wav analog to digital converter has a full scale range of -1 to +1 Volt or Amp.

Note that it is possible to write .wav files that cannot be played on your PC sound system because of the number of channels, sample rate or number of bits due to limitations of your PC’s codec.  But these .wav files may still be used in LTspice as input for another simulation. See the sections LTspice=>Circuit Elements=>V. Voltage Source and I. Current source for information on playing a .wav file into an LTspice simulation. If you want to play the .wav file on your PC sound card, keep in mind that the more popularly supported .wav file formats have 1 or 2 channels; 8 or 16 bits/channel; and a sample rate of 11025, 22050, or 44100 Hz.” (Source: LTSpice Wiki)

3. In the transient simulation example in the beginning, the simulation time was set to 20 milliseconds. Now we set the simulation time to be equal (more or less) to the length of WAV file. If we set the time span too short, the WAV file is truncated eq. only a small art of the file is used. If we set it longer than the actual length of the file, our simulation will end with silence….
This is done with the command .tran <time> . This whole scheme will only work in transient simulation mode, of course.

Using the fantastic Twente University WebSDR (http://websdr.ewi.utwente.nl:8901/), I’ve recorded two audio samples. The first sample is a 6-7 seconds long recording of a SSB conversation with the bandwidth set to 6.6 (!) kHz. the sample was recorded at 7073 kHz at 1233h CET March 8th 2023. The 2nd sample is a recording of a CW exchange. Again with the bandwidth set to 6.6 kHz and recorded at 7019 kHz at 1227h CET of the same day and has roughly the same length. You can find both recordings at the end of this post.

Two stage elliptical SSB filter with real audio

We are using the passive Cauer Low Pass Filter again that we’ve used at the beginning of this post. We used the Twente WebSDR SSB wav file recording as input.
Using Ctrl-Righ click we open the Component Attribute Editor of V1 and we use the wavefile command to tell LTSpice to use LSB wave file as input.

Circuit of the elliptical filter configured to use real audio in the simulation.
Figure-6 – Circuit of the elliptical filter configured to use real audio in the simulation.

We capture the output of the filter at two places. The output recorded after the first filter (out1) is stored as ssb1.wav . This is done using the .wave c:SSB1.wav 16 44.1K V(out1) command. The output after the 2nd filter ( labelled out2) is recorded as ssb2.wav using the .wave c:SSB2.wav 16 44.1K V(out2) command.
Since the audio captured with WebSDR was a little over 6 seconds, we set the simulation time to 7 seconds with the command .tran 7 .
That’s really all there is to it! Now you can run the simulation and listen to the results. You can listen to the outputs of this filters with ssb1.wav and with ssb2.wav

Multiple feedback CW filter with real audio

The CW filter is the same filter as used in the beginning. This time we use, part of, a CW conversation as input. The file can be found HERE.

CW filter now configured to use real audio in the simulation.
Figure-7 – CW filter now configured to use real audio in the simulation.

It works exactly the same as with the SSB filter. We open the Component Attribute Editor with Ctrl-Right Click and use the wavefile command to use the CW wav file as the input. The output of both filter sections (out1 & out2) are captured with the .wave commands. Finally, the simulation time is set to match the length of the input recording with the .tran 7s command.
The output is recorded after the first filter (out1) and after the 2nd filter and stored as cw1.wav. respectively as cw2.wav.

Downloads

Winner of the G2NJ Trophy !!!

The G2NJ Trophy is sometimes awarded for a really good technical article, and sometimes for an outstanding contribution to international QRP. This year’s winner described a Cross-coupled Double Balanced Product Detector in SPRAT 191. The winner is Cor, PA3COR”
Steve G0FUW, Sprat 194

Needless to say it was a complete surprise! I feel very honored with this!
I looked up who has been awarded this trophy in recent years and then I felt completely hunbled! I can hardly believe it…

You can find the original article HERE.

NE602 40m DC Receiver

Updated : January 25th; Input amplifier
Updated : January 26th; Audio filter

A couple of days ago I found the circuit of 20m DC PSK31 receiver at the website of va3iul. The website of va3iul is probably well known in the radio amateur community. It features 100’s of circuit design ideas on all kind of topics related to RF design : oscillators, noise sources, filters, phase shifters, it is all there.

Now my google search came up with an image of a 20m PSK31 receiver designed by DG2XK hosted by va3iul. it didn’t state in which magazine it was originally published and it did not show the component values.

20m PSK31 DC receiver by DK2SK
Continue reading NE602 40m DC Receiver

Simple remote numeric keypad with ATmega88

Numeric keypad for radio control
Numeric keypad for radio control
Continue reading Simple remote numeric keypad with ATmega88