Skip to content

Commit

Permalink
Add documentation to the effects of certain augmentations
Browse files Browse the repository at this point in the history
Signed-off-by: smajumdar <[email protected]>
  • Loading branch information
titu1994 committed May 7, 2020
1 parent 603331e commit 6f41314
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions examples/asr/notebooks/4_Online_Data_Augmentation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## White Noise Perturbation"
"## White Noise Perturbation\n",
"\n",
"White Noise perturbation is performed by the following steps :\n",
"1) Randomly sample the amplitude of the noise from a uniformly distributed range (defined in dB) <br>\n",
"2) Sample gaussian noise (mean = 0, std = 1) with same length as audio signal <br>\n",
"3) Scale this gaussian noise by the amplitude (in dB scale) <br>\n",
"4) Add this noise vector to the original sample\n",
"\n",
"Notably, the original signal should not have a \"hissing sound\" constantly present in the perturbed version."
]
},
{
Expand All @@ -334,7 +342,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Gain Perturbation"
"## Gain Perturbation\n",
"\n",
"Gain perturbation is performed by the following steps :\n",
"1) Randomly sample the gain factor of the signal from a uniformly distributed range (defined in dB) <br>\n",
"2) Scale this original signal by the gain factor (in dB scale) <br>\n",
"\n",
"Notably, the tone of the original audio should sound slightly different as compared to the gain perturbed sample."
]
},
{
Expand All @@ -356,7 +370,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Shift Perturbation"
"## Shift Perturbation\n",
"\n",
"Shift perturbation is performed by the following steps :\n",
"1) Randomly sample the shift factor of the signal from a uniformly distributed range (defined in milliseconds) <br>\n",
"2) Depending on the sign of the shift, we shift the original signal to the left or the right. <br>\n",
"3) The boundary locations are filled with zeros after the shift of the signal <br>\n",
"\n",
"Notably, the perturbed signal below skips the first 25 to 50 seconds of the original audio below, and the remainder of the time is simply silence. "
]
},
{
Expand Down Expand Up @@ -497,7 +518,16 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Noise Augmentation"
"## Noise Augmentation\n",
"\n",
"Noise perturbation is performed by the following steps :\n",
"1) Randomly sample the amplitude scale of the noise sample from a uniformly distributed range (defined in dB) <br>\n",
"2) Randomly choose an audio clip from the set of noise audio samples available <br>\n",
"3) Compute the gain (in dB) required for the noise clip as compared to the original sample and scale the noise by this factor <br>\n",
"4) If the noise snippet is of shorter duration than the original audio, then randomly select an index in time from the original sample, where the noise snippet will be added <br>\n",
"5) If instead the noise snippet is longer than the duration of the original audio, then randomly subsegment the noise snippet and add the full snippet to the original audio <br>\n",
"\n",
"Notably, the noise perturbed sample should sound as if there are two sounds playing at the same time (overlapping audio) as compared to the original signal. The magnitude of the noise will be dependent on step (3) and the location where the noise is added will depend on steps (4) and (5)."
]
},
{
Expand Down

0 comments on commit 6f41314

Please sign in to comment.