From: hedley@metro (Mark Hedley)
Subject: Re: oversampling (was Re: using green marker on CDs)
Organization: Sydney University Computing Service, Sydney, NSW, Australia
Date: Thu, 1 Oct 1992 01:44:34 GMT

From article <1992Sep30.182103.20143@engage.pko.dec.com>, by moroney@ramblr.enet.dec.com:
> In article <1992Sep30.115205.15739@infodev.cam.ac.uk>, rf@cl.cam.ac.uk (Robin Fairbairns) writes...
>>In article <1992Sep29.213143.6551@rosevax.rosemount.com>,
>>grante@aquarius.rosemount.com (Grant Edwards) writes:
>>|> I've been asking people about this for some time and have yet to get a
>>|> good description of what oversampling is.
>> 
>>Yeah - let's have someone who _knows_ posting here!
> 
> I haven't said anything since I don't *know* for sure how oversampling works,
> but I *believe* it works as follows:  Instead of feeding the bitstream directly
> to the D/A converter, for N times oversampling N-1 digital 0s are inserted
> between each data value and the clock frequency is multiplied by N.  So for
> 4 times oversampling instead of the stream 123,177,197,144, ... you get
> 123,0,0,0,177,0,0,0,197,0,0,0,144,... which, after filtering produces the same
> analog output but makes the filters easier to design as someone mentioned
> earlier. 
> 
> -Mike

I believe that it is a little more complicated than this, I will try to
show why.

Generating a 4X oversampled signal as you describe is equivalent to sampling
the original signal at 4X the original sampling rate, and setting 3 out of
every 4 samples to zero. Lets see what effect this has on the resulting
spectrum.

A representation of the time domain signal is shown on the left, and of the
frequency domain signal on the right. The magnitude of the frequency response
is only shown for omega (equals 2 PI times sampling period times frequency)
in range 0-PI

Start with a signal sampled at least 4X the Nyquist frequency,

             |     *                |*
           **|   ** *               |**
 *       **  ** *    *              |****
--*-----*----+-*------**--- t       +-----|-----|-----|-----|- omega
   **  *     |          **          0     PI    PI          PI
     **      |                            --    --
             |                             4     2

The spectrum is only non-zero between -PI/4 and PI/4.

Oversampled signal is generated by multiplying time signal by

             |                      |
     *   *   *   *   *              *           *           *
             |                      |
--***-***-***+***-***-***-- t       +***********|***********|- omega
             |                      0     PI    PI          PI
             |                            --    --
             |                             4     2

This periodic pulse train in the frequency domain is a periodic pulse train
with pulses separated my PI/2 radians.

The oversampled signal is now given by multiplication in the time domain, which
is equivalent to convolution in the frequency domain

             |                      |*        ****        **
             |   *                  |**      *******     ***
 *       *   *       *              |****  *********** *****
--***-***-***+***-***-***-- t       +-----|-----|-----|-----|- omega
             |           *          0     PI    PI          PI
     *       |                            --    --
             |                             4     2

So aliasing of the signal from 20-60kHz etc still occurs, and using this signal
straight from the DAC is no improvement from having no oversampling.

What can be done is to use digital filtering to remove the aliasing from
PI/4 to PI, then pass this filtered signal to the DAC, then the analogue
filtering is simplified. Using some interpolation scheme between the
samples is equivalent to digital filtering. The advantage of moving some
of the filtering into the digital domain is that it is easier to do there.

Mark Hedley
hedlye@ee.su.oz.au

Newsgroups: alt.folklore.science