soundscapecode.temporal_dissimilarity
- soundscapecode.temporal_dissimilarity(data_a: ndarray, data_b: ndarray) float
Calculates the temporal dissimilarity between two sounds.
Parameters
- data_a: np.ndarray
an array-like with shape (n, 1)
- data_b: np.ndarray
an array-like with shape (n, 1)
Returns
- float
The temporal dissimilarity
Raises
- AttributeError
if either data input is not a vector
- AttributeError
if the data input lengths are not the same
Examples
>>> import numpy as np >>> np.random.seed(0) >>> import soundscapecode as ssc >>> fs = 48000 >>> sound_a = np.random.rand(fs*60,1) >>> sound_b = np.random.rand(fs*60,1) >>> ssc.temporal_dissimilarity(sound_a, sound_b) 0.2585992462980159