Analysis frequencies
Contents
5.3. Analysis frequencies#
In the previous section, we saw how to setup comparisons between an input signal
In this section, we’ll dig a little deeper, and see how this kind of comparison behaves for specific choices of
5.3.1. Comparing analysis frequencies#
Let’s see what happens when
For this example, we’ll take [cycles / signal-duration]
.
Since the signal duration is 2 seconds, this corresponds to a frequency of [Hz]
.
Our sampled wave will be given by
Fig. 5.9 Comparing a sinusoid
Fig. 5.9 shows the similarity comparisons and resulting scores for the first five reference signals.
In this case, all scores are 0 except for
Why does this happen?
5.3.1.1. Understanding analysis frequencies#
Our definitions of similarity (5.1) and reference signal (5.5) lead to the following equation when
We can simplify (5.7) with a bit of trigonometry.
The product-to-sum rule for cosines gives us for any angles
If for each sample index
be the angle of the first factor in the summation (the
be the angle of the second factor (the
and each term of the summation in (5.7) can be rewritten as:
This tells us that in this case,
Plugging this back into Equation (5.7), we get
where the second step follows by breaking the summation into pieces only concerned with
Now, let’s consider two cases. If
Since both summations will sum to zero, the full similarity score
On the other hand, if
There is a third case that can happen (but not in the example above), where
In either event, both terms in the summation become
This explains the observation above: similarity between analysis frequencies is either
Warning
This cancellation only happens if
Waves at non-analysis frequencies will not generally share this property.
5.3.2. Non-analysis frequencies#
If instead of an analysis frequency, we had chosen
For example, if we take [cycles / signal-duration]
— which is not an analysis frequency because 1.5 is not an integer — we would have a wave [Hz]
:
Fig. 5.10 Comparing a sinusoid
Like before, Fig. 5.10 shows the similarity comparisons and resulting scores for the first five reference signals.
In this case, the scores are all non-zero because the wave doesn’t precisely line up with itself at
This phenomenon is known as spectral leakage: a wave at a non-analysis frequency will leak across the entire frequency range, and appear to be a little similar to each analysis frequency.
We’ll have more to say about this in subsequent chapters, but for now, it’s important to understand that waves of different frequencies can still produce a non-zero similarity score.