# Digital audio from a sound card

1. Jan 13, 2012

### FrankJ777

I would like to do some audio programming for a school project, but I'm not sure how a computer processes audio and reconstructs it in a sound card. I've had a signal processing course that covered standard DSP topics but I'm not sure when or how they are applied to acquire, store, and reproduce audio through a sound card. In trying to find a functional explanation I usually see it explained as sampling a time domain signal, storing the samples, and then reproducing audio wave in the time domain by using the sample to represent a voltage at discrete time intervals. But use of the FFT is always mentioned, but I'm not sure how it all fits together. So I have two "theories" about how it's accomplished.

a) A audio signal x(t) is sampled, which represents signal voltage levels at discrete time intervals x[n]. The time domain samples are stored in memory. Then the time domain samples are used to output a voltage signal by setting a voltage level to the value of the sample x[n] at time intervals of the sampling period.

b) A audio signal x(t) is sampled as before. The samples x[n] are then passed to an FFT then the frequency domain values X[k] are stored in memory. Reconstruction is accomplished by oscillators in the sound card which each oscillate at a discrete frequency (for time intervals of the sampling period) at the magnitude indicated by the value of the sample X[k].

Or, in other words. When you give data to a sound card to output audio, is your data a time domain representation of the signal where each successive data value represents the magnitude of the wave at a time interval x[n], or does the data you give sound card represent discrete frequency values X[k] at time intervals.

I know this question is verbose, but I think the easiest way for me to gain understanding is to explain what I think is going on as I understand, and let somebody else tell me where I'm looking at this wrong. I hope someone can straighten me out on this.

Thanks.

2. Jan 13, 2012

### olivermsun

The typical setup is a). During the conversion from digital back to analog (D/A), you will also need some sort of filter to smooth out the steps in your output which occur at the sampling/reconstruction frequency.

If lossy audio (or video) compression are performed, an FFT (or a subset, usually) is performed on the sampled stream and then appropriate processing is performed. Decompression requires the inverse FFT and then you do the same D/A conversion as before.

3. Feb 3, 2012

### vk6kro

Or, in other words. When you give data to a sound card to output audio, is your data a time domain representation of the signal where each successive data value represents the magnitude of the wave at a time interval x[n], or does the data you give sound card represent discrete frequency values X[k] at time intervals.

The sound card has a digital to analog converter in it and the outputs are generated at the same rate as they were sampled.
The outputs represent the instantaneous amplitude of the original sound and, after some filtering to get rid of components above human hearing, the result is presented to an audio amplifier.