Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #376614

Re: low pass filter in PC soundcard?

Newsgroups sci.electronics.design
From Rob <nomail@example.com>
Subject Re: low pass filter in PC soundcard?
References (1 earlier) <nf43va5svjsmjhspn5kjs63l0arb6v8ruj@4ax.com> <slrnmv37c5.gak.nomail@xs9.xs4all.nl> <msv760$c1q$1@dont-email.me> <slrnmv6bds.hql.nomail@xs9.xs4all.nl> <msvhpm$kkf$1@dont-email.me>
Message-ID <slrnmv7int.fed.nomail@xs9.xs4all.nl> (permalink)
Date 2015-09-12 06:49 +0000

Show all headers | View raw


rickman <gnuarm@gmail.com> wrote:
> On 9/11/2015 3:38 PM, Rob wrote:
>> rickman <gnuarm@gmail.com> wrote:
>>> 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.
>>
>> Fortunately we require only audio up to about 3.5 kHz.  So a lowpass at
>> 5 kHz should not be a problem.
>>
>> We use the 48 kHz sample rate only to get accurate timing of the signal.
>> We want to output the same signal on different cards with timing equal
>> to within 10-20 us.  This is done by variable ratio resampling of the
>> audio using a software PLL.
>>
>> Actually I am considering to just set the card to the maximum rate
>> (96 kHz for these cards, 192 kHz for some others) instead of the fixed
>> 48 kHz rate.  The resampler can easily handle that, should only have
>> a look at some of the code and the buffer sizes.
>
> How do you get timing aligned at all in two cards with separate clocks? 
>   Even if the two units derive their clocks from a common clock, how do 
> you get the sampling started on the same foot?  Do you measure the audio 
> out of the cards and adjust your software driving them?

The Alsa software can capture timestamps (in nanosecond increments)
of the interrupt that the soundcard issues when it finishes a block.

From these timestamps, the relation between the free-running sample
clock and the real time can be determined, and the audio is resampled
at a variable rate to align the actual audio output with real time.
The variable rate is slowly adjusted to get the output on-time, i.e. all
those timestamps are targetted to be the same.

Actually, the "defect" being discussed here very nicely shows this system
in operation.  Because the sample clocks of the typical soundcard are
only accurate to about .01%, when putting the output from two cards on
the scope and triggering from one, it can be observed that the sinewaves
are snap on top of eachother but the samples output on the second card
slowly "wander" across the wave.

(note that the cards are not in the same system! the systems are each
time-synchronized to a GPS receiver outputting pulse-per-second.  for this
test, two complete setups were installed side-by-side on the workbench,
but normally they are installed at different sites)

Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

low pass filter in PC soundcard? Rob <nomail@example.com> - 2015-09-10 12:46 +0000
  Re: low pass filter in PC soundcard? John Larkin <jjlarkin@highlandtechnology.com> - 2015-09-10 07:23 -0700
    Re: low pass filter in PC soundcard? Rob <nomail@example.com> - 2015-09-10 15:11 +0000
      Re: low pass filter in PC soundcard? rickman <gnuarm@gmail.com> - 2015-09-11 14:41 -0400
        Re: low pass filter in PC soundcard? Rob <nomail@example.com> - 2015-09-11 19:38 +0000
          Re: low pass filter in PC soundcard? rickman <gnuarm@gmail.com> - 2015-09-11 17:42 -0400
            Re: low pass filter in PC soundcard? Rob <nomail@example.com> - 2015-09-12 06:49 +0000
              Re: low pass filter in PC soundcard? rickman <gnuarm@gmail.com> - 2015-09-12 03:26 -0400
                Re: low pass filter in PC soundcard? Rob <nomail@example.com> - 2015-09-12 08:10 +0000
                Re: low pass filter in PC soundcard? rickman <gnuarm@gmail.com> - 2015-09-12 04:17 -0400
                Re: low pass filter in PC soundcard? Rob <nomail@example.com> - 2015-09-12 08:25 +0000
                Re: low pass filter in PC soundcard? rickman <gnuarm@gmail.com> - 2015-09-12 10:35 -0400
                Re: low pass filter in PC soundcard? Rob <nomail@example.com> - 2015-09-12 15:31 +0000
                Re: low pass filter in PC soundcard? rickman <gnuarm@gmail.com> - 2015-09-12 11:42 -0400
                Re: low pass filter in PC soundcard? upsidedown@downunder.com - 2015-09-12 12:00 +0300
  Re: low pass filter in PC soundcard? dplatt@coop.radagast.org (Dave Platt) - 2015-09-10 13:07 -0700
    Re: low pass filter in PC soundcard? Rob <nomail@example.com> - 2015-09-11 08:09 +0000
      Re: low pass filter in PC soundcard? rickman <gnuarm@gmail.com> - 2015-09-11 14:45 -0400
        Re: low pass filter in PC soundcard? Rob <nomail@example.com> - 2015-09-11 19:33 +0000
  Re: low pass filter in PC soundcard? "Tim Williams" <tmoranwms@charter.net> - 2015-09-10 15:17 -0500
    Re: low pass filter in PC soundcard? Rob <nomail@example.com> - 2015-09-11 07:52 +0000

csiph-web