vak.transforms.functional.standardize_spect¶
- vak.transforms.functional.standardize_spect(spect, mean_freqs, std_freqs, non_zero_std)[source]¶
standardize spectrogram by subtracting off mean and dividing by standard deviation.
- Parameters:
spect (numpy.ndarray) – with shape (frequencies, time bins)
mean_freqs (numpy.ndarray) – vector of mean values for each row across the fit set of spectrograms
std_freqs (numpy.ndarray) – vector of standard deviations for each row across the fit set of spectrograms
non_zero_std (numpy.ndarray) – boolean, indicates where std_freqs has non-zero values. Used to avoid divide-by-zero errors.
- Returns:
transformed – with same shape as spect but with (approximately) zero mean and unit standard deviation (mean and standard devation will still vary by batch).
- Return type: