Note
Go to the end to download the full example code
Audio representation
An audio signal can be represented in both, temporal and spectral domains. These representations are complementary and fundamental to understand the audio signal characteristics. In this introductory example we will load an audio signal, apply basic transformations to better understand its features in time and frequency.
Load an audio file and plot the waveform
It can be noticed that in this audio there are four consecutive songs of the spinetail Cranioleuca erythorps, every song lasting of approximatelly two seconds. Let’s trim the signal to zoom in on the details of the song.
s_trim = sound.trim(s, fs, 5, 8)
Onced trimmed, lets compute the envelope of the signal, the Fourier and short-time Fourier transforms.
Finally, we can visualize the signal characteristics in the temporal and spectral domains.
Total running time of the script: (0 minutes 0.504 seconds)