In the following section, we will learn how to work with filters.
Getting started with filters
How to do it…
- A filter is an operation on signals that either removes features or extracts some component. SciPy has a complete set of known filters as well as the tools to allow the construction of new ones.
- The complete list of filters in SciPy is long and we encourage the reader to explore the help documents of the scipy.signal and scipy.ndimage modules for the complete picture.
- We will introduce in these pages, as an exposition, some of the most used filters in the treatment of audio or image processing.
- We start by creating a signal worth filtering:
from numpy import sin, cos, pi, linspace
f=lambda t: cos(pi*t) + 0.2...