Forums

low pass filter in PC soundcard?

Started by Rob September 10, 2015
When looking at the output of a cheap C-Media CMI8768 based soundcard
(one of those tiny PCI-X cards that hold barely more than the chip,
a couple of output series caps and the connectors) I noticed there is
no low-pass filtering of the DAC output.  The output when sending a
sinewave is a staircase.  The samplerate was set to 48000, 96000 also
tried with similar effect.

Of course, when the signal is low-pass filtered the result again is
a good sinewave.  But a random other cheap soundcard shows a nice
sinewave directly on the output.

Does anyone have expierence with the common practice w.r.t. output
filtering in soundcards?  Can one expect a low-pass at half the sample
rate to be present on a typical low cost soundcard?  Is is present
in some of the widely used chips and not in others?
On 10 Sep 2015 12:46:59 GMT, Rob <nomail@example.com> wrote:

>When looking at the output of a cheap C-Media CMI8768 based soundcard >(one of those tiny PCI-X cards that hold barely more than the chip, >a couple of output series caps and the connectors) I noticed there is >no low-pass filtering of the DAC output. The output when sending a >sinewave is a staircase. The samplerate was set to 48000, 96000 also >tried with similar effect. > >Of course, when the signal is low-pass filtered the result again is >a good sinewave. But a random other cheap soundcard shows a nice >sinewave directly on the output. > >Does anyone have expierence with the common practice w.r.t. output >filtering in soundcards? Can one expect a low-pass at half the sample >rate to be present on a typical low cost soundcard? Is is present >in some of the widely used chips and not in others?
You can hardly expect quality in a $4 sound card. Your ears will have to do the filtering.
John Larkin <jjlarkin@highlandtechnology.com> wrote:
> On 10 Sep 2015 12:46:59 GMT, Rob <nomail@example.com> wrote: > >>When looking at the output of a cheap C-Media CMI8768 based soundcard >>(one of those tiny PCI-X cards that hold barely more than the chip, >>a couple of output series caps and the connectors) I noticed there is >>no low-pass filtering of the DAC output. The output when sending a >>sinewave is a staircase. The samplerate was set to 48000, 96000 also >>tried with similar effect. >> >>Of course, when the signal is low-pass filtered the result again is >>a good sinewave. But a random other cheap soundcard shows a nice >>sinewave directly on the output. >> >>Does anyone have expierence with the common practice w.r.t. output >>filtering in soundcards? Can one expect a low-pass at half the sample >>rate to be present on a typical low cost soundcard? Is is present >>in some of the widely used chips and not in others? > > You can hardly expect quality in a $4 sound card. Your ears will have > to do the filtering.
I am not talking about quality and price here, I only would like to ask if this behaviour is typical and if there maybe are chipsets with or without a post-DAC filter onboard. Of course my ears don't hear the 48000 (or 24000) Hz product, it is just something I noticed when checking the signal on a scope. Maybe someone else noticed it and can classify the soundcard chipsets.
>When looking at the output of a cheap C-Media CMI8768 based soundcard >(one of those tiny PCI-X cards that hold barely more than the chip, >a couple of output series caps and the connectors) I noticed there is >no low-pass filtering of the DAC output. The output when sending a >sinewave is a staircase. The samplerate was set to 48000, 96000 also >tried with similar effect. > >Of course, when the signal is low-pass filtered the result again is >a good sinewave. But a random other cheap soundcard shows a nice >sinewave directly on the output. > >Does anyone have expierence with the common practice w.r.t. output >filtering in soundcards? Can one expect a low-pass at half the sample >rate to be present on a typical low cost soundcard? Is is present >in some of the widely used chips and not in others?
Almost all audio DACs these days are high-oversampling designs (e.g. "delta-sigma"). They generate a pulse-width or pulse-density output stream at a rate that's a lot higher than the nominal sample rate. In effect, much of the low-pass filtering is done digitally (by the internal modulator). They usually include an analog post-conversion / reconstruction filter, but the cutoff frequency for this can be relatively high, and some chips may actually place the R-C network for it on the chip itself. It doesn't surprise me that a "cost sensitive" sound card may have ignored good practice and omitted the low-pass analog filter... that probably saved them a nickel or so, and in the race-to-the-bottom market that might have made the difference between sales and no-sales at the wholesale level. Most users would never notice. It would be interesting to put the bad card's output into a spectrum analyzer having at least a couple of MHz of bandwidth, and see just where the stairstep noise is. If the signal is stair-steppy at 96000 samples/second, this would put the first odd harmonic up at around 150 kHz - this might or might not be low enough to give the rest of your audio reproduction chain any difficulties. I've seen that sort of thing done, by some fairly big names in the consumer electronics industry. Years ago, I bought a Boca ethernet card, and found out that Boca had ignored Appendix B in the AMD PCNet chipset manual and had omitted most of the "critically important" bypass capacitors recommended in the design. The card turned out to be pattern-sensitive - there were some Ethernet packets it couldn't received, because certain 1-and-0 patterns induced excessive ringing and "ground bounce" in the chip's analog receiver and caused a 1-bit misread and an Ethernet CRC mismatch. Feh. Haven't bought anything made by Boca in the 20+ years since then.
Oooh, run the MyScope demo on it.  Should be wonderful.

Tim

-- 
Seven Transistor Labs
Electrical Engineering Consultation
Website: http://seventransistorlabs.com

"Rob" <nomail@example.com> wrote in message 
news:slrnmv2uu3.c9u.nomail@xs9.xs4all.nl...
> When looking at the output of a cheap C-Media CMI8768 based soundcard > (one of those tiny PCI-X cards that hold barely more than the chip, > a couple of output series caps and the connectors) I noticed there is > no low-pass filtering of the DAC output. The output when sending a > sinewave is a staircase. The samplerate was set to 48000, 96000 also > tried with similar effect. > > Of course, when the signal is low-pass filtered the result again is > a good sinewave. But a random other cheap soundcard shows a nice > sinewave directly on the output. > > Does anyone have expierence with the common practice w.r.t. output > filtering in soundcards? Can one expect a low-pass at half the sample > rate to be present on a typical low cost soundcard? Is is present > in some of the widely used chips and not in others?
Tim Williams <tmoranwms@charter.net> wrote:
> Oooh, run the MyScope demo on it. Should be wonderful.
I used a 500 MHz Tektronix digital scope.
Dave Platt <dplatt@coop.radagast.org> wrote:
> Almost all audio DACs these days are high-oversampling designs > (e.g. "delta-sigma"). They generate a pulse-width or pulse-density > output stream at a rate that's a lot higher than the nominal sample > rate. In effect, much of the low-pass filtering is done digitally (by > the internal modulator). They usually include an analog > post-conversion / reconstruction filter, but the cutoff frequency for > this can be relatively high, and some chips may actually place the R-C > network for it on the chip itself.
The result on the scope clearly showed a staircase with interval between the steps the same as the sample rate. Setting the sample rate from 48000 to 96000 halved the interval. I was using a demo program of Linux Alsa to generate the sine wave, so it generated more points of the sine in that case and the steps became smaller. I indeed had expected a construct similar to what you describe, but apparently it is different on this card. Or, the filter that is present actually filters the pulses that construct the output signal but not the transitions between the subsequent samples.
> It doesn't surprise me that a "cost sensitive" sound card may have > ignored good practice and omitted the low-pass analog filter... that > probably saved them a nickel or so, and in the race-to-the-bottom > market that might have made the difference between sales and no-sales > at the wholesale level. Most users would never notice.
Yes, that is of course the reason. Fortunately we have a lowpass further on in the circuit, but it is really something to watch because we use the audio to modulate an FM transmitter and of course there would be lots of garbage transmitted when this signal reaches the modulator.
> It would be interesting to put the bad card's output into a spectrum > analyzer having at least a couple of MHz of bandwidth, and see just > where the stairstep noise is. If the signal is stair-steppy at 96000 > samples/second, this would put the first odd harmonic up at around 150 > kHz - this might or might not be low enough to give the rest of your > audio reproduction chain any difficulties.
Yes I tried the "FFT" mode of the scope and indeed it showed a nice comb pattern.
> I've seen that sort of thing done, by some fairly big names in the > consumer electronics industry. Years ago, I bought a Boca ethernet > card, and found out that Boca had ignored Appendix B in the AMD PCNet > chipset manual and had omitted most of the "critically important" > bypass capacitors recommended in the design. The card turned out to > be pattern-sensitive - there were some Ethernet packets it couldn't > received, because certain 1-and-0 patterns induced excessive ringing > and "ground bounce" in the chip's analog receiver and caused a 1-bit > misread and an Ethernet CRC mismatch. Feh. Haven't bought anything > made by Boca in the 20+ years since then.
Hmm that is really bad... well, the datasheet from C-Media makes some recommendations about PCB layout and indeed the board is a multilayer with embedded ground plane, apparently something that does not cost as much as it used to. (these cards go for about 10 dollar including shipping from China) Our problem is that we need a card that we can be certain that it has a fixed low latency. We also used more expensive cards, but the "sound effects" stuff included on them is implemented in DSP and causes additional delays that vary between manufacturers and types. So we prefer a "bare DAC".
On 9/10/2015 11:11 AM, Rob wrote:
> John Larkin <jjlarkin@highlandtechnology.com> wrote: >> On 10 Sep 2015 12:46:59 GMT, Rob <nomail@example.com> wrote: >> >>> When looking at the output of a cheap C-Media CMI8768 based soundcard >>> (one of those tiny PCI-X cards that hold barely more than the chip, >>> a couple of output series caps and the connectors) I noticed there is >>> no low-pass filtering of the DAC output. The output when sending a >>> sinewave is a staircase. The samplerate was set to 48000, 96000 also >>> tried with similar effect. >>> >>> Of course, when the signal is low-pass filtered the result again is >>> a good sinewave. But a random other cheap soundcard shows a nice >>> sinewave directly on the output. >>> >>> Does anyone have expierence with the common practice w.r.t. output >>> filtering in soundcards? Can one expect a low-pass at half the sample >>> rate to be present on a typical low cost soundcard? Is is present >>> in some of the widely used chips and not in others? >> >> You can hardly expect quality in a $4 sound card. Your ears will have >> to do the filtering. > > I am not talking about quality and price here, I only would like to > ask if this behaviour is typical and if there maybe are chipsets with > or without a post-DAC filter onboard. > > Of course my ears don't hear the 48000 (or 24000) Hz product, it is > just something I noticed when checking the signal on a scope. > > Maybe someone else noticed it and can classify the soundcard chipsets.
A product I build uses an AK4552 CODEC which has 8x interpolation in the DACs. You can see these "bumps" in the signals generated, but since they are 8x the sample rate, they are not significant. Even at 8x the sample rate, they are hard to filter with something simple and small. I add a 1 pole roll off with -3 dB around 25 or 30 kHz (I don't recall the exact number) just to say I have a filter. I had to bump it up once to make sure I meet the performance spec at 20 kHz. Consider how much filtering would be needed to significantly reduce 48 kHz with a 20 kHz passband! Not so easy in a small, simple product. -- Rick
On 9/11/2015 4:09 AM, Rob wrote:
> Dave Platt <dplatt@coop.radagast.org> wrote: >> Almost all audio DACs these days are high-oversampling designs >> (e.g. "delta-sigma"). They generate a pulse-width or pulse-density >> output stream at a rate that's a lot higher than the nominal sample >> rate. In effect, much of the low-pass filtering is done digitally (by >> the internal modulator). They usually include an analog >> post-conversion / reconstruction filter, but the cutoff frequency for >> this can be relatively high, and some chips may actually place the R-C >> network for it on the chip itself. > > The result on the scope clearly showed a staircase with interval > between the steps the same as the sample rate. Setting the sample > rate from 48000 to 96000 halved the interval. I was using a demo > program of Linux Alsa to generate the sine wave, so it generated more > points of the sine in that case and the steps became smaller. > > I indeed had expected a construct similar to what you describe, but > apparently it is different on this card. Or, the filter that is present > actually filters the pulses that construct the output signal but not > the transitions between the subsequent samples. > >> It doesn't surprise me that a "cost sensitive" sound card may have >> ignored good practice and omitted the low-pass analog filter... that >> probably saved them a nickel or so, and in the race-to-the-bottom >> market that might have made the difference between sales and no-sales >> at the wholesale level. Most users would never notice. > > Yes, that is of course the reason. > Fortunately we have a lowpass further on in the circuit, but it is > really something to watch because we use the audio to modulate an FM > transmitter and of course there would be lots of garbage transmitted > when this signal reaches the modulator. > >> It would be interesting to put the bad card's output into a spectrum >> analyzer having at least a couple of MHz of bandwidth, and see just >> where the stairstep noise is. If the signal is stair-steppy at 96000 >> samples/second, this would put the first odd harmonic up at around 150 >> kHz - this might or might not be low enough to give the rest of your >> audio reproduction chain any difficulties. > > Yes I tried the "FFT" mode of the scope and indeed it showed a nice > comb pattern. > >> I've seen that sort of thing done, by some fairly big names in the >> consumer electronics industry. Years ago, I bought a Boca ethernet >> card, and found out that Boca had ignored Appendix B in the AMD PCNet >> chipset manual and had omitted most of the "critically important" >> bypass capacitors recommended in the design. The card turned out to >> be pattern-sensitive - there were some Ethernet packets it couldn't >> received, because certain 1-and-0 patterns induced excessive ringing >> and "ground bounce" in the chip's analog receiver and caused a 1-bit >> misread and an Ethernet CRC mismatch. Feh. Haven't bought anything >> made by Boca in the 20+ years since then. > > Hmm that is really bad... well, the datasheet from C-Media makes some > recommendations about PCB layout and indeed the board is a multilayer > with embedded ground plane, apparently something that does not cost as > much as it used to. > (these cards go for about 10 dollar including shipping from China) > > Our problem is that we need a card that we can be certain that it has > a fixed low latency. We also used more expensive cards, but the > "sound effects" stuff included on them is implemented in DSP and > causes additional delays that vary between manufacturers and types. > So we prefer a "bare DAC".
You can get low (or at least fixed) latency DACs up to a MHz or two I believe. You can interpolate the signals digitally with no added latency and get an effective sample rate much higher. Then simple filtering will be fairly useful. -- Rick
rickman <gnuarm@gmail.com> wrote:
>> Our problem is that we need a card that we can be certain that it has >> a fixed low latency. We also used more expensive cards, but the >> "sound effects" stuff included on them is implemented in DSP and >> causes additional delays that vary between manufacturers and types. >> So we prefer a "bare DAC". > > You can get low (or at least fixed) latency DACs up to a MHz or two I > believe. You can interpolate the signals digitally with no added > latency and get an effective sample rate much higher. Then simple > filtering will be fairly useful.
The latency of the DAC itself is not the problem, but a FIR/IIR filter inserted between the digital output and the DAC is. We used two different types (PCI and PCI-X) of Soundblaster Audigy cards and the latency differed by about 200us. Both of them probably have latency of some milliseconds. We need all soundcards to be within 10-20us of eachother (about 1 sample). Of course never a problem when all cards are the same, but I suspect it will be OK as long as all cards are without extra DSP. (as the Audigy has)