denspp.offline.metric.snr#
Module Contents#
Functions#
Calculating the signal-to-noise ratio [dB] of the input signal compared to mean waveform |
|
Calculating the Signal-to-Noise (SNR) ratio of the input data Args: data: Tensor with raw data / frame mean: Tensor with class-specific mean data / frame Return: Tensor with SNR value |
|
Calculation of metric different Signal-to-Noise ratio (SNR) between defined input and predicted to reference waveform Args: data: Tensor array with input waveform pred: Tensor array with predicted waveform from model mean: Tensor array with real mean waveform from dataset Return: Tensor with differential Signal-to-Noise ratio (SNR) of applied waveforms |
|
Calculating the cluster-specific Signal-to-Noise Ratio (SNR) for all frames |
API#
- denspp.offline.metric.snr.calculate_snr(data: numpy.ndarray, mean: numpy.ndarray) numpy.ndarray[source]#
Calculating the signal-to-noise ratio [dB] of the input signal compared to mean waveform
- Parameters:
data – Numpy array with all spike waveforms (raw data)
mean – Numpy array with mean waveform of corresponding spike frame cluster
- Returns:
Numpy array with SNR of all spike waveforms
- denspp.offline.metric.snr.calculate_snr_tensor(data: torch.Tensor, mean: torch.Tensor) torch.Tensor[source]#
Calculating the Signal-to-Noise (SNR) ratio of the input data Args: data: Tensor with raw data / frame mean: Tensor with class-specific mean data / frame Return: Tensor with SNR value
- denspp.offline.metric.snr.calculate_dsnr_tensor(data: torch.Tensor, pred: torch.Tensor, mean: torch.Tensor) torch.Tensor[source]#
Calculation of metric different Signal-to-Noise ratio (SNR) between defined input and predicted to reference waveform Args: data: Tensor array with input waveform pred: Tensor array with predicted waveform from model mean: Tensor array with real mean waveform from dataset Return: Tensor with differential Signal-to-Noise ratio (SNR) of applied waveforms
- denspp.offline.metric.snr.calculate_snr_cluster(frames_in: numpy.ndarray, frames_cl: numpy.ndarray, frames_mean: numpy.ndarray) numpy.ndarray[source]#
Calculating the cluster-specific Signal-to-Noise Ratio (SNR) for all frames
- Parameters:
frames_in – Numpy array with spike frames
frames_cl – Numpy array with cluster label to each spike frame
frames_mean – Numpy array with mean waveforms of cluster
- Returns:
Numpy array with SNR value for each sample for {min, mean, max}