cogpy.spectral.process_spectrogram

Post-processing helpers for spectrogram-like arrays.

Utilities here are primarily geared towards xarray-backed spectrogram tensors (e.g., clipping frequency ranges, smoothing, and simple outlier repair).

Status

STATUS: REFERENCE Reason: Post-processing ideas from a previous project. Not actively used but patterns (outlier repair, frequency clipping, smoothing) will be selectively reused. Do not build new pipelines on this module. Superseded by: n/a Safe to remove: no

Functions

clip_freq(mt)

compress_specgram(mt)

fix_outliers(x, kernel[, threshold])

x: numpy array kernel: tuple of ints window size for outlier detection threshold: float thresholdold for outlier detection

gaussian_spec(mtx, gauss_sigma)

gauss_sigma = (0.5, 0.5, 0.5, 10) # AP, ML, freq, time

get_center(x)

interpolate(x)

interpolate_if_nan(x)

is_outlier(x, xcenter[, threshold])

median_if_nan(x)

median_spec(mtx, med_size)

med_size = (3, 3, 1, 1) # h, w, f, t

nan_if_outlier(x[, threshold])

nan_if_outlier_generic(arr, kernel[, threshold])

arr: numpy array kernel: tuple of ints window size for outlier detection threshold: float thresholdold for outlier detection

process_specgram(mtx[, filt])