Welcome to gccestimating’s documentation!

Generalized Cross Correlation Estimators.

Istanciation Signatures:

  • gcc = GCC(sig1, sig2, fftlen)

  • gcc = GCC.from_spectra(spec1, spec2, onesided=True)

Estimators:

gcc.cc(), gcc.roth(), gcc.scot(), gcc.phat(), gcc.ht()

gcc.gamma12()

class gccestimating.GCC(sig1=None, sig2=None, fftlen=None)[source]

Returns a GCC instance.

Provides estimation methods for Generalized Cross Correlation.

Parameters:
sig1ndarray

First signal.

sig2ndarray

Second signal.

fftlenint or None

Length of fft to be computed. If None, it will be calculated automatically as next power of two.

Returns:
gccGCC

Examples

(Source code)

_images/index-1_00.png

(png, hires.png, pdf)

_images/index-1_01.png

(png, hires.png, pdf)

Attributes:
spec11

Returns auto power spectrum of first signal.

spec12

Returns cross power spectrum of first and second signal.

spec22

Returns auto power spectrum of second signal.

Methods

Estimate(name, sig, spec)

Data of an Estimate.

cc()

Returns GCC estimate

coherence()

Returns the coherence.

eckart(sig0, noise1, noise2)

Returns an eckart estimate.

from_spectra(spec1, spec2[, onesided])

Returns a GCC instance.

gamma12()

Returns gamma12 $gamma_{12}(f)$

ht()

Returns GCC HT estimate

phat()

Returns GCC PHAT estimate

roth()

Returns GCC Roth estimate

scot()

Returns GCC SCOT estimate

classmethod from_spectra(spec1, spec2, onesided=True)[source]

Returns a GCC instance.

Parameters:
spec1ndarray

First spectrum.

spec2ndarray

Second spectrum.

onesidedbool

If you provide twosided Spectra (e.g. of comples signals) set to False. Default is True.

Returns:
gccGCC
property spec11

Returns auto power spectrum of first signal.

property spec22

Returns auto power spectrum of second signal.

property spec12

Returns cross power spectrum of first and second signal.

class Estimate(name: str, sig: ndarray, spec: ndarray)[source]

Data of an Estimate. Instances are returned by estimators in GCC.

Parameters:
namestr

Name of the estimator.

signdarray

Estimator signal array (Rxy(t), Cross Correlation).

specndarray

Estimator spectrum (Rxy(f)).

Methods

index_to_lag

cc()[source]

Returns GCC estimate

$mathcal{F}^{-1} (S_{xy})$

roth()[source]

Returns GCC Roth estimate

$mathcal{F}^{-1} (S_{xy}/S_{xx})$

scot()[source]

Returns GCC SCOT estimate

Smoothed gamma12 Transformed GCC.

$mathcal{F}^{-1} (S_{xy}/sqrt{S_{xx}S_{yy}})$

gamma12()[source]

Returns gamma12 $gamma_{12}(f)$

coherence()[source]

Returns the coherence.

phat()[source]

Returns GCC PHAT estimate

PHAse Transformed GCC.

$mathcal{F}^{-1}(S_{xy}/|S_{xy}|)$

eckart(sig0, noise1, noise2)[source]

Returns an eckart estimate.

Parameters:
sig0ndarray

estimate of the actual signal to be correlated.

noise1ndarray

estimated noise in sig1.

noise2ndarray

estimated noise in sig2

Returns:
estmateGCC.Estimate
ht()[source]

Returns GCC HT estimate

gccestimating.corrlags(corrlen, samplerate=1)[source]

Returns array of lags.

Parameters:
corrlenint

Lenght of correlation function (usually 2N-1).

sampleratescalar
Returns:
lagsndarray

Indices and tables