denspp.offline.preprocessing.frame_preprocessing#

Module Contents#

Functions#

change_frame_size

Reducing the frame size of input frames to specific values Args: frames_in: input_values sel_pos: List with two elements in order to say position start and end Returns: frames with reduced size

generate_frames

Generating noisy spike frames

generate_zero_frames

Generating zero frames with noise for data augmentation

calculate_frame_mean

Calculating mean waveforms of spike waveforms

calculate_frame_median

Calculating mean waveforms of spike waveforms with median()

calculate_frame_snr

Calculating SNR of each cluster

frame_noise

Generation of noisy spike frames with AWGN with noise power [dB] in specific interval

API#

denspp.offline.preprocessing.frame_preprocessing.change_frame_size(frames_in: numpy.ndarray, sel_pos: list) numpy.ndarray[source]#

Reducing the frame size of input frames to specific values Args: frames_in: input_values sel_pos: List with two elements in order to say position start and end Returns: frames with reduced size

denspp.offline.preprocessing.frame_preprocessing.generate_frames(num: int, frame_in: numpy.ndarray, cluster_in: int, snr_out: list, fs: float = 20000.0) [numpy.ndarray, numpy.ndarray][source]#

Generating noisy spike frames

denspp.offline.preprocessing.frame_preprocessing.generate_zero_frames(frame_size: int, num_frames: int, noise_range: list) tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray][source]#

Generating zero frames with noise for data augmentation

denspp.offline.preprocessing.frame_preprocessing.calculate_frame_mean(frames_in: numpy.ndarray, frames_cl: numpy.ndarray, do_integer_output: bool = False) numpy.ndarray[source]#

Calculating mean waveforms of spike waveforms

denspp.offline.preprocessing.frame_preprocessing.calculate_frame_median(frames_in: numpy.ndarray, frames_cl: numpy.ndarray, do_integer_output: bool = False) numpy.ndarray[source]#

Calculating mean waveforms of spike waveforms with median()

denspp.offline.preprocessing.frame_preprocessing.calculate_frame_snr(frames_in: numpy.ndarray, frames_cl: numpy.ndarray, frames_mean: numpy.ndarray) numpy.ndarray[source]#

Calculating SNR of each cluster

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

denspp.offline.preprocessing.frame_preprocessing.frame_noise(no_frames: int, frame_in: numpy.ndarray, noise_pwr: list, fs: float) [numpy.ndarray, numpy.ndarray][source]#

Generation of noisy spike frames with AWGN with noise power [dB] in specific interval