next_inactive up previous
Up: W9CF Links

Spectral Analysis of a CW keying pulse

Kevin Schmidt, W9CF
6510 S. Roosevelt St.
Tempe, AZ 85283

October 6, 2001

1 Introduction

This problem was brought to my attention by Tom Rauch, W8JI, who, in his note to me, had described his experience and correctly pointed out all the main features that govern the bandwith. These notes are an expanded version of my reply giving the mathematical explanation.

To fit the most CW signals into the available spectrum, we need to limit the bandwidth taken up by the signals. It is therefore useful to see how the energy in a dot or dash pulse is distributed around the carrier frequency. Here I give some notes on how to make this analysis. The main result is that the spectrum for many keying shapes is given by the product of the spectrum of a square pulse times the spectrum of the slope of the rise and fall behavior of the pulse.

It seems from my experience reading morse, that the rise time should be the main factor in producing code that can be read by ear comfortably. Since the rise time dominates the bandwidth for the usual CW signal, the analysis shows that to get a nearly optimal bandwidth to rise time, the keying pulse shape should have a gaussian slope.

In the next section I review basic Fourier analysis of amplitude modulation. I then calculate the spectrum of a pulse with an exponentially shaped rise and fall as would be produced by simple RC networks. The results suggest the more general analysis in the following section, with the conclusion that a pulse with gaussian slope, i.e. error function rise and fall shapes, will have an optimal bandwidth and rise time.

It seems likely that all of this would have been worked out by radio engineers in the early 1900s when CW signals were first employed.

2 Fourier analysis for amplitude modulation

To analyze the spectrum generated by keying a transmitter let's look at a single ``dot.'' If we imagine we have a carrier with angular frequency $\omega_0$, and we amplitude modulate it with an envelop A(t), we get the amplitude of the signal from the transmitter is

f(t) = A(t) \cos(\omega_0 t)
\end{displaymath} (1)

To calculate the energy spectrum we Fourier transform this to get
\tilde f(\omega) = \int_{-\infty}^\infty dt
A(t) \cos(\omega...
\tilde A(\omega-\omega_0)
+\tilde A(\omega+\omega_0) \right ]
\end{displaymath} (2)

\tilde A(\omega) = \int_{-\infty}^\infty dt A(t) e^{i \omega t}  .
\end{displaymath} (3)

In the usual case, the modulation $A(t)$ contains frequency components much smaller than the carrier frequency. Therefore the $\tilde A(\omega+\omega_0)$ is negligible and can be ignored. The energy spectrum of the amplitude modulated signal is therefore given by

P_0(\omega) = \frac{1}{4\pi} \vert\tilde A(\omega-\omega_0)\vert^2
\end{displaymath} (4)

and since $A(t)$ is real, $\tilde A(\omega) = \tilde A^*(-\omega)$, and the sidebands are symmetric around the carrier frequency.

It is convenient to write

P(\omega) = P_0(\omega+\omega_0)
\end{displaymath} (5)

so that $\omega$ here is the frequency difference from the carrier, so that $P(\omega)$ gives the energy distribution for an angular frequency of $\omega$ from the carrier angular frequency. I will call $P(\omega)$ the sideband energy density.

3 Application to Keying Bandwidth

To get an explicit result, I'll assume an explicit form for a keying waveform. A simple form where the Fourier transforms can be calculated analytically is the case where the wave builds up exponentially (as in the usual $RC$ circuit) to the carrier value when the key is pressed, and then decays exponetially to zero when the key is released. That is

A(t) = \left \{
0 & t < 0\\
...- e^{-T/\tau}) e^{-(t-T)/\tau} & t > T \\
\end{array}\right .
\end{displaymath} (6)

where $T$ is the keying pulse width and $\tau $ is its time constant. A plot of this waveform is shown in figure 1 for the cases where $\tau $ is 4 milliseconds, and $T$ is 20 and 50 milliseconds.

Figure 1: The exponential keying waveforms for a time constant $\tau $ of 4 milliseconds and durations of 20 and 50 milliseconds. The 50 millisecond pulse begins at $t=100$ milliseconds to separate it from the 20 millisecond pulse.

The fourier transform integral of the amplitude is straightforward and gives

\tilde A(\omega) = -\left [ e^{i \omega T}-1 \right ]
\frac{1}{i \omega (i \omega \tau -1)}
\end{displaymath} (7)

so that the sideband energy density) becomes
P(\omega) =
\frac{\sin^2 \left ( \frac{\omega T}{2} \right )}{\omega^2}
\end{displaymath} (8)

So the sideband energy density has two factors. If we measure it in dB relative to some fixed value, we add the logarithms of the factors. The only dependence on $T$ comes from the first factor. The $\sin^2$ function is always less than or equal to 1, so this will subtract from the other factor which only depends on $\tau $ the time constant which determines the rise time.

The main features of the sidebands will therefore be given by the rise time, while the length of the pulse will modify those features somewhat.

Figures 2 and 3 show the energy density in dB referenced to the carrier energy density for $T$ of 20 milliseconds. The curves are plotted together in figure 4. Each curve is plotted versus frequency $f = \omega/2\pi$.

Figure 2: The sideband energy density for an exponential keying wave form with $\tau =4$ milliseconds and $T$ of 20 milliseconds. The carrier energy density is set to 0 dB.

Figure 3: The sideband energy density for an exponential keying wave form with $\tau =4$ milliseconds and $T$ of 50 milliseconds. The scale is the same as figure 2.

Figure 4: The plots of figures 2 and 3 combined.

Notice that the differences between the 20 millisecond and 50 millisecond pulses are first the energy near the carrier frequency is larger for the longer pulse as needed since it has about 2.5 times as much energy, and second the ``ringing'' has more oscillations for the longer pulse as expected. The sidebands fall off 12 dB per octave once we are at frequencies beyond about $1/\tau$.

The effect of the keying speed on the bandwidth as long as the rise time is small compared to pulse length is the change in shape of the central peak. It does get narrower for slower keying and wider for faster keying, however, the keying speed does not effect the overall bandwidth.

4 General Pulse Shape

I can write a general pulse shape as
A(t) = E_r(t+T/2)-E_f(t-T/2)
\end{displaymath} (9)

where $E_r$ and $E_f$ describe the rising and falling edges of a pulse and are positive functions that go to zero at large negative $t$ and to 1 at large positive $t$. The Fourier transform of $A$ is the sum of the transforms of the two terms. If the rising and falling edges have the same form, we can write
A(t) = E(t+T/2)-E(t-T/2) = \int_{-\infty}^\infty dt' [\delta(t+T/2-t') -
\delta(t-T/2-t') ] E(t')
\end{displaymath} (10)

and integrating by parts gives the result
A(t) = -\int_{-\infty}^\infty dt' S(t-t') \frac{dE(t')}{dt'}
\equiv -\int_{-\infty}^\infty dt' S(t-t') E'(t')
\end{displaymath} (11)

where $S(t)$ is a square pulse of width $T$,
S(t) = \left \{
1 & \vert t\vert < \frac{T}{2} \\
0 & \vert t\vert > \frac{T}{2} \\
\end{array}\right .
\end{displaymath} (12)

and I have defined $E'$ to be the derivative of $E$.

Since $A(t)$ is written as a convolution, its Fourier transform is now the product

\tilde A(\omega) = \tilde S(\omega) \tilde E'(\omega)  .
\end{displaymath} (13)

For keying wave forms this has the nice interpretation that the spectrum is given by the spectrum of a square pulse of length $T$ multiplied by a factor that is the Fourier transform of the slope of the rise and fall wave form.

Except for an unimportant change of the zero of time, the exponential case calculated above can be written as

E(t) = \left \{
0 & t < 0\\
1-e^{-t/\tau} & t > 0\\
\end{array}\right .
\end{displaymath} (14)

The Fourier transforms of these are

$\displaystyle \tilde S(\omega)$ $\textstyle =$ $\displaystyle \frac{2 \sin\left ( \frac{\omega T}{2} \right )}{ \omega}$  
$\displaystyle \tilde E'(\omega)$ $\textstyle =$ $\displaystyle -\frac{i}{1+i \omega \tau}$ (15)

and the sideband energy density is exactly as before.

As we saw for the exponential case, the bandwidth is dominated by the rise and fall time. Therefore it seems reasonable to try to optimize the rise and fall waveform of the keying pulse. In terms of the function $E'(t)$ whose integral is the rising and falling wave form, we want to simultaneously make its width in real time and in frequency small. One measure of this is the product of $\Delta \omega$ and $\Delta t$ where they are defined as the variances in frequency and time

$\displaystyle (\Delta t)^2$ $\textstyle =$ $\displaystyle \int_{-\infty}^\infty dt   t^2 E'(t)
- \left [ \int_{-\infty}^\infty dt   t E'(t)\right ]^2$  
$\displaystyle (\Delta \omega)^2$ $\textstyle =$ $\displaystyle \int_{-\infty}^\infty d\omega   \omega^2 \tilde E'(\omega)
- \left [ \int_{-\infty}^\infty d\omega  \omega \tilde E'(\omega)\right ]^2
 .$ (16)

This problem is well known in optics and quantum mechanics where it goes by the name of the minimum uncertainty wave-packet[1] . The solution is a gaussian
E'(t) = \frac{1}{\sqrt{\pi \tau^2}} e^{-\frac{t^2}{\tau^2}}  .
\end{displaymath} (17)

The Fourier transform of this gaussian is
\tilde E'(\omega) = e^{-\frac{\omega^2 \tau^2}{4.}}
\end{displaymath} (18)

and the keying wave form with this $g(t)$ has $E(t) = 1/2[1+{\rm erf}(t/\tau)]$
A(t) = \frac{1}{2} \left [
{\rm erf}\left ( \frac{t+T/2}{\ta...
...right )
-{\rm erf}\left ( \frac{t-T/2}{\tau} \right ) \right ]
\end{displaymath} (19)

where ${\rm erf}(x)$ is the error function[2] defined to be
{\rm erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x du e^{-u^2}  .
\end{displaymath} (20)

The differences in the keying wave form are shown by the turn on shape of the keying pulses in figure 5.

Figure 5: A comparison of the error function turn on with the exponential turn on, both for their respective $\tau $ values of 4 milliseconds.

In figure 6 I show the keying wave form for $\tau =4$ milliseconds and $T = 20$ and 50 milliseconds as in figure 1 for both the exponential and optimized wave form. Notice that the abrupt changes in the exponential form are absent from the error function form.

Figure 6: The error function keying waveforms for $\tau $ of 4 milliseconds and durations of 20 and 50 milliseconds. The 50 millisecond pulse begins at $t=100$ milliseconds to separate it from the 20 millisecond pulse.

Figures 7 and 8 show the sideband energy density.

Figure 7: The sideband energy density for an error function keying wave form with $\tau =4$ milliseconds and $T$ of 20 milliseconds. The carrier energy density is set to 0 dB.

Figure 8: The sideband energy density for an error function keying wave form with $\tau =4$ milliseconds and $T$ of 50 milliseconds. The scale is the same as figure 7.

Figure 9: The plots of figures 7 and 8 combined.

5 Extensions and Conclusions

The sideband energy density for many pulse shapes factorizes. The first of the two factors is proportional to the Fourier transform squared of the square pulse and the second by the Fourier transform squared of the slope of the rise and fall. The analysis can be easily generalized to an arbitrary sequence of pulses. The Fourier transform of the single square pulse simply needs to be changed to the Fourier transform of the sequence of square pulses. For a given rise time, the error function shape for the rise and fall will attenuate unnecessary interference away from the carrier frequency much better than exponential keying.


E. Merzbacher, Quantum Mechanics, 3rd Ed. (John Wiley and Sons, New York, 1998).

M. Abramowitz and I. Stegun, Handbook of Mathematical Functions (National Bureau of Standards, New York, 1964).

next_inactive up previous
Up: W9CF Links