nigsp.operations.timeseries.graph_filter

nigsp.operations.timeseries.graph_filter(timeseries, eigenvec, freq_idx, keys=['low', 'high'])[source]

Filter a graph decomposition into two parts based on freq_idx.

Return the two eigenvector lists (high freq and low freq) that are equal to the original eigenvector list, but “low” is zero-ed for all frequencies >= of the given index, and “high” is zero-ed for all frequencies < to the given index. Also return their projection onto a timeseries.

Parameters:
timeseriesnumpy.ndarray

The input timeseries. It is assumed that the second dimension is time.

eigenvecnumpy.ndarray

The eigenvector resulting from the Laplacian decomposition.

freq_idxint or list

The index of the frequency that splits the spectral power into two (more or less) equal parts - i.e. the index of the first frequency in the “high” component.

keyslist, optional

The keys to call the split parts with.

Returns:
dict of numpy.ndarray

Return first the split eigenvectors.

dict of numpy.ndarray

Return second the projected split eigenvectors onto the timeseries.

Raises:
IndexError

If the given index is 0 (all “high”), the last possible index (all “low”), or higher than the last possible index (not applicable).