waves¶
- waves(x, /, wavenums=None, wavelengths=None, phase=None, state=None)[source]¶
Compose array of sine waves. Useful for testing the performance of filters.
- Parameters
x (array-like) – If scalar, x is
np.arange(0, x). If iterable, can be n-dimensional, and will calculate sine from coordinates on every dimension.wavelengths (float) – Wavelengths for sine function. Required if
wavenumsisNone.wavenums (float) – Wavenumbers for sine function. Required if
wavelengthsisNone.phase (float, optional) – Array of phase offsets.
state (
numpy.RandomState, optional) – The random state to use for generating the data.
- Returns
data (array-like) – Data composed of sine waves.
Notes
xwill always be normalized so that wavelength is with reference to the first step. This make sense because when working with filters, for which we almost always need to use units corresponding to the axis.