Time for action – plotting the Bartlett window

The Bartlett window is a triangular smoothing window. Perform the following steps to plot the Bartlett window:

  1. Call the NumPy bartlett function to calculate the Bartlett window.
    window = np.bartlett(42)
  2. Plot the Bartlett window with Matplotlib, which is very easy.
    plot(window)
    show()

    The following is the Bartlett window, which is triangular, as expected:

    Time for action – plotting the Bartlett window

What just happened?

We plotted the Bartlett window with the NumPy bartlett function.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset