100 Days Of ML Code — Day 075

100 Days Of ML Code — Day 075

Recap From Day 074

Day 074, we looked at the third part of designing custom algorithms for music. You can catch up using the link below. 100 Days Of ML Code — Day 074 Recap From Day 073medium.com

We’ve learned a lot in the last 74 days. One thing I realized is that exploring some of the fundamentals of music technology, the way sound works, the way we represent it digitally, the way we convert it between different representations will be a nice to have.

So, today, we’ll look at the very basics of sound waves, the way we look at them visually in terms of waveforms. The way they act as functions. And how sine waves are a particularly important function to think of with sound waves. And three important properties of them. Amplitude, frequency and phase.

So let’s get started

Sound Waves

Definition

“A sound wave is the pattern of disturbance caused by the movement of energy traveling through a medium (such as air, water, or any other liquid or solid matter) as it propagates away from the source of the sound. — https://whatis.techtarget.com/definition/sound-wave

The image below is that of a waveform. You’ve probably seen something like it before. It’s a basic way of representing sound visually. What we have below is, on our X-axis is time. On our Y-axis we have amplitude. I’ll explain more about amplitude later. One important thing to note about this is that it’s actually a function. For each x value we have, each time value, we have exactly one, one and only one, amplitude value it corresponds to.

WaveformWaveform

You can see the waveform shown above and you can see how the amplitudes are going up and down over time. And you can see the silence at the beginning. So like I said, waveforms like the one shown above are functions and so we could think about them as actually being mathematical functions.

So what would make a good function for a waveform? We could think of something like for example y equals x squared that might make an interesting function. But, there’s a little problem with that because as our time increase on our time axis our amplitude would eventually kind of go away, up, up, and off to infinity. That’s probably not something that we want.

Instead, we want something where the amplitude is always going to stay within a particular range, between a particularly high and low and so on. A better choice might be something like a periodic function like y equals sine of x because then, It’ll go up and down and up and down over and over again. It will always stay within a particular range.

That’s all for day 075. I hope you found this informative. Thank you for taking time out of your schedule and allowing me to be your guide on this journey. And until next time, be legendary.