sportran.md.cepstral.CepstralFilter

class sportran.md.cepstral.CepstralFilter(samplelogpsd, ck_theory_var=None, psd_theory_mean=None, aic_type='aic')

Bases: object

CEPSTRAL ANALYSIS based filtering.

** INPUT VARIABLES: samplelogpsd = the original sample log-PSD, hat{L}_k ck_theory_var = the theoretical variance of cepstral coefficients, sigma*^2(P*,N) psd_theory_mean = the theoretical bias of log-PSD, lambda_l aic_type = type of AIC to use (‘aic’ (default), ‘aicc’)

** INTERNAL VARIABLES: samplelogpsd = the original sample log-PSD - logpsd_THEORY_mean

logpsdK = the cepstrum of the data, hat{C}_n (i.e. the DCT of samplelogpsd) aic_min = minimum value of the AIC aic_Kmin = cutoffK that minimizes the AIC aic_Kmin_corrfactor = aic_Kmin cutoff correction factor (default: 1.0) cutoffK = (P*-1) = cutoff used to compute logtau and logpsd (by default = aic_Kmin * aic_Kmin_corrfactor) manual_cutoffK_flag = True if cutoffK was manually specified, False if aic_Kmin is being used

logtau = filtered log(tau) as a function of cutoffK, L_0(P*-1) logtau_cutoffK = filtered log(tau) at cutoffK, L*_0 logtau_var_cutoffK = theoretical L*_0 variance logtau_std_cutoffK = theoretical L*_0 standard deviation logpsd = filtered log-PSD at cutoffK

tau = filtered tau as a function of cutoffK, S_0(P*-1) tau_cutoffK = filtered tau at cutoffK, S*_0 tau_var_cutoffK = theoretical S*_0 variance tau_std_cutoffK = theoretical S*_0 standard deviation psd = filtered PSD at the specified cutoffK

p_aic… = Bayesian AIC weighting stuff

__init__(samplelogpsd, ck_theory_var=None, psd_theory_mean=None, aic_type='aic')

Methods

__init__(samplelogpsd[, ck_theory_var, ...])

compute_logtau_density([method, only_stats, ...])

compute_p_aic([method])

Define a weight distribution from the AIC, according to a method.

initialize_cepstral_distribution([...])

Initialize the theoretical distribution of the cepstral coefficients.

scan_filter_psd(cutoffK_LIST[, correct_mean])

Computes the psd and tau as a function of the cutoff K.

scan_filter_tau([cutoffK, ...])

Computes tau as a function of the cutoffK (= P*-1).

compute_p_aic(method='ba')

Define a weight distribution from the AIC, according to a method.

initialize_cepstral_distribution(ck_theory_var=None, psd_theory_mean=None)

Initialize the theoretical distribution of the cepstral coefficients. The samplelogpsd must has been already set.

Input parameters:

ck_theory_var = the theoretical variance of cepstral coefficients, sigma*^2(P*,N) psd_theory_mean = the theoretical bias of log-PSD, lambda_l

If ck_theory_var and/or psd_theory_mean are not specified, the default theoretical values will be used.

scan_filter_psd(cutoffK_LIST, correct_mean=True)

Computes the psd and tau as a function of the cutoff K. Repeats the procedure for all the cutoffs in cutoffK_LIST.

scan_filter_tau(cutoffK=None, aic_Kmin_corrfactor=1.0, correct_mean=True)

Computes tau as a function of the cutoffK (= P*-1). Also computes psd and logpsd for the given cutoffK. If cutoffK is None, aic_Kmin * aic_Kmin_corrfactor will be used.

Input parameters:

cutoffK = (P*-1) = cutoff used to compute logtau and logpsd (by default = aic_Kmin * aic_Kmin_corrfactor) aic_Kmin_corrfactor = aic_Kmin cutoff correction factor (default: 1.0) correct_mean = fix the bias introduced by the log-distribution (default: True)

self.tau_cutoffK will contain the value of tau for the specified cutoff cutoffK

If cutoffK is out of range, the maximum K will be used.