pygwb.spectral.coarse_grain

pygwb.spectral.coarse_grain(data, coarsening_factor)[source]

Coarse grain a frequency series by an integer factor.

If the coarsening factor is even, there are coarsening_factor + 1 entries in the input data that contribute to each coarse frequency bin, however, the first and last contribute only a half to the frequency below and half to the frequency above.

If the coarsening factor is odd, there are no edge effects that have to be considered.

The length of the output is len(data) // coarsening_factor - 1.

If the coarsening factor is not an integer, :func:pygwb.spectral.coarse_grain_exact is used.

Parameters:
  • data (array-like) – The data to coarse grain.

  • coarsening_factor (float) – The factor by which to coarsen the data.

Returns:
coarsened: array-like

The coarse-grained data.