How a CD player works: Difference between revisions

From Class Wiki
Jump to navigation Jump to search
Line 28: Line 28:
<math>=\sum_{m=-\infty}^\infty h\left (\frac{mT}{2}\right )e^{-j2\pi \frac{mT}{2}}</math>
<math>=\sum_{m=-\infty}^\infty h\left (\frac{mT}{2}\right )e^{-j2\pi \frac{mT}{2}}</math>
<br>
<br>
You can choose to make <math>h\left (\frac{mT}{2}\right )</math> be the shape you want so that the later affects of D/A conversion are compensated for. After this is done, it is exactly the same as before, you send the impulse functions to the D/A converter, and then from there to the low pass filter, and then out to the speakers to hear the music.
You can adjust the shape of <math>h\left (\frac{mT}{2}\right )</math> to compensate for the deformation that occurs during the D/A conversion phase of the reproduction. After this is done, it is the same process to recreate the signal, you send the impulse functions to the D/A converter, and then from there to the low pass filter, and then out to the speakers to hear the music.


===Other info===
===Other info===

Revision as of 20:27, 30 October 2006

Back to my page

How a CD player works

So, what is actually happening when you put a CD into your CD player? The disk spins and music comes out, but how exactly does that work? The answer is that it works by combining the properties of sampling and Fourier Transforms to change the data on the CD into the music coming out of the CD player.

Nyquist Theorem

The problem with a computer is that when it records the music, it actually is only sampling the wave over and over again, and then it stores those samples instead of the actual wave itself. The samples are usually expressed as a series of delta functions multiplied by their respective coefficients:

However, from these samples it is possible to recreate the original wave if the sampling rate is greater than or equal to twice the frequency of the maximum frequency of the wave being sampled. So,

This is called the Nyquist Theorem, and it allows us to select the sampling rate we need in order to recreate the music. The way we get to the Nyquist Theorem goes something like this: Lets say that our original frequency goes between . Because of the way sampling works, the frequency response will be duplicated every (the frequency difference between the center of the replicas. Also, we know that the difference between the upper portion of one replica and the lower portion of the next higher replica is going to be equal to . If we want , meaning that the two replicas have no overlap and are therefore reconstructable, we need => . So, our sampling frequency has to be at least twice the max frequency of our original signal in order keep the replications from overlapping. If the replicas don't overlap, we then have the chance to reconstruct the signal as it was originally received.

Dealing with the issues of sampling

Because a computer must use sampling in order to store music, it is necessary to have ways of turning the sampled data back into music. When we sample in time, it changes the characteristics of the frequency domain. This changes the music, so we need to figure out how to undo those changes and bring back the original music so that it will sound good to listen to. The change that occurs is called replication and it means that when we sample the music (we are sampling it in the time domain), the original frequency response of the music is replicated every 1/T Hz, which means that you are adding in a whole bunch of high frequency components that shouldn't be there. How do we fix this? Well, one method is to send the output (a series of impulse functions corresponding to the sampled values) through a perfect brickwall (basically brickwall means perfect) low pass filter that will take out all of the high frequency components and just leave the original sound wave. It would be nice if we could actually do this, but it doesn't exactly work that way, since it isn't humanly possible to create a perfect brickwall filter. So, instead we use other methods to create the output we are looking for, starting with the Digital to Analog converter.

D/A converter

A Digital to Analog converter doesn't send out impulse functions, instead it sends out a function that is a series of steps with the height of the steps being the height of the impulse functions stored in the data, basically convolving the impulse functions with a pulse of period T and amplitude 1. This changes things a bit. Because the impulse functions are being convolved with the pulse, their fourier transferms are being multiplied. The fourier transform of the pulse, when multiplied by the fourier transform of the impulse functions, changes the output in two ways. It deforms the response that we want, the low frequency components of the wave, but it also cuts out a big portion of the high frequency components we don't want since the frequency component of the pulse is zero in the middle of the higher frequency responses, thereby making the higher frequency replications much much smaller and less significant. This is very good because we can correct for the deformation of the response we want by adjusting for it in our low pass filter. In addition, we don't have to worry as much about the stuff we don't want, since it is mostly removed by the pulse function. The shape of the low pass filter is determined by the shape of the fourier transform of the pulse function. Then, after the signal passes through the low pass filter, it comes out of the speaker as music!

Two times oversampling

If you aren't satisfied by the pretty good method described above, then take a look at 2x oversampling. The biggest advantage given by 2x oversampling is that it completely knocks out the first replica of the frequency response that is created by sampling. This makes it much much easier to make a low pass filter that gives you an output that is the same, or at least very close to the same, as the original.

How it works

It starts the same way, by sampling the incoming signal. But then, in order to get a nicer wave to work with, we convolve the sampled values with another series of impulse functions. This series of impulse functions has a fourier transform that does two things. It is zero in the area of the first replica on either side, and it is shaped so that the top is slightly dished to compensate for the effects of the pulse function later on. The formula for these delta functions is:

  • Note, the period between these impulse functions is T/2, which is where the 2x comes from in 2x oversampling.


Also, the frequency response of this is:


You can adjust the shape of to compensate for the deformation that occurs during the D/A conversion phase of the reproduction. After this is done, it is the same process to recreate the signal, you send the impulse functions to the D/A converter, and then from there to the low pass filter, and then out to the speakers to hear the music.

Other info

Oversampling does not have to be 2x oversampling, there is also 1x oversampling, 3x oversampling, etc. The only difference between those and this is the period between the impulse functions that you convolve your data with, for 2x oversampling it is and for Nx oversampling it is .
Back to my page