RPPT Tensor Operations - Audio Augmentations.#
RPPT Tensor Operations - Audio Augmentations. More...
Functions | |
RppStatus | rppt_non_silent_region_detection_host (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, Rpp32s *srcLengthTensor, Rpp32s *detectedIndexTensor, Rpp32s *detectionLengthTensor, Rpp32f cutOffDB, Rpp32s windowLength, Rpp32f referencePower, Rpp32s resetInterval, rppHandle_t rppHandle) |
Non Silent Region Detection augmentation on HOST backend. More... | |
RppStatus | rppt_non_silent_region_detection_gpu (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, Rpp32s *srcLengthTensor, Rpp32s *detectedIndexTensor, Rpp32s *detectionLengthTensor, Rpp32f cutOffDB, Rpp32s windowLength, Rpp32f referencePower, Rpp32s resetInterval, rppHandle_t rppHandle) |
Non Silent Region Detection augmentation on HIP backend. More... | |
RppStatus | rppt_to_decibels_host (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptImagePatchPtr srcDims, Rpp32f cutOffDB, Rpp32f multiplier, Rpp32f referenceMagnitude, rppHandle_t rppHandle) |
To Decibels augmentation on HOST backend. More... | |
RppStatus | rppt_to_decibels_gpu (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, RpptImagePatchPtr srcDims, Rpp32f cutOffDB, Rpp32f multiplier, Rpp32f referenceMagnitude, rppHandle_t rppHandle) |
To Decibels augmentation on HIP backend. More... | |
RppStatus | rppt_pre_emphasis_filter_host (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32s *srcLengthTensor, Rpp32f *coeffTensor, RpptAudioBorderType borderType, rppHandle_t rppHandle) |
Pre Emphasis Filter augmentation on HOST backend. More... | |
RppStatus | rppt_pre_emphasis_filter_gpu (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32s *srcLengthTensor, Rpp32f *coeffTensor, RpptAudioBorderType borderType, rppHandle_t rppHandle) |
Pre Emphasis Filter augmentation on HIP backend. More... | |
RppStatus | rppt_down_mixing_host (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32s *srcDimsTensor, bool normalizeWeights, rppHandle_t rppHandle) |
Down Mixing augmentation on HOST backend. More... | |
RppStatus | rppt_down_mixing_gpu (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32s *srcDimsTensor, bool normalizeWeights, rppHandle_t rppHandle) |
Down Mixing augmentation on HIP backend. More... | |
RppStatus | rppt_spectrogram_host (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32s *srcLengthTensor, bool centerWindows, bool reflectPadding, Rpp32f *windowFunction, Rpp32s nfft, Rpp32s power, Rpp32s windowLength, Rpp32s windowStep, rppHandle_t rppHandle) |
Produces a spectrogram from a 1D audio buffer on HOST backend. More... | |
RppStatus | rppt_mel_filter_bank_host (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32s *srcDims, Rpp32f maxFreq, Rpp32f minFreq, RpptMelScaleFormula melFormula, Rpp32s numFilter, Rpp32f sampleRate, bool normalize, rppHandle_t rppHandle) |
Mel filter bank augmentation HOST backend. More... | |
RppStatus | rppt_resample_host (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32f *inRateTensor, Rpp32f *outRateTensor, Rpp32s *srcDimsTensor, RpptResamplingWindow &window, rppHandle_t rppHandle) |
Resample augmentation on HOST backend. More... | |
RppStatus | rppt_resample_gpu (RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstPtr, RpptDescPtr dstDescPtr, Rpp32f *inRateTensor, Rpp32f *outRateTensor, Rpp32s *srcDimsTensor, RpptResamplingWindow &window, rppHandle_t rppHandle) |
Resample augmentation on HIP backend. More... | |
Detailed Description
RPPT Tensor Operations - Audio Augmentations.
Function Documentation
◆ rppt_down_mixing_gpu()
RppStatus rppt_down_mixing_gpu | ( | RppPtr_t | srcPtr, |
RpptDescPtr | srcDescPtr, | ||
RppPtr_t | dstPtr, | ||
RpptDescPtr | dstDescPtr, | ||
Rpp32s * | srcDimsTensor, | ||
bool | normalizeWeights, | ||
rppHandle_t | rppHandle | ||
) |
Down Mixing augmentation on HIP backend.
Down Mixing augmentation for audio data
- Parameters
-
[in] srcPtr source tensor in HIP memory [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 2 or 3 (for single-channel or multi-channel audio tensor), offsetInBytes >= 0, dataType = F32) [out] dstPtr destination tensor in HIP memory [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 2, offsetInBytes >= 0, dataType = F32) [in] srcDimsTensor source audio buffer length and number of channels (1D tensor in HIP/Pinned memory, of size batchSize * 2) [in] normalizeWeights bool flag to specify if normalization of weights is needed [in] rppHandle RPP HIP handle created with rppCreateWithStreamAndBatchSize()
- Returns
- A
RppStatus
enumeration.
- Return values
-
RPP_SUCCESS Successful completion. RPP_ERROR* Unsuccessful completion.
◆ rppt_down_mixing_host()
RppStatus rppt_down_mixing_host | ( | RppPtr_t | srcPtr, |
RpptDescPtr | srcDescPtr, | ||
RppPtr_t | dstPtr, | ||
RpptDescPtr | dstDescPtr, | ||
Rpp32s * | srcDimsTensor, | ||
bool | normalizeWeights, | ||
rppHandle_t | rppHandle | ||
) |
Down Mixing augmentation on HOST backend.
Down Mixing augmentation for audio data
- Parameters
-
[in] srcPtr source tensor in HOST memory [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 2 or 3 (for single-channel or multi-channel audio tensor), offsetInBytes >= 0, dataType = F32) [out] dstPtr destination tensor in HOST memory [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 2, offsetInBytes >= 0, dataType = F32) [in] srcDimsTensor source audio buffer length and number of channels (1D tensor in HOST memory, of size batchSize * 2) [in] normalizeWeights bool flag to specify if normalization of weights is needed [in] rppHandle RPP HOST handle created with rppCreateWithBatchSize()
- Returns
- A
RppStatus
enumeration.
- Return values
-
RPP_SUCCESS Successful completion. RPP_ERROR* Unsuccessful completion.
◆ rppt_mel_filter_bank_host()
RppStatus rppt_mel_filter_bank_host | ( | RppPtr_t | srcPtr, |
RpptDescPtr | srcDescPtr, | ||
RppPtr_t | dstPtr, | ||
RpptDescPtr | dstDescPtr, | ||
Rpp32s * | srcDims, | ||
Rpp32f | maxFreq, | ||
Rpp32f | minFreq, | ||
RpptMelScaleFormula | melFormula, | ||
Rpp32s | numFilter, | ||
Rpp32f | sampleRate, | ||
bool | normalize, | ||
rppHandle_t | rppHandle | ||
) |
Mel filter bank augmentation HOST backend.
Mel filter bank augmentation for audio data
- Parameters
-
[in] srcPtr source tensor in HOST memory [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32, layout - NFT) [out] dstPtr destination tensor in HOST memory [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32, layout - NFT) [in] srcDimsTensor source audio buffer length and number of channels (1D tensor in HOST memory, of size batchSize * 2) [in] maxFreq maximum frequency if not provided maxFreq = sampleRate / 2 [in] minFreq minimum frequency [in] melFormula formula used to convert frequencies from hertz to mel and from mel to hertz (SLANEY / HTK) [in] numFilter number of mel filters [in] sampleRate sampling rate of the audio [in] normalize boolean variable that determine whether to normalize weights / not [in] rppHandle RPP HOST handle created with rppCreateWithBatchSize()
- Returns
- A
RppStatus
enumeration.
- Return values
-
RPP_SUCCESS Successful completion. RPP_ERROR* Unsuccessful completion.
◆ rppt_non_silent_region_detection_gpu()
RppStatus rppt_non_silent_region_detection_gpu | ( | RppPtr_t | srcPtr, |
RpptDescPtr | srcDescPtr, | ||
Rpp32s * | srcLengthTensor, | ||
Rpp32s * | detectedIndexTensor, | ||
Rpp32s * | detectionLengthTensor, | ||
Rpp32f | cutOffDB, | ||
Rpp32s | windowLength, | ||
Rpp32f | referencePower, | ||
Rpp32s | resetInterval, | ||
rppHandle_t | rppHandle | ||
) |
Non Silent Region Detection augmentation on HIP backend.
Non Silent Region Detection augmentation for 1D audio buffer
Finds the starting index and length of non silent region in the audio buffer by comparing the calculated short-term power with cutoff value passed
- Parameters
-
[in] srcPtr source tensor in HIP memory [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 2, offsetInBytes >= 0, dataType = F32) [in] srcLengthTensor source audio buffer length (1D tensor in Pinned/HIP memory, of size batchSize) [out] detectedIndexTensor beginning index of non silent region (1D tensor in Pinned/HIP memory, of size batchSize) [out] detectionLengthTensor length of non silent region (1D tensor in Pinned/HIP memory, of size batchSize) [in] cutOffDB cutOff in dB below which the signal is considered silent [in] windowLength window length used for computing short-term power of the signal [in] referencePower reference power that is used to convert the signal to dB [in] resetInterval number of samples after which the moving mean average is recalculated to avoid precision loss [in] rppHandle RPP HIP handle created with rppCreateWithStreamAndBatchSize()
- Returns
- A
RppStatus
enumeration.
- Return values
-
RPP_SUCCESS Successful completion. RPP_ERROR* Unsuccessful completion.
◆ rppt_non_silent_region_detection_host()
RppStatus rppt_non_silent_region_detection_host | ( | RppPtr_t | srcPtr, |
RpptDescPtr | srcDescPtr, | ||
Rpp32s * | srcLengthTensor, | ||
Rpp32s * | detectedIndexTensor, | ||
Rpp32s * | detectionLengthTensor, | ||
Rpp32f | cutOffDB, | ||
Rpp32s | windowLength, | ||
Rpp32f | referencePower, | ||
Rpp32s | resetInterval, | ||
rppHandle_t | rppHandle | ||
) |
Non Silent Region Detection augmentation on HOST backend.
Non Silent Region Detection augmentation for 1D audio buffer
Finds the starting index and length of non silent region in the audio buffer by comparing the calculated short-term power with cutoff value passed
- Parameters
-
[in] srcPtr source tensor in HOST memory [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 2, offsetInBytes >= 0, dataType = F32) [in] srcLengthTensor source audio buffer length (1D tensor in HOST memory, of size batchSize) [out] detectedIndexTensor beginning index of non silent region (1D tensor in HOST memory, of size batchSize) [out] detectionLengthTensor length of non silent region (1D tensor in HOST memory, of size batchSize) [in] cutOffDB cutOff in dB below which the signal is considered silent [in] windowLength window length used for computing short-term power of the signal [in] referencePower reference power that is used to convert the signal to dB [in] resetInterval number of samples after which the moving mean average is recalculated to avoid precision loss [in] rppHandle RPP HOST handle created with rppCreateWithBatchSize()
- Returns
- A
RppStatus
enumeration.
- Return values
-
RPP_SUCCESS Successful completion. RPP_ERROR* Unsuccessful completion.
◆ rppt_pre_emphasis_filter_gpu()
RppStatus rppt_pre_emphasis_filter_gpu | ( | RppPtr_t | srcPtr, |
RpptDescPtr | srcDescPtr, | ||
RppPtr_t | dstPtr, | ||
RpptDescPtr | dstDescPtr, | ||
Rpp32s * | srcLengthTensor, | ||
Rpp32f * | coeffTensor, | ||
RpptAudioBorderType | borderType, | ||
rppHandle_t | rppHandle | ||
) |
Pre Emphasis Filter augmentation on HIP backend.
Pre Emphasis Filter augmentation for audio data
- Parameters
-
[in] srcPtr source tensor in HIP memory [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 2, offsetInBytes >= 0, dataType = F32) [out] dstPtr destination tensor in HIP memory [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 2, offsetInBytes >= 0, dataType = F32) [in] srcLengthTensor source audio buffer length (1D tensor in HIP memory, of size batchSize) [in] coeffTensor preemphasis coefficient (1D tensor in Pinned / HIP memory, of size batchSize) [in] borderType border value policy [in] rppHandle RPP HIP handle created with rppCreateWithStreamAndBatchSize()
- Returns
- A
RppStatus
enumeration.
- Return values
-
RPP_SUCCESS Successful completion. RPP_ERROR* Unsuccessful completion.
◆ rppt_pre_emphasis_filter_host()
RppStatus rppt_pre_emphasis_filter_host | ( | RppPtr_t | srcPtr, |
RpptDescPtr | srcDescPtr, | ||
RppPtr_t | dstPtr, | ||
RpptDescPtr | dstDescPtr, | ||
Rpp32s * | srcLengthTensor, | ||
Rpp32f * | coeffTensor, | ||
RpptAudioBorderType | borderType, | ||
rppHandle_t | rppHandle | ||
) |
Pre Emphasis Filter augmentation on HOST backend.
Pre Emphasis Filter augmentation for audio data
- Parameters
-
[in] srcPtr source tensor in HOST memory [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32) [out] dstPtr destination tensor in HOST memory [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32) [in] srcLengthTensor source audio buffer length (1D tensor in HOST memory, of size batchSize) [in] coeffTensor preemphasis coefficient (1D tensor in HOST memory, of size batchSize) [in] borderType border value policy [in] rppHandle RPP HOST handle created with rppCreateWithBatchSize()
- Returns
- A
RppStatus
enumeration.
- Return values
-
RPP_SUCCESS Successful completion. RPP_ERROR* Unsuccessful completion.
◆ rppt_resample_gpu()
RppStatus rppt_resample_gpu | ( | RppPtr_t | srcPtr, |
RpptDescPtr | srcDescPtr, | ||
RppPtr_t | dstPtr, | ||
RpptDescPtr | dstDescPtr, | ||
Rpp32f * | inRateTensor, | ||
Rpp32f * | outRateTensor, | ||
Rpp32s * | srcDimsTensor, | ||
RpptResamplingWindow & | window, | ||
rppHandle_t | rppHandle | ||
) |
Resample augmentation on HIP backend.
Resample augmentation for audio data
- Parameters
-
[in] srcPtr source tensor in HIP memory [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 2 or 3 (for single-channel or multi-channel audio tensor), offsetInBytes >= 0, dataType = F32) [out] dstPtr destination tensor in HIP memory [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 2 or 3 (for single-channel or multi-channel audio tensor), offsetInBytes >= 0, dataType = F32) [in] inRate Input sampling rate (1D tensor in Pinned memory, of size batchSize) [in] outRate Output sampling rate (1D tensor in Pinned memory, of size batchSize) [in] srcDimsTensor source audio buffer length and number of channels (1D tensor in Pinned memory, of size batchSize * 2) [in] window Resampling window (struct of type RpptRpptResamplingWindow in HIP/Pinned memory) [in] rppHandle RPP HIP handle created with rppCreateWithStreamAndBatchSize()
- Returns
- A
RppStatus
enumeration.
- Return values
-
RPP_SUCCESS Successful completion. RPP_ERROR* Unsuccessful completion.
◆ rppt_resample_host()
RppStatus rppt_resample_host | ( | RppPtr_t | srcPtr, |
RpptDescPtr | srcDescPtr, | ||
RppPtr_t | dstPtr, | ||
RpptDescPtr | dstDescPtr, | ||
Rpp32f * | inRateTensor, | ||
Rpp32f * | outRateTensor, | ||
Rpp32s * | srcDimsTensor, | ||
RpptResamplingWindow & | window, | ||
rppHandle_t | rppHandle | ||
) |
Resample augmentation on HOST backend.
Resample augmentation for audio data
- Parameters
-
[in] srcPtr source tensor in HOST memory [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 2 or 3 (for single-channel or multi-channel audio tensor), offsetInBytes >= 0, dataType = F32) [out] dstPtr destination tensor in HOST memory [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 2 or 3 (for single-channel or multi-channel audio tensor), offsetInBytes >= 0, dataType = F32) [in] inRate Input sampling rate (1D tensor in HOST memory, of size batchSize) [in] outRate Output sampling rate (1D tensor in HOST memory, of size batchSize) [in] srcDimsTensor source audio buffer length and number of channels (1D tensor in HOST memory, of size batchSize * 2) [in] window Resampling window (struct of type RpptRpptResamplingWindow) [in] rppHandle RPP HOST handle created with rppCreateWithBatchSize()
- Returns
- A
RppStatus
enumeration.
- Return values
-
RPP_SUCCESS Successful completion. RPP_ERROR* Unsuccessful completion.
◆ rppt_spectrogram_host()
RppStatus rppt_spectrogram_host | ( | RppPtr_t | srcPtr, |
RpptDescPtr | srcDescPtr, | ||
RppPtr_t | dstPtr, | ||
RpptDescPtr | dstDescPtr, | ||
Rpp32s * | srcLengthTensor, | ||
bool | centerWindows, | ||
bool | reflectPadding, | ||
Rpp32f * | windowFunction, | ||
Rpp32s | nfft, | ||
Rpp32s | power, | ||
Rpp32s | windowLength, | ||
Rpp32s | windowStep, | ||
rppHandle_t | rppHandle | ||
) |
Produces a spectrogram from a 1D audio buffer on HOST backend.
Spectrogram for 1D audio buffer
- Parameters
-
[in] srcPtr source tensor in HOST memory [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32) [out] dstPtr destination tensor in HOST memory [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 3, offsetInBytes >= 0, dataType = F32, layout - NFT / NTF) [in] srcLengthTensor source audio buffer length (1D tensor in HOST memory, of size batchSize) [in] centerWindows indicates whether extracted windows should be padded so that the window function is centered at multiples of window_step [in] reflectPadding indicates the padding policy when sampling outside the bounds of the signal [in] windowFunction samples of the window function that will be multiplied to each extracted window when calculating the Short Time Fourier Transform (STFT) [in] nfft size of the FFT [in] power exponent of the magnitude of the spectrum [in] windowLength window size in number of samples [in] windowStep step between the STFT windows in number of samples [in] rppHandle RPP HOST handle created with rppCreateWithBatchSize()
- Returns
- A
RppStatus
enumeration.
- Return values
-
RPP_SUCCESS Successful completion. RPP_ERROR* Unsuccessful completion.
◆ rppt_to_decibels_gpu()
RppStatus rppt_to_decibels_gpu | ( | RppPtr_t | srcPtr, |
RpptDescPtr | srcDescPtr, | ||
RppPtr_t | dstPtr, | ||
RpptDescPtr | dstDescPtr, | ||
RpptImagePatchPtr | srcDims, | ||
Rpp32f | cutOffDB, | ||
Rpp32f | multiplier, | ||
Rpp32f | referenceMagnitude, | ||
rppHandle_t | rppHandle | ||
) |
To Decibels augmentation on HIP backend.
To Decibels augmentation for 1D/2D audio buffer converts magnitude values to decibel values
- Parameters
-
[in] srcPtr source tensor in HIP memory [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 2 or 3 (for single-channel or multi-channel/2D audio tensor with 1 channel), offsetInBytes >= 0, dataType = F32) [out] dstPtr destination tensor in HIP memory [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 2 or 3 (for single-channel or multi-channel/2D audio tensor with 1 channel), offsetInBytes >= 0, dataType = F32) [in] srcDims source tensor sizes for each element in batch (2D tensor in Pinned/HIP memory, of size batchSize * 2) [in] cutOffDB minimum or cut-off ratio in dB [in] multiplier factor by which the logarithm is multiplied [in] referenceMagnitude Reference magnitude if not provided maximum value of input used as reference [in] rppHandle RPP HIP handle created with rppCreateWithStreamAndBatchSize()
- Returns
- A
RppStatus
enumeration.
- Return values
-
RPP_SUCCESS Successful completion. RPP_ERROR* Unsuccessful completion.
◆ rppt_to_decibels_host()
RppStatus rppt_to_decibels_host | ( | RppPtr_t | srcPtr, |
RpptDescPtr | srcDescPtr, | ||
RppPtr_t | dstPtr, | ||
RpptDescPtr | dstDescPtr, | ||
RpptImagePatchPtr | srcDims, | ||
Rpp32f | cutOffDB, | ||
Rpp32f | multiplier, | ||
Rpp32f | referenceMagnitude, | ||
rppHandle_t | rppHandle | ||
) |
To Decibels augmentation on HOST backend.
To Decibels augmentation for 1D/2D audio buffer converts magnitude values to decibel values
- Parameters
-
[in] srcPtr source tensor in HOST memory [in] srcDescPtr source tensor descriptor (Restrictions - numDims = 2 or 3 (for single-channel or multi-channel/2D audio tensor with 1 channel), offsetInBytes >= 0, dataType = F32) [out] dstPtr destination tensor in HOST memory [in] dstDescPtr destination tensor descriptor (Restrictions - numDims = 2 or 3 (for single-channel or multi-channel/2D audio tensor with 1 channel), offsetInBytes >= 0, dataType = F32) [in] srcDims source tensor sizes for each element in batch (2D tensor in HOST memory, of size batchSize * 2) [in] cutOffDB minimum or cut-off ratio in dB [in] multiplier factor by which the logarithm is multiplied [in] referenceMagnitude Reference magnitude if not provided maximum value of input used as reference [in] rppHandle RPP HOST handle created with rppCreateWithBatchSize()
- Returns
- A
RppStatus
enumeration.
- Return values
-
RPP_SUCCESS Successful completion. RPP_ERROR* Unsuccessful completion.