Vector Distance¶
Spectral distance measures between LPC filter pairs (Itakura, Itakura–Saito, COSH, Euclidean).
v_disteusq
¶
V_DISTEUSQ - Squared Euclidean distance matrix.
v_disteusq
¶
Calculate squared Euclidean or Mahalanobis distance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
array_like
|
First set of vectors, shape (nx, p). |
required |
y
|
array_like
|
Second set of vectors, shape (ny, p). |
required |
mode
|
str
|
'x' = full distance matrix; 'd' = pairwise; 's' = take sqrt. |
''
|
w
|
array_like
|
Weighting matrix or vector. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
d |
ndarray
|
Distance matrix or vector. |
Source code in pyvoicebox/v_disteusq.py
v_distitar
¶
V_DISTITAR - Itakura distance between AR coefficients.
v_distitar
¶
Calculate the Itakura distance between AR coefficients.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ar1
|
(array_like, shape(nf1, p + 1))
|
AR coefficient sets. |
required |
ar2
|
(array_like, shape(nf2, p + 1))
|
AR coefficient sets. |
required |
mode
|
str
|
'x' for full distance matrix, 'd' for diagonal only. 'e' to return exp(d) instead of d. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
d |
ndarray
|
Distance values. |
Source code in pyvoicebox/v_distitar.py
v_distitpf
¶
V_DISTITPF - Itakura distance between power spectra.
v_distitpf
¶
Calculate the Itakura spectral distance between power spectra.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pf1
|
(array_like, shape(nf1, p + 1))
|
Power spectra (DC to Nyquist). |
required |
pf2
|
(array_like, shape(nf2, p + 1))
|
Power spectra (DC to Nyquist). |
required |
mode
|
str
|
'x' for full distance matrix, 'd' for diagonal only. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
d |
ndarray
|
Distance values. |
Source code in pyvoicebox/v_distitpf.py
v_distisar
¶
V_DISTISAR - Itakura-Saito distance between AR coefficients.
v_distisar
¶
Calculate the Itakura-Saito distance between AR coefficients.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ar1
|
(array_like, shape(nf1, p + 1))
|
AR coefficient sets. |
required |
ar2
|
(array_like, shape(nf2, p + 1))
|
AR coefficient sets. |
required |
mode
|
str
|
'x' for full distance matrix, 'd' for diagonal only. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
d |
ndarray
|
Distance values. |
Source code in pyvoicebox/v_distisar.py
v_distispf
¶
V_DISTISPF - Itakura-Saito distance between power spectra.
v_distispf
¶
Calculate the Itakura-Saito spectral distance between power spectra.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pf1
|
(array_like, shape(nf1, p + 1))
|
Power spectra (DC to Nyquist). |
required |
pf2
|
(array_like, shape(nf2, p + 1))
|
Power spectra (DC to Nyquist). |
required |
mode
|
str
|
'x' for full distance matrix, 'd' for diagonal only. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
d |
ndarray
|
Distance values. |
Source code in pyvoicebox/v_distispf.py
v_distchar
¶
V_DISTCHAR - COSH spectral distance between AR coefficients.
v_distchar
¶
Calculate the COSH spectral distance between AR coefficients.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ar1
|
(array_like, shape(nf1, p + 1))
|
AR coefficient sets. |
required |
ar2
|
(array_like, shape(nf2, p + 1))
|
AR coefficient sets. |
required |
mode
|
str
|
'x' for full distance matrix, 'd' for diagonal only. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
d |
ndarray
|
Distance values. |
Source code in pyvoicebox/v_distchar.py
v_distchpf
¶
V_DISTCHPF - COSH spectral distance between power spectra.
v_distchpf
¶
Calculate the COSH spectral distance between power spectra.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pf1
|
(array_like, shape(nf1, p + 1))
|
Power spectra (DC to Nyquist). |
required |
pf2
|
(array_like, shape(nf2, p + 1))
|
Power spectra (DC to Nyquist). |
required |
mode
|
str
|
'x' for full distance matrix, 'd' for diagonal only. |
''
|
Returns:
| Name | Type | Description |
|---|---|---|
d |
ndarray
|
Distance values. |