The Need for a DAC
One of the things we have to remember is that the RPi does not have the hardware needed for good quality music rendering. So if you connect an amplifier or powered speakers directly to the RPi, the music you hear is going to be of low quality. This is what audiophiles call ‘flat’ music.
You are welcome to try it. But, believe me, the sound is quite poor in quality. The quality of sound in music is a very large and controversial subject. Frequency response, compression, sound stage, the separation between vocals and instruments, and a whole lot of other factors come into effect. For ages, there has been a war between audiophiles and the rest of the world as to what constitutes good and bad music. Leaving aside all that let us understand what we are talking about here.
All electronic circuits that work on sound have a process by which sound is converted from analogue to digital (ADC) and back to analogue (DAC) for play back. Even your basic telephone has one. If you take human voice, the frequency range is 85 to 180 Hz for an adult male and 165 to 255 Hz for an adult female. Thus your smartphone, for example, will be able to process audio signals within this range. All data outside this range can be considered as noise and simply chopped off.
If you take music, the minimum range for good music is 20 to 20,000 Hz. Strings, woodwinds, brass and percussion can generate frequencies that go to 40 kHz or above. A muted trumpet can go to 80 kHz. Violin and oboe go above 40 kHz while a cymbal can thump you at around 100 kHz. On the lower side, a symphonic double bass can go as low as 32 Hz. Obviously the audio signal processor of a typical smartphone cannot handle this frequency range. What you will hear when you play music with a signal processor of this kind is just frequency between roughly 70-400 Hz, with the rest cut off.
A good music player must be able to handle 10-20,000 Hz as well as look at frequencies outside this range with caution. It cannot simply cut off outside signals, but be able to understand the signal, identify actual noise, and filter just the noise out.
A Digital to Analog Converter (DAC) is a circuit that converts the digital audio signal into an analogue wave. Let me explain DAC in as simple a way as possible.
When you sing, your song is recorded on a tape as a wave. The wave has two components – frequency and amplitude. If represented physically, this will result in a series of pressure points. When the music is denser or faster, the pressure points will be closer to each other. When the music is sparse, the pressure points will be spread out (see image on the right).
Unfortunately, this way of representation does not make much sense. So what is done is to convert this into a wave pattern that can have a mathematical representation.
In this, the pressure points are represented as amplitude and frequency for a fixed time scale, mostly a second. These are represented on the Y-Axis across a time scale that is used as the X-Axis.