element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Pi-Fest
  • Challenges & Projects
  • Design Challenges
  • Pi-Fest
  • More
  • Cancel
Pi-Fest
Blog Songspire - Data Augmentation for Audio
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Leaderboard
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: feiticeir0
  • Date Created: 16 Jun 2022 10:37 AM Date Created
  • Views 881 views
  • Likes 7 likes
  • Comments 1 comment
  • data augmentation
  • machine learning audio classification
  • songspire
  • audio augmentation
  • machine learning
  • pi-fest
Related
Recommended

Songspire - Data Augmentation for Audio

feiticeir0
feiticeir0
16 Jun 2022
Songspire - Data Augmentation for Audio

Songspire

Hi all ! Hope everyone is fine.

Today we're going to talk about Data Augmentation, apply it to audio and why it's important.

In a Machine Learning model training, data is everything. With enough data, the model can learn better and perform better. At least, that's theory . Slight smile

Sometimes, because of the nature of the data or the problem trying to be solved, we can't always get enough or good data.  In that cases, it's necessary to artificially augment the data.

Images

In case of images, there are several ways we can do this - creating new images:

  • cropping
  • rotating
  • scale
  • modify colors
  • add some noise

The label of the image (another post with this) stays the same - because the subject hasn't changed - it's still the same image - but slightly altered.  From the model's stand point, it is new data.

Audio

Just like for images, for audio there's also some techniques for audio augmentation. In the case of audio, the augmentation can be done on the raw audio before producing the spectrogram or after the generation of the spectrogram. Augmenting the spectrogram generally produces better results.

Let's generate some data.

Here's the original file - a Cuckoo call - waveform and spectrogram

imageimage

Noise

We can add some noise to the sample, randomly.

Here's the waveform, with a 0.02 noise factor:

image

Time shift

Here's the same waveform, time shifted by 1s to the right. We start with silence.

image

Pitch

Here's the same Cuckoo call with a change pitch, by factor of 3:

image

Speed

We can also change the speed of the audio. Here's the same cuckoo call with an increased speed by a factor of 10:

image

Conclusions

While this might help a bit, it's no substitution for real data. This will help the model get better, but it's always generated from real data.  We can't just generate synthetic data from all the audio clips. It's necessary to understand the changes that these methods do to the original data and if they will help .

We can add all the transformations we can think off to the audio. I've only added one each time, but there's nothing that stops me to change the pitch and the speed to the same clip. The only thing is - does it make it any good ? Is it worth it ? Will it help the model ?

Because it's always better to hear than to see, the augmented audio files are attached to the post if you're interested to hear the differences.

Original file

Play this audio clip

Noise added

Play this audio clip

Pitch changed

Play this audio clip

Time shifted

Play this audio clip

Speed change

Play this audio clip

References

https://medium.com/@makcedward/data-augmentation-for-audio-76912b01fdf6

https://towardsdatascience.com/data-augmentation-for-speech-recognition-e7c607482e78

https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.wavfile.write.html

https://towardsdatascience.com/audio-deep-learning-made-simple-part-3-data-preparation-and-augmentation-24c6e1f6b52

  • Sign in to reply
  • DAB
    DAB over 3 years ago

    Nice effects.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube