Educate the ignorant (me), please.

drizzt81

[H]F Junkie
Joined
Jan 21, 2004
Messages
12,361
for some odd reason I ended up in this subforum today and read this thread on Bit-perfect which has prompted a bunch of questions from my end, and rather than litter in someone else's thread more than I already have, it appeared smart to start a new one with all my questions/ concerns in one. Since I have a EE undergraduate degree, I am not complete ignorant when it comes to the sampling theorem etc, which may be the underlying reason for my question(s).

Most audio that I purchase (on CDs) is encoded in 44.1kHz. I am under the impression that most audio in PC games is supplied either as a .wav or as an mp3 file (hence that miles sound system and frauenhofer copyright notice), both of which are commonly sampled at 44.1kHz. If this is correct, why would someone want to upconvert that to 48kHz? The information content is not going to change. Is 48kHz required for certain receivers or to stream multi-channel audio or dolby digital signals? Basically, why is a 48kHz signal desirable, given a 44.1kHz source?
 
Well, I'm not perfectly sure the following is abso-correct (speculation for the most part), but I'll give it a shot.

Games may have a basic mixing system which can be thought of as stemming or sub-grouping. Audio streams are classified in some manner (effects, footsteps, music, ambience, etc.) and sorted into a basic mixing system. However, this “mixer” only determines levels of audio streams defined in these stems - the sound card processor itself is responsible for playback and final mixing (usually a higher resolution process, such as 40 bit or 32 bit floating point) of these independent audio streams into the same number of channels as the desired output. The X-Fi, for instance, can perform simultaneous playback of 64 independent audio streams, while the Fatality can handle 128 playback streams. In the end, however, these independent audio channels must be mixed down to match the desired output. The Windows mixer operates in a mostly similar fashion, being able to play back audio streams of varying word lengths/sample rates.

Digital to analog conversion is very near to the last step in the sound card's output chain and is limited to discrete channels, so there must be, at some stage, a mix-down to match the output capabilities/settings of the card. I believe resampling occurs prior to this mix-down process. If you had enough DACs, however, resampling would not be nessecary, and output would only be limited to the number of independent DACs available. Mixing would then occur in the analog domain, prior to line amplification to output.

You can choose any number of sampling rates to feed to the mixer, but most choose 48kHz for a couple reasons. The first and most obvious is that 48kHz is a higher sampling rate than the typically used 44.1kHz, so there's little loss of quality when performing this upconversion. The second is probably due to architectural bandwidth limitations. And yes, DVDs exist in the 48kHz domain, but this isn't really an important issue here, as the card must resample regardless of the source. Should a Windows error pop up and emit some sort of hideous beep while you're watching Fight Club, that 44.1kHz audio file cannot be fed to the mixer/DAC(s) independently. It must be mixed with the audio from the DVD player and resampled before being fed to the DAC(s). Manufacturers could be a little "nicer" here, allowing you to disable resampling when using the digital output, and when it detects DD/DTS, but they haven't really been nice – for the most part, they don’t want an ambiguous switch that could end up breaking the entire system.

Now, when you build a spare-no-expense sound card, you'd resample to the highest sample rate possible before conversion, which would be 192kHz (unless you cook up your own 384kHz converters), and you'd mix internally with obscene amounts of precision (40 bit floating point, perhaps), but in the real world, processing power and bandwidth is limited. You'd probably also give users the option to disable resampling, but this would probably wreak all sorts of havoc. You'd have to determine the sample rate of your source material and anything that does not match that sampling rate is simply not mixed before output to the DAC.
 
phide said:
Well, I'm not perfectly sure the following is abso-correct (speculation for the most part), but I'll give it a shot.

Games may have a basic mixing system which can be thought of as stemming or sub-grouping. Audio streams are classified in some manner (effects, footsteps, music, ambience, etc.) and sorted into a basic mixing system. However, this “mixer” only determines levels of audio streams defined in these stems - the sound card processor itself is responsible for playback and final mixing (usually a higher resolution process, such as 40 bit or 32 bit floating point) of these independent audio streams into the same number of channels as the desired output. The X-Fi, for instance, can perform simultaneous playback of 64 independent audio streams, while the Fatality can handle 128 playback streams. In the end, however, these independent audio channels must be mixed down to match the desired output. The Windows mixer operates in a mostly similar fashion, being able to play back audio streams of varying word lengths/sample rates.
so far I am with you and understand:

(d) - > digital format.
Code:
audio_strm 0 (d) -- |          |
audio_strm 1 (d) -- | mixer | -- output stream (d) -- [DAC] -- output strm (analog)
audio_strm 2 (d) -- |          |
phide said:
Digital to analog conversion is very near to the last step in the sound card's output chain and is limited to discrete channels, so there must be, at some stage, a mix-down to match the output capabilities/settings of the card.
I have already included the DAC in my little graph. Since my knowledge of DAC's is limited, I figured I'd look at what Analog Devices has to offer for audio DACs. From the list, I picked a mid/ upper rand device, the AD1852 and looked at the datasheet. For this particular DAC, we have multi-sample rate inputs, i.e. it should work regardless of what sample rate our mixer produces.
Looking at their absolutely cheapest option, the AD1858(datasheet) we find a DAC that is "intended for “Redbook” 44.1 kHz sample frequency playback
from Compact Discs". Looking at page 4, we once again find that it does support 48kHz input.

So it seems that DACs that support multiple sampling frequencies are cheap (<$4/ piece for 1k of them) and available. Does creative skimp on their DACs, or do they need something special, for their six/ seven/ eight channel output? In the end, their high-powered chip should be able to product three or four separate output streams, one of each "pair" of channels, shouldn't it?



phide said:
You can choose any number of sampling rates to feed to the mixer, but most choose 48kHz for a couple reasons. The first and most obvious is that 48kHz is a higher sampling rate than the typically used 44.1kHz, so there's little loss of quality when performing this upconversion.
And here is what I do not understand. Why upconvert at all, when downcoverting after mixing? Would it not be sufficient to mix the signals in the 44.1kHz domain? I know little of digital mixing, since it obviously is not as simple as mixing analog signals.

[time passes]
I found this article which talks about mixing two or more digital signals. Apparently mixing them is sample rate independent, and only cares about the individual sample values.

and then i started thinking (yeah, now it get dangerous):

If we add two signals, which are not in-phase, their sum can create a signal that contains a higher frequency. So it'd make sense to have our digital mixer be able to represent higher frequencies than either of our source signals....

so I guess with some of your help I have just answered my own question.
 
Of course, it all depends on the DACs in use on the Creative cards, and I'm not certain what they're using. In the end, however, they can save on using expensive multi-channel DACs by mixing down to number of channels in the final output by means of resampling. It's true that you can mix in the digital realm without sample rate conversion (because PCM is a completely time based process), but feeding the DAC(s) is the point at which you need to come to some sort of uniformity, because the number of DACs is always going to be limited. It's also important to remember that not all DACs operate like the Analog Devices DACs, such as some of the upper-tier Texas Instruments units, which are only capable of converting up to two streams (though they have much more expensive four-channel units). For Creative, it's easier and cheaper to insitigate resampling, mix down to stereo, for instance, and then feed a single DAC.

I don't believe they resample twice, however, as the resampling is selectable from 48kHz to 96kHz for the digital output. I'd assume this path does not operate in a seperate way from the analog path, so resampling is performed (either before or after the mixer, but before would be preferable in terms of processing time, I'd think) and the DAC is simply bypassed. So, changing that setting may actually affect resampling globally, also applying to the analog output signal path. The DAC used is likely variable, as are some of those that you've listed, being able to operate with a 48kHz or 96kHz input.

Phase coherency is something to consider as well, as you've mentioned, as PCM is suspect to the Nyquist theoreom, that being that a digital PCM signal can only represent frequencies of less than half the sample rate or lower. If Creative generally sticks with 48kHz resampling, I'd use 176.4kHz, that being exactly four times the rate of 44.1kHz, making math easy and increasing overall output quality of the DAC (its own clocking would be more precise, and the higher sample rate would increase the SNR). Such a signal could comfortably handle frequencies up to about 87kHz (because Nyquist filters are not brick walls).
 
/me needs to unpack his EE books after all. somewhere there must be my digital signals book.
 
On an off-topic note, if you want to make some coin as an electrical engineer, design a quality, single channel, single input ADC built around one of the top-tier Texas Instruments 24/192 chips. There are so few options for pros who are looking for a little more in the way of options concerning ADCs; for the most part, w'e're stuck with very expensive multi-channel converters built with roughly $150 in parts, and sold for $3000+.

If you could design a very simple, small and excellent quality ADC box for ~$300 per channel, you'd that there's a pretty bitchin' market for it. Your profit after BOM would be outlandishly high, even with such a selling price. Something to chew on :)
 
Did you read my response from the other thread? :confused:

Basically most non-creative cards support bit-perfect playback. It's not hard to do, or even costly. But those cards don't have a hardware DSP like Creative does. This DSP is very costly (transistor wise) and couldn't support many sampling methods (only 48/96kHz and the only reason Creative could support 96kHz is 96khz is just double the information of 48kHz, it's a perfect 2:1 ratio that required very few extra transistors to support).

Why support 48kHz over 44.1kHz? Easy, Windows kMixer (anything that uses DirectSound really, which is like everything) resamples all audio to 48kHz (makes it easier [less compatibility issues with sound cards] to have all output audio streams sampled the same, although it's not necessary to have all the audio streams sampled the same, one could use Kernel Streaming/ASIO/etc to bypass the kmixer). Since practically all applications use DirectSound as their output (even foobar uses DirectSound as its default output, Kernel Streaming and ASIO are only offered as plugins), Creative deemed it unimportant to dedicate transistor space to 44.1kHz playback on their hardware DSP. It was "cheaper" to support a SRC.

The problem for Creative isn't DAC's (they are cheap), it's their DSP. Now on the X-Fi, there is bit-perfect playback only on a mode (Audio Creation Mode) that disables EAX HD (EAX 3/4/5) because even with the X-Fi's 51 million transistors, it doesn't have enough power to support 44.1kHz playback simultaneously with EAX HD on their hardware DSP.

Offtopic, just to correct phide a small matter, all X-Fi cards support up to 128 hardware audio streams with OpenAL (DirectSound has a cap of 64 audio streams).
 
Moofasa~ said:
...Windows kMixer (anything that uses DirectSound really, which is like everything) resamples all audio to 48kHz (makes it easier [less compatibility issues with sound cards] to have all output audio streams sampled the same, although it's not necessary to have all the audio streams sampled the same, one could use Kernel Streaming/ASIO/etc to bypass the kmixer)
Interesting. Do you know at which point in the processing chain sample rate conversion occurs?

Moofasa~ said:
Offtopic, just to correct phide a small matter, all X-Fi cards support up to 128 hardware audio streams with OpenAL (DirectSound has a cap of 64 audio streams).
Quite on topic, actually :) As for the error, I think I just need to stop getting any information at all from Bit-Tech.
 
Interesting. Do you know at which point in the processing chain sample rate conversion occurs?

I do not know exactly where this occurs, but I would assume fairly close to the beginning. But I do know it does occur; this is why Microsoft added Kernel Streaming into 2000/XP/Vista so files that absolutely needed bit-perfect playback could bypass the kmixer.
 
Moofasa~ said:
Did you read my response from the other thread? :confused:
I did, but it did not answer all my questions and I did not want to derail that thread any more. I appreciate you posting in here.
Moofasa~ said:
Basically most non-creative cards support bit-perfect playback. It's not hard to do, or even costly. But those cards don't have a hardware DSP like Creative does. This DSP is very costly (transistor wise) and couldn't support many sampling methods (only 48/96kHz and the only reason Creative could support 96kHz is 96khz is just double the information of 48kHz, it's a perfect 2:1 ratio that required very few extra transistors to support).

Why support 48kHz over 44.1kHz? Easy, Windows kMixer (anything that uses DirectSound really, which is like everything) resamples all audio to 48kHz (makes it easier [less compatibility issues with sound cards] to have all output audio streams sampled the same, although it's not necessary to have all the audio streams sampled the same, one could use Kernel Streaming/ASIO/etc to bypass the kmixer). Since practically all applications use DirectSound as their output (even foobar uses DirectSound as its default output, Kernel Streaming and ASIO are only offered as plugins), Creative deemed it unimportant to dedicate transistor space to 44.1kHz playback on their hardware DSP. It was "cheaper" to support a SRC.

The problem for Creative isn't DAC's (they are cheap), it's their DSP. Now on the X-Fi, there is bit-perfect playback only on a mode (Audio Creation Mode) that disables EAX HD (EAX 3/4/5) because even with the X-Fi's 51 million transistors, it doesn't have enough power to support 44.1kHz playback simultaneously with EAX HD on their hardware DSP.
good to know. I would have figured that with a soundcard that sells for somewhere between $100-$300 the DSP-IC would be powerful enough for this.
 
Creative's professional line does support both sampling rates natively, along with the respective 2:1 ratios.
 
Empyrean said:
Creative's professional line does support both sampling rates natively, along with the respective 2:1 ratios.

That is correct, but it also doesn't have a hardware DSP. I mean even that $20 dollar chaintech card has bit-perfect playback (but once again no hardware DSP).
 
Back
Top