Matplotlib, decorators and plotting waves
In this tutorial, we will learn how generatate plots using Matplotlib and Numpy. Specifically we'll plot waveforms, which in our context just means periodic functions (i.e. functions f such that f(x + P) = f(x) for some P
Let's start by defining some key terms of waveforms: the period of a wave is the time it takes for one complete oscillation to occur; the frequency of a wave is the number of oscillations that occur in a given period of time and the amplitude of a wave is the measure of the height of the wave, it is the distance between the crest or trough and the mean position of the wave.
Once we have a basic understanding of these concepts, we can move on to using Matplotlib to plot waveforms. We will begin by plotting a single period wave, and then use a function decorator to make it periodic.
There are many different types of waveforms, each with its own unique characteristics and applications. In this tutorial we will be plotting four of the most commonly seen shapes: Square, Triangular, Sawtooth and Sine