Summing sinusoids
Contents
5.7. Summing sinusoids#
In the previous sections, we’ve made use of the fact that the samples of a wave at an analysis frequency must sum to zero. However, we never actually proved this from first principles.
In fact, we can say something a little stronger, and exactly characterize the sum of samples for a wave at any frequency:
Computing this sum requires adding up wave samples, which can be done directly, though it can be tedious. As we’ll see, this is a case where the complex exponential form is more convenient to work with.
5.7.1. Aside: geometric series#
Recall that Euler’s formula (4.1) converts between rectangular and polar coordinates:
Since this holds for any angle
and by the product rule for exponents, we can re-write the left-hand side as follows:
This will allow us to turn a summation of wave samples into a summation of the form
Lemma 5.1 (Summing finite geometric series)
Let
In plain language, this lemma says that summing up increasing powers of a number
Proof. To prove Lemma 5.1, observe that if we multiply the left-hand side (the summation) by
Since
5.7.2. Summing complex exponentials#
Now that we have Lemma 5.1, we can state the following theorem.
Theorem 5.1 (Complex exponential sums)
Let
for an integer
In plain language, Theorem 5.1 says that a complex sinusoid with a frequency that completes a whole number of cycles in
Note that this does not handle the special case of
Fig. 5.18 An example of the running summation
5.7.2.1. Proof#
Theorem 5.1 has an “if and only if” form, so we’ll need to prove both directions:
of the given form implies the summation must be zero, and the summation being zero implies takes the given form.
Note that
Proof.
If
Since the numerator is 0, so too is the entire summation.
Proof.
In the other direction, if we assume the summation is 0, then we must have
which implies
5.7.3. What about phase?#
We can generalize the statement above to handle phase offsets as well.
Because the phase offset does not change with the sample index
This says that when a wave is shifted by
5.7.4. Back to the original question#
The theorem above is for complex exponentials, which involve both a real and imaginary component. However, our original question was about summations of general waves in standard form:
For this, we can use the fact that
or when a sample index
By using (5.14), we can transform each part of this summation independently. The end result is the rather unwieldy formula:
5.7.5. Why does this matter?#
Many of the things we’d like to say about Fourier series depend on having waves “average out to zero”. For continuous (time) signals, we can show this kind of thing via symmetry arguments (like in chapter 1), but when using discretely sampled signals, a bit more care must be taken.
The main theorem in this section tells us that waves at analysis frequencies always sum to 0, but in proving that theorem, we got as a byproduct a general equation (5.15) for sums of waves at arbitrary (non-analysis) frequencies and phase offsets. While this equation could be used in principle to bypass computing sums sample-by-sample, it is more useful as an analytical tool: it allows us to reason about the properties of the sum (e.g., whether it is 0 or non-zero, real or complex, etc) just by knowing the wave’s parameters.