Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
14
augment.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from audiomentations import Compose, AddGaussianNoise, PitchShift, HighPassFilter | ||
import librosa | ||
import soundfile as sf | ||
|
||
aug = Compose([ | ||
AddGaussianNoise(min_amplitude=0.001, max_amplitude=0.01, p=1.0), | ||
PitchShift(min_semitones=0, max_semitones=0, p=1), | ||
HighPassFilter(min_cutoff_freq=20, max_cutoff_freq=170, p=1) | ||
]) | ||
|
||
def augmentSignal(signal, sr): | ||
aug_sig = aug(signal, sr) | ||
return aug_sig | ||
|