pyhctsa.operations.spectral.cepstrum

pyhctsa.operations.spectral.cepstrum(y, max_period=100, min_period=4)

Cepstral statistics: harmonic (comb) structure of the power spectrum.

Computes the real cepstrum, the inverse Fourier transform of the log magnitude spectrum, and summarizes the structure of its dominant peak.

Parameters:
y : array-like

The input time series.

max_period : int, optional

The longest fundamental period (in samples) to search for. Default is 100.

min_period : int, optional

The shortest fundamental period (in samples) to search for. Default is 4.

Returns:

  • period: the estimated fundamental period (quefrency of the dominant cepstral peak), in samples.

  • peak: the height of that peak.

  • meanCeps, stdCeps: the mean and standard deviation of the cepstrum over the search range.

  • peakRatio: the peak height in units of the standard deviation of the cepstrum over the search range.

  • CPP: the cepstral peak prominence, the standard robust measure, being the peak height above a linear regression fit through the cepstrum across the search range (this normalizes away the overall cepstral trend, so it does not simply track the spectrum’s dynamic range).

  • rahmonicRatio: comparing the cepstrum at twice the peak quefrency to the peak itself (a genuine harmonic comb repeats at multiples of the fundamental period, so a real periodicity shows a secondary ‘rahmonic’ peak, whereas an isolated fluke does not).

Returns NaN if the time series is too short for the requested search range, or is constant.

Return type:

dict