# A digital transformation

Transformation

Have you ever wondered how the music recorded by the Beatles, Pink Floyd or Led Zeppelin (or you for that matter!) is converted into its digital form? Just think of it: how do those carefree and chipper symphonies get converted into regimented bits of the digital world? The answer lies with the omnipotence of Mathematics;the wide applicability of the language of numbers provides tools to deal with something as complex as music. Music is complex because of its emotional aspect making it all the more difficult to be analyzed by a     scientific methodology. This improbable connection between Maths and Music really does seem astonishing. Melodies can be as varied as human temperaments and so the use of more advanced tools in Maths are required to study erratic patterns like that of music.

Such advanced tools were first developed from Joseph Fourier’s work that showed that representing functions as a sum of trigonometric functions greatly simplifies the study of heat transfer. This finding was further worked on to develop a powerful tool for studying complex functions. The method they used was in essence very similar to what Joseph Fourier had evolved and relied on the decomposition of complicated functions into simpler trigonometric sine functions. This method of “functional decomposition” is known today as Fourier decomposition(aka Fourier integral and Weierstrass transform).

When your friend plays his favorite piece of music on the guitar(or any other instrument he prefers), how does the recorder convert the musical notes into an audio clipping that is almost indistinguishable from the original tune he played? How are the physical rarefactions and compressions in the air converted into electrical signals?

The recorder performs Fourier decomposition! Your friend’s favorite piece of music(with slightly high asperity). Your friend’s music after Fourier decomposition.

Fourier decomposition relies on the fact that any wave that is periodic can be represented as the sum of sine waves.Examples of a few sinusoidal waves are given below: graph of sin(x) graph of sin(2x), it has double the frequency.

To completely represent a sine wave the following specifications are required:
1. Direction
2. Amplitude
3. Frequency/Wavelength
4. Phase Shift

The first three points seem pretty intuitive but what is the fourth point about?Consider the two graphs below: Graph of sin(x). Graph of sin(x+1.5). Compare the two graphs at x = 0.

From the above graphs it is evident that shifting a graph to the right or left along the x-axis results in a phase shift. In the above case on adding 1.5, the graph of sin(x) shifts to the left by 1.5 units.

If you compare the graph of the music played by your friend(say graph A) and the graph of sin(x)(say graph B), it can be observed that though graph A is periodic, it has a much different waveform than graph B. It is obvious that graph A cannot be represented by only a single sine wave and so it requires the summing up of a variety of waves. The group of sines that most closely sums up to  graph A  are shown below: Graph of y= 1.34sin(x). Graph of y = 1.56sin(2x). Graph of y = -2sin(4x).

If these three are added(try it on your graphing calculator!), the result is very close to the graph of the music played by your friend. But how would one find all these graphs? One way is to do it intuitively. However, that cannot achieve much specificity. It requires the  math formulae for Fourier decomposition. For math enthusiasts, below has been outlined the procedure that can used for accurately calculating the sines required to approximate a periodic complex function. $\textbf{f(x)} = \frac{\textbf{A}_\textbf{o}}2 + \sum \limits_{m=1}^\infty \textbf{A}_m \textbf{cos}(\frac{2\pi mx}\lambda) + \sum \limits_{m=1}^\infty \textbf{B}_m \textbf{sin}(\frac{2\pi mx}\lambda)$

where f(x) is the complex periodic function we wish to decompose into a sum of sine waves.

This formula includes even the cosine function, while I had said that only sine functions are necessary to represent any periodic complex function. However, you will also notice that there is no term in the first equation to define the phase shift in the sine waves. This requirement of phase shift is met by the inclusion of the cosine function. If the cosine function had not been included, the above equation could have equivalently been written as: $\textbf{f(x)} = \frac{\textbf{A}_\textbf{o}}2 + \sum \limits_{m=1}^\infty \textbf{B}_m \textbf{sin}(\frac{2\pi mx}\lambda + \phi)$,

where $\phi$ defines the phase shift. But it turns out that it is more convenient to deal with the first form rather than the second form of the equation.

Now considering each term in the equation one at a time. The term $\frac{\textbf{A}_0}2$ serves to define a sine wave with infinite wavelength. Suppose that we had to approximate the complex function with only one sine wave, which sine wave would be the best? It would be precisely this sine wave with a value of $\frac{\textbf{A}_0}2$. It is basically the average of the function values in each period. Consider the following example: The average value function for the above function would look something like this : Next considering the summation of the sine waves: $\sum \limits_{m=1}^\infty \textbf{B}_m \textbf{sin}(\frac{2\pi mx}\lambda)$.

The question arises as to why the summation upper limit is $\infty$ ? Well, the answer is simple: it is to increase the accuracy of the approximation. The greater the number of terms we add , the better will be our approximation of the complex function f(x)(it improves something that is called resolution). Next, $\textbf{B}_m$ is the amplitude of the sine wave as defined by the formula : $\textbf{B}_m = \frac{2}m \int \limits_{0}^\lambda \text{f(x)} \textbf{sin}(\frac{2\pi mx}\lambda) \text{ } dx$.

It can be interpreted as a weight that indicates how much of a particular sine wave is present in the complex function f(x).

Each part of the summation of the cosine functions has a similar role. The formula for $\textbf{A}_m$ is : $\textbf{A}_m = \frac{2}m \int \limits_{0}^\lambda \textbf{f(x)} \textbf{cos}(\frac{2\pi mx}\lambda) \text{ } dx$.

If you are inclined enough to perform these operations, you can functionally decompose many complex functions into a sums of sine and cosine waves. However, they do exist plenty of monstrous functions that don’t give way to their secrets so easily and it requires more effort(plenty of scary maths and so they will not be discussed here) to capture such beasts.

The outcome of this process of Fourier transformation: you are enabled to record your friend’s music and listen to it in moments of nostalgia, reminiscence, reflection,…etc.Also on a more practical tone, the process of Fourier transformation helps to save a lot of digital storage space  since it helps to convert a complex piece of music into smaller trigonometric functions that can be easily stored by a computer. This is the essence of the technology behind MP3. Actually, the application of Fourier transforms is much more ubiquitous and it is used in solutions to many problems in fields ranging from optics to X-ray crystallography(Cricks and Watson used it to decode the double helix structure of the DNA), voice recognition programs(Siri!) and MRI scans.You could even start a lucrative business out of selling your friend’s music to teenagers all around the world!

Advertisements

## 6 thoughts on “A digital transformation”

1. Hindu Reddy says:

It is very intriguing. It is great to see that you wrote something uncommon and complex.
Following you.
Do check my blog out. 🙂
Cheers!

Like

• Daksh says:

Great to hear you thoughts! I will surely check out your blog.

Like

2. Jirah Merizz says:

Oh my … You’re a math wizard and maybe I’ll be needing your help! Kidding. Haha followed you 🙂

Have a great day wherever you are! X

Liked by 1 person

• Daksh says:

Thanks!

Liked by 1 person

3. docstormy says:

My wife Elzbieta finished Economics at University and had her brain infiltrated by Math;she thinks clear and to the point (even too much). I will ask her to explain this is me…..

Liked by 1 person

• Daksh says:

Thanks a lot.I hope your wife infects you with her zeal towards Math !

Like