Chapter 3. Non-Periodic Signals
The signals we have worked with so far are periodic, which means that they repeat forever. It also means that the frequency components they contain do not change over time. In this chapter, we consider non-periodic signals, whose frequency components do change over time. In other words, pretty much all sound signals.
This chapter also presents spectrograms, a common way to visualize non-periodic signals.
We’ll start with a chirp, which is a signal with variable frequency.
thinkdsp provides a
Chirp that makes a sinusoid that sweeps linearly through a range of frequencies.
Here’s an example that sweeps from 220 to 880 Hz, which is two octaves from A3 to A5:
signal = thinkdsp.Chirp(start=220, end=880) wave = signal.make_wave()
Figure 3-1 shows segments of this wave near the beginning, middle, and end. It’s clear that the frequency is increasing.
Before we go on, let’s see how
Chirp is implemented. Here is the class definition:
class Chirp(Signal): def __init__(self, start=440, end=880, amp=1.0): self.start = start self.end = end self.amp = amp
end are the frequencies, in Hz, at the start and end of ...