Time for action – plotting the Bartlett window
The Bartlett window is a triangular smoothing window. Perform the following steps to plot the Bartlett window:
Call the NumPy
bartlett
function to calculate the Bartlett window.window = np.bartlett(42)
Plot the Bartlett window with Matplotlib, which is very easy.
plot(window) show()
The following is the Bartlett window, which is triangular, as expected:
What just happened?
We plotted the Bartlett window with the NumPy bartlett
function.