Forkcasting
As clear as a puddle of mud

Radio basics: CW

How do we send and receive Morse code?

I recently got my basic amateur radio certificate. It was a lot of fun and I want to share some of what I've learned. I found this information hard to find or scattered, so I'll take a run at it.

This blog post explains how CW works conceptually, not how to build a CW transmitter or receiver.

What's CW?

CW stands for "continuous wave", which is a bit of a misnomer. We use it to send Morse code by interrupting the radio wave. We send Morse by tapping a key. A short press is a 'dit' and a long press is a 'dah'. Various sequences mean different letters, for example, 'R' is dit-dah-dit. You'd probably recognise it from films, even if you didn't know the name.

A waveform showing the Morse code letter 'R'.

A waveform showing the Morse code letter 'R'

Carrier pidgeon?

Now, we need something to send our signal. Radio works!

There's two main problems sending Morse code by just turning the power to the antenna on-and-off by hand.

First, we only see radio wave emission when electrons are accelerating. If we sent the signal above we would see a very short burst as the transmitter was turned on or off, but nothing else while the signal was un-changing between. We need an alternating current so the electrons in the antenna are constantly accelerating.

Next, we need to make our antenna with a reasonable size. We roughly tune the antenna size to the wavelength, otherwise they don't radiate very well. They just reflect the power back into the transmitter, possibly damaging it. Since radio waves travel very fast, a signal with a 1 kHz signal travels about 300 km every cycle. Our antenna length needs to be comparable to this to transmit well.

So we need a high frequency signal to make the antenna a reasonable size. We call this the carrier. 7 MHz is fairly common.

A waveform showing a carrier signal

A waveform showing a carrier signal

Modulate it

Modulation is easy, both practically and mathematically.

Practically speaking, you connect your RF oscillator to your output then disconnect it. Do this at the right times and you have CW

Mathematically. you can think of "no signal" as a 0 and "send the signal" as 1. 0 * x = 0 for all x, so this is sending no signal. Similarly, 1 * x = x, so this is sending a signal. You just multiply the signal and the carrier.

A waveform showing a CW modulated carrier

A waveform showing a CW modulated carrier

Problems

There are some noticable problems with simple CW transmitters: key clicks and chirp.

Noise is much less noticable problem in CW than most other modes, but now's a good time to introduce it.

Key clicks

Every signal is secretly a sum of every possible sine wave. The main difference is how strong each one is.

The telegraph key makes a square-ish wave, which has lots of different frequencies. You need all of those extra frequencies to make the corners "sharp". However, these extra frequencies spill out from your intended frequency. This makes a "clicking" noise on radio frequencies quite far from your intended frequency, irritating other people.

The usual way to fix key clicks is to put the output through a low-pass filter. This only lets your intended RF frequency through. We won't go into key clicks here.

Chirp

Sadly, our radios aren't magical. When you have no load on the oscialltor, the current draw is low. However, if you load the output, the current can increase. This makes the components of the osicalltor warm up, which changes their properties and the overall frequency of the oscillator.

This gives the dits and dahs a strange sound. It changes tone as you hold the key down, a bit like a slide whistle.

In severe cases your frequency can drop so low that your transmission interferes with another's. That's a big no-no. Fortunately, most cases aren't that severe, so it just sounds a little funny on the receiver.

To fix this we don't draw directly from our RF oscillator. We put it through a buffer stage. We key the buffer, not the osciallator. We won't go into chirp here.

Noise and interference

Every signal picks up some errors. We call these errors "noise." Practically speaking, the received signal will look a little like the signal below. There's never a time when "no signal" is exactly nothing, and the carrier wave gets a little bounced around.

The noise is impossible to remove because some of it comes from within the circuits we build. Some comes from the environment too. Some even comes from space.

One of the most common sources of interference is our power supply. It's 60 Hz AC here in Canada, so you might here a pronounced, low pitch "hum" on your radio from time to time. This low-frequency interference is often just called "hum," but there are other sources.

A waveform showing a CW modulated carrier with noise and hum

A waveform showing a CW modulated carrier with noise and hum

We will work out how to deal with noise and hum because it's so much of "receiving" the signal.

Do you copy?

Just plug your antenna into your headphones, job done! Except, you need to be able to hear the RF carrier at 7 MHz, even though human hearing only goes up to 20 kHz (about 350x too low). Plus, your headphones probably can't actually move at 7 MHz. We need an audio wave. To do this, we have a three-step process:

  1. "Beat" or "mix" it with a local oscillator. This is called a product-detector.
  2. Remove the high-frequency noise with a low-pass filter.
  3. Remove the low-frequency hum with a high-pass filter.

Just beat it

In a perfect world with no noise, we can just multiply the incoming signal with a local oscialator. We call this "mixing" or that we have "beat" the incoming signal with the local oscillator.

A waveform showing an ideal received CW signal multiplied by a local oscillator and filtered.

A received CW signal multiplied by a local oscillator and filtered.

Notice that it is flat where there's no signal, and has an audio wave where there is signal. That audio wave is the beat frequency. This beat frequency comes from the peaks of received signal and gradually drifting in and out of sync with the peaks of the local oscillator. Where they're perfectly in sync we see a very strong signal, and no signal when they're perfectly out of sync.

The frequency of this drift is called the beat frequuency. It is exactly the difference between the two signals. If you want a 1 kHz tone when receiving a 7 MHz transmission, you'd choose a 7.001 MHz local oscillator because 7.001 MHz - 7.000 MHz = 0.001 MHz = 1 kHz.

The left-over high-frequency components is the sum of the two frequencies. Not audible, but often annoying. A low pass filter mostly removes them, leaving an audio signal.

However, a "real" signal with noise and hum looks very different when we beat it. It has many beat frequencies: the incoming signal, the hum, the high frequencies from the noise. It's a mess, but our audio signal is hiding in there.

A waveform showing a received CW signal multiplied by a local oscillator.

A received CW signal multiplied by a local oscillator.

Low-pass filter

First, we need some way to take out the carrier and noise. We're in luck here -- most noise is a lot of high frequencies, and the RF carrier is also a much higher frequency that we want. We use a low-pass filter to let only audio frequencies through.

A waveform showing a demodulated CW signal after a low-pass filter

A waveform showing a demodulated CW signal after a low-pass filter

Better! Still not perfect but a significant improvement. A lot of the noise is gone, and so is the RF carrier. While this isn't perfect, it would still probably sound better.

High-pass filter

Last, we get rid of the hum. We use a high-pass filter that will block low-frequency signals, but still keep the audio signal we want. Combining the low and high-pass filters gives us a band-pass filter, which only allows signals between two frequencies through.

A waveform showing the recovered audio signal

The recovered audio signal after a high-pass filter

That's it! Our audio wave, polluted by noise, but still clearly visible. It lines up nicely with the dit-dah-dit we sent. We can send this to an audio amplifier and get reasonable quality output.

Conclusion

There's a lot that I skipped over here:

  1. Mixing signals in an analogue system. It's obvious in a digital system, but not so clear with an analogue system.
  2. Filter signals with digital or analogue tools. There's some fun maths in digital filters.
  3. Building oscillators, amplifiers, antenna, and so on. Oh so much fun with electronics.

However, this should give you a basic conceptual understanding of how most CW transceivers work. Sending: Turn it off and on again. Receiving: Just beat it, then filter it.

One final note: The receiver chooses the audio frequency they want to listen to by choosing their local oscillator frequency. If you don't like 750 Hz, just change the frequency!