Does "keying on" a sine wave at a zero-crossing reduce its bandwidth? I understand that a pure sine wave of infinite duration occupies no bandwidth, i.e. it is only the modulation of a carrier that gives it sidebands. Does the exact timing of a sudden modulation make any difference?

For simple on-off keying of a signal, it looks like https://dsp.stackexchange.com/a/24604/18819 is giving an equation to determine the relative power away from a carrier:


  The spectrum of your windowed sinusoid is just a shifted sinc function


…and the magnitude of this function is based only on the length of the windowed signal. In all discussions I've seen (e.g. CW bandwidth described) they discuss things like keying envelopes and such to reduce the splattering of significant power away from the intended carrier frequency. They don't discuss the precise timing of the envelope.

I'm wondering: does it make any difference at which phase of its cycle I "key" a sine wave on or off?

The Wikipedia article on Zero-crossing circuitry explains:


  …the switching device will "wait" to switch on until the output AC wave reaches its next zero point. This is useful when sudden turn-on in the middle of a sine-wave half cycle could cause undesirable effects like high frequency spikes for which the circuit or the environment is not expected to handle gracefully


Is this just a practical concern (i.e. non-ideal components in a real-world circuit) or does the spectrum actually change if I make a "chopped-off sinewave" from 0º to 360º, vs. a section from 90º to 450º? What about from 0º to 180º vs. 90º to 270º?! [Update: to be clearer, maybe I'm really meaning in each case e.g. "from 90º to (360n+270)º" for some relatively large n so that the signal lasts for a bit between start/end.]

In both of those pairings, the signal which starts and ends at 0 magnitude certainly seems "cleaner" than a signal suddenly starting like in the last example at +1 and ending suddenly at -1. But can this difference be demonstrated mathematically? Each pair starts/ends the sine wave "instantaneously" and they both keep it running for the same duration, so are they equivalent as far as "splatter"?
It is instructive to have a look at the expression for the spectrum of a truncated sine wave to see how the choice of the window length affects the decay of the spectrum. Let's define a windowed sinusoid $s(t)$:

$$s(t)=\sin(2\pi f_0t)\cdot\text{rect}(t,T)=\begin{cases}\sin(2\pi f_0t),&amp;-T/2&lt;t&lt;T/2\\0,&amp; \text{otherwise}\end{cases}\tag{1}$$

The Fourier transform of $s(t)$ is the convolution of the transforms of the sinusoid and the rectangular window:

$$\begin{align}S(f)&amp;=\frac{1}{2j}\left[\delta(f-f_0)-\delta(f+f_0)\right]\star T\text{sinc}(Tf)\\&amp;=\frac{T}{2j}\left[\text{sinc}(T(f-f_0))-\text{sinc}(T(f+f_0))\right]\tag{2}\end{align}$$

With $\text{sinc}(x)=\sin(\pi x)/(\pi x)$ we get from $(2)$

$$\begin{align}S(t)&amp;=\frac{T}{2 j}\left[\frac{\sin(\pi T(f-f_0))}{\pi T(f-f_0)}-\frac{\sin(\pi T(f+f_0))}{\pi T(f+f_0)}\right]\\&amp;=\frac{1}{2\pi j}\frac{(f+f_0)\sin(\pi T(f-f_0))-(f-f_0)\sin(\pi T(f+f_0))}{f^2-f_0^2}\\=&amp;\frac{1}{2\pi j(f^2-f_0^2)}\Big\{f\big[\sin(\pi T(f-f_0))-\sin(\pi T(f+f_0))\big]+f_0\big[\sin(\pi T(f-f_0))+\sin(\pi T(f+f_0))\big]\Big\}\tag{3}\end{align}$$

The spectrum $(3)$ decays as $\propto 1/f$ because we have $f^2$ in the denominator and $f$ in the first term of the numerator. If the window length $T$ is chosen such that an integer number of periods of the sinusoid are inside the window, then the limits of the window will be exactly at zero crossings of the sinusoid. This condition is equivalent to $Tf_0=n,\;n\in\mathbb{Z}$. With this condition the first term in the numerator of $(3)$ vanishes because the arguments of the two sinusoids differ by $2\pi n$, and, consequently, both sinusoids are identical. As a consequence, in that case the $f$ in the numerator disappears and the spectrum $S(f)$ will decay as $\propto 1/f^2$ instead of $\propto 1/f$.

In sum, if the windowing does not cause any discontinuities (i.e., the window limits occur at zero crossings of the sinusoid), the spectrum of the windowed sinusoid will decay as $\propto 1/f^2$. This is generally the case for continuous functions. Such functions can of course decay even faster, but only if they also have continuous derivatives, which is not the case for a windowed sinusoid. If the windowed sinusoid is discontinuous, i.e., the window limits do not occur at zero crossings, then the corresponding spectrum only decays as $\propto 1/f$.