DSPRelated.com
Forums

Band limited signal into soundcard with sample & hold?

Started by Ben Jackson July 7, 2006
Let's say I have a signal of <= 20kHz but not at baseband.  I want to
use my soundcard as an ADC to undersample the signal, but I don't want
to modify the card to remove the anti-aliasing filter.  Could I just
chop the signal with an analog sample & hold (with an input bandwidth
suitable for the maximum input frequency) at the soundcard's sample
rate?  How critical would it be for the S&H clock to exactly match the
ADC clock?

-- 
Ben Jackson AD7GD
<ben@ben.com>
http://www.ben.com/
Ben Jackson wrote:
> Let's say I have a signal of <= 20kHz but not at baseband. I want to > use my soundcard as an ADC to undersample the signal, but I don't want > to modify the card to remove the anti-aliasing filter.
In theory, yes. Chopping the signal that way would effectively heterodyne it to baseband.
> Could I just > chop the signal with an analog sample & hold (with an input bandwidth > suitable for the maximum input frequency) at the soundcard's sample > rate? How critical would it be for the S&H clock to exactly match the > ADC clock?
It would need to be phase locked within a narrow range of phases. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Ben Jackson wrote:
> Let's say I have a signal of <= 20kHz but not at baseband. I want to > use my soundcard as an ADC to undersample the signal, but I don't want > to modify the card to remove the anti-aliasing filter.
In theory, yes. Chopping the signal that way would effectively heterodyne it to baseband.
> Could I just > chop the signal with an analog sample & hold (with an input bandwidth > suitable for the maximum input frequency) at the soundcard's sample > rate? How critical would it be for the S&H clock to exactly match the > ADC clock?
It would need to be phase locked within a narrow range of phases. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Ben Jackson wrote:
> Let's say I have a signal of <= 20kHz but not at baseband.
does this mean that the signal <= 20kHz is modulated up to a higher frequency and *that* is the signal that you actually "have"?
> I want to > use my soundcard as an ADC to undersample the signal, but I don't want > to modify the card to remove the anti-aliasing filter.
any soundcard ADC can sample that 20kHz signal, if that is what you have.
> Could I just > chop the signal with an analog sample & hold (with an input bandwidth > suitable for the maximum input frequency) at the soundcard's sample > rate?
sample & holds don't chop. switches (or multiplexers) do. sample and holds sample and hold what they sample.
> How critical would it be for the S&H clock to exactly match the > ADC clock? > > -- > Ben Jackson AD7GD > <ben@ben.com> > http://www.ben.com/
wow. i wonder if i could get bob.com. r b-j
Jerry Avins wrote:
> Ben Jackson wrote: >> Let's say I have a signal of <= 20kHz but not at baseband. I want to >> use my soundcard as an ADC to undersample the signal, but I don't want >> to modify the card to remove the anti-aliasing filter. > > In theory, yes. Chopping the signal that way would effectively > heterodyne it to baseband. > >> Could I just >> chop the signal with an analog sample & hold (with an input bandwidth >> suitable for the maximum input frequency) at the soundcard's sample >> rate? How critical would it be for the S&H clock to exactly match the >> ADC clock? > > It would need to be phase locked within a narrow range of phases.
That works only if you can adjust the sample rate. A simpler method uses a front end that beats the lower edge of the band to DC. That scheme or any other depends on the spectrum below the desired band being clear of signal, either naturally or because of a filter. Many spectrum analyzers work that way. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
On 2006-07-07, Jerry Avins <jya@ieee.org> wrote:
> Jerry Avins wrote: >> Ben Jackson wrote: >>> How critical would it be for the S&H clock to exactly match the >>> ADC clock? >> >> It would need to be phase locked within a narrow range of phases. > > That works only if you can adjust the sample rate. A simpler method uses > a front end that beats the lower edge of the band to DC.
Aren't those two answers contradictory? My original thought was that if the original signal was undersampled and then run through a DAC, then *that* signal would have the desired alias at baseband. So you cut out the middle man and replace the ADC+DAC with just the S&H from the front end of the ADC. The normal DAC output filter action is performed by the soundcard's input anti-aliasing filter. More generally, as you pointed out, this is just producing one of the mixing products n*F +/- m*Fs, and if I choose Fs = F then even though the sample rates don't match, the signal has still been moved down to the soundcard's input frequency. Why does synchronization with the soundcard's sample rate matter depending on the beat frequency? Thanks. -- Ben Jackson AD7GD <ben@ben.com> http://www.ben.com/
Ben Jackson wrote:
> On 2006-07-07, Jerry Avins <jya@ieee.org> wrote: >> Jerry Avins wrote: >>> Ben Jackson wrote: >>>> How critical would it be for the S&H clock to exactly match the >>>> ADC clock? >>> It would need to be phase locked within a narrow range of phases. >> That works only if you can adjust the sample rate. A simpler method uses >> a front end that beats the lower edge of the band to DC. > > Aren't those two answers contradictory?
They may be. It was late when I wrote that. Maybe is was one of those moments of clarity that go *poof!* in the light of day.
> My original thought was that > if the original signal was undersampled and then run through a DAC, then > *that* signal would have the desired alias at baseband. So you cut > out the middle man and replace the ADC+DAC with just the S&H from the > front end of the ADC. The normal DAC output filter action is performed > by the soundcard's input anti-aliasing filter.
The theory doesn't matter, because it won't work in practice. Two easily overlooked requisites for undersampling are the acquisition jitter and frequency response. Both need to be as good as a full-rate ADC's. The S&H takes care of the frequency response, but not jitter. To use a just-good-enough sound card practically, you need to beat your signal to baseband and account for images.
> More generally, as you pointed out, this is just producing one of the > mixing products n*F +/- m*Fs, and if I choose Fs = F then even though > the sample rates don't match, the signal has still been moved down to > the soundcard's input frequency. Why does synchronization with the > soundcard's sample rate matter depending on the beat frequency?
My reasoning was, that if the S&H's sample window drifts with respect to the DAC's, there's no way to assure that the DAC always samples a settled signal. If the S&H's clock jitters as much as we know the DAC's will, the scheme falls apart. So you drive the S&H with a stable signal, and derive the DAC clock from that. Is the light worth the candle? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
On 2006-07-07, Jerry Avins <jya@ieee.org> wrote:
> My reasoning was, that if the S&H's sample window drifts with respect to > the DAC's, there's no way to assure that the DAC always samples a > settled signal.
But the ADC (I think you mean) on the soundcard is behind the card's anti-aliasing filter. In effect it can't "see" those high frequency transitions at all. If there were no filter in the system, I'd agree with what you're saying. -- Ben Jackson AD7GD <ben@ben.com> http://www.ben.com/
Jerry Avins wrote:
> Ben Jackson wrote: >> Let's say I have a signal of <= 20kHz but not at baseband. I want to >> use my soundcard as an ADC to undersample the signal, but I don't want >> to modify the card to remove the anti-aliasing filter. > > In theory, yes. Chopping the signal that way would effectively > heterodyne it to baseband. > >> Could I just >> chop the signal with an analog sample & hold (with an input bandwidth >> suitable for the maximum input frequency) at the soundcard's sample >> rate? How critical would it be for the S&H clock to exactly match the >> ADC clock? > > It would need to be phase locked within a narrow range of phases.
You may use the line out of the same soundcard to get a synchronuous clock. However, this clock will have only half of the frequency you need. But when use put the inverse signal to the left and right channel it should be possible to extract a clock when either of the channels changes to logical high. However, depending on the real frequency of your input signal you should be very careful with jitter. And do not expect too much from the aliasing filters of your soundcard. It may not filter the high frequency components of your S/H sufficiently. Marcel
On Fri, 07 Jul 2006 14:07:40 -0500, Ben Jackson <ben@ben.com> wrote:

>On 2006-07-07, Jerry Avins <jya@ieee.org> wrote: >> My reasoning was, that if the S&H's sample window drifts with respect to >> the DAC's, there's no way to assure that the DAC always samples a >> settled signal. > >But the ADC (I think you mean) on the soundcard is behind the card's >anti-aliasing filter. In effect it can't "see" those high frequency >transitions at all. If there were no filter in the system, I'd agree >with what you're saying.
Do you mean that the signal is fairly narrow and contained within the passband of the 20kHz anti-alias filter, or do you mean that the signal is less than 20kHz bandwidth and outside of the the filter passband? Eric Jacobsen Minister of Algorithms, Intel Corp. My opinions may not be Intel's opinions. http://www.ericjacobsen.org