Originally Posted by earthtodan
Sugarshark, I think you get the source of my confusion. With data there is no component of high or low voltage, there is just information. And since I'm transferring via a USB port, I know the sound card isn't in the chain. Yet somehow the computer is transmitting volume. So it either has to be information based (maybe on a separate wire?) or there is actually a voltage signal somewhere. I know very little about computers but I'm trying to make sense of this, and make sure the computer is not "driving" the signal since that's what a DAC is supposed to fix.
Alright, I'll try to explain in more detail. I am not an expert in digital signal processing, so I'll be glossing over some details, but it should give you a good idea of the principles of whats going on.
So in this example, we have a USB connection between your computer and the DAC. This wire is obviously transferring an electrical signal, and of course all electrical signals are analogue by nature. So if it is an analogue signal, how come it's referred to as digital?
Different links encode information differently, and I'm not going to find a data sheet on USB (which would be too confusing for this example anyway), but imagine a simple encoding scheme where you sample the signal, and if you read 1.0v it means "1" and 0.0v it means "0". The receiver will check the voltage on the input at fixed intervals, and record the results (i'm glossing over complexities around timing between sender/receiver here). To transfer the message "hello world" you could send the following bit stream:
"01101000 01100101 01101100 01101100 01101111 00100000 01110111 01101111 01110010 01101100 01100100"
The message above was formed by taking each character and looking up the special binary value in the ASCII table (very common character encoding scheme). The receiver of the message uses the table in reverse to reconstruct the message.
So now imagine that instead of receiving 1.0v to indicate the current data bit should be a "1", the receiver instead receives 0.9v. In real systems you do get some variance, and the receiver might be set up to accept a range of 0.7v-1.3v as a "1". The reason I mention this is because it illustrates an important difference between analogue and digital signals. In an analogue encoded signal, this would irreversably alter the input signal. However, on a digitally encoded system, it would still be read as the correct value.
Getting back to your original example. What the PC is actually sending to the DAC is chunks of digitally encoded audio. Practical encoding schemes are a lot more complicated than the above example, but essentially what it boils down to encoding the information of "play frequency X at Y volume" thousands of times per second. When CD audio is encoded (redbook format), the input signal is sampled and encoded 44100 times per second. This is what the 44.1k sample rate refers to. The number of bits (16 for CD) refers to the number of bits used to store that information. A higher bit rate means a small step size between each value, and therefore higher precision.
With this in mind, you can clearly see that the input voltage level at any given moment does not directly represent the output volume.
Modern OS's do some clever stuff with audio and this leads into what I was talking about earlier. If you have an audio file saved on your computer, when you play it, the bits inside the file are not necessarily exactly the same as what gets sent to the DAC (this is what people aim for though when they talk about "bit perfect" audio). When the music player decodes the stored music and plays it, it doesn't send it straight to the hardware. It sends it to a "virtual device", which is managed by the OS. The OS can then potentially be doing all kinds of other stuff like mixing with other streams, resampling or changing the volume. At some point the OS mixer will re-encode each sample, and send it to your actual hardware (in this case, the DAC).
When you are using the volume control in your player it takes 1 (or more) samples and changing the information in it. Instead of 'play X frequency at Y volume' it changes it to Z volume. It's also possible to change the frequency encoded in the sample; this is what software EQ controls do.
(full disclosure: I am a software developer but I am not initimately familar with how PCM encoding works. It's not relevant to the type of work I do. Not really keen to spend days poring over RFC specs to find out )
You can avoid these changes to the stored audio signal, but the details depend on your hardware and software configuration. For my pc at home I am using windows 7, foobar, and the microsoft WASAPI driver. This special driver bypasses the central mixer, and sends the audio straight to the device.
hope this helps ..
Edited by sugarshark - 8/20/13 at 4:53am