Time for action – plotting the Bartlett window
The Bartlett window is a triangular smoothing window:
- Call the NumPy
bartlett()
function:window = np.bartlett(42)
- Plotting is easy with matplotlib:
plt.plot(window) plt.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.