electricpy.cosfilt

electricpy.cosfilt(arr, Srate, domain=False)[source]

Cosine Filter Function.

Cosine Filter function for filtering a dataset representing a sinusoidal function with or without harmonics to evaluate the fundamental value.

Parameters:
arr : numpy.ndarray

The input data array.

Srate : int

Sampling rate for dataset, specified in number of values per fundamental cycle.

domain : bool, optional

Control argument to force return of x-axis array for the filtered data.

Returns:

  • cosf (numpy.ndarray) – Cosine-filtered data

  • xarray (numpy.ndarray) – X-axis array for the filtered data.