[net.analog] Oversampling in CD players

ark@alice.UucP (Andrew Koenig) (04/27/86)

Oversampling refers to a process wherein each 16-bit sample is
converted to 2**k (16-k)-bit samples.  In players made by
Philips or using their chip set, k=2.  The idea is this:
each 16-bit sample has the two low-order bits stripped off
and saved, giving a 14-bit sample.  Each 14-bit sample is
followed by three additional samples, all of whose bits are 0.
These samples, along with the discarded bits, are fed into a
DIGITAL filter.  That is: the filter works by manipulating the
bits, not the analog signal.  The output of the filter goes
into a 14-bit D-A converter, then into an analog filter.

The advantage lf all this is that the analog filter does not
need to have the sharp cutoff associated with systems that
do not oversample.  It is thus much easier to build.  Also,
it is possible to make digital filters that exhibit better
phase response than practical analog filters.

That's the theory, anyway.  I should mention, for completeness,
that a bunch of us have compared CD players with and without
oversampling, using carefully level-matched, double-blind
listening tests, and none of us could reliably hear the
difference.

csdf%mit-vax@mit-vax.UUCP (04/28/86)

In article <241@ur-tut.UUCP> jgro@ur-tut.UUCP (Jeremy Grodberg) writes:
>   Everyone talks about the wonders of oversampling in their CD players, but
>I have yet to hear as coherent explanation of what oversampling actually is.

In order to sample audio data, one bandlimits it to 20KHz (you can't
hear above that) and samples it at 40KHz or more. 40KHz is the "Nyquist"
sampling rate and is the (mathmatically) theoretical sampling rate to
insure that all of the information in the signal is preserved. If you
OVERSAMPLE you get more information than you need.

>I have heard that it is a method of error correction, a method of insuring
>that the buffer to the A/D doesn't run dry during misreads, and a number of
>other seemingly absurd ideas.

These ideas are not absurd. Say you sample at 80KHz. That means that if
you have to, you can "zero out" every other sample and still have a
clean signal (if the output is properly filtered to 20KHz).

>My best guess is that it refers to the
>process of interpolating data points between the recorded data, providing
>a higher effective pseudo-sampling rate, thus allowing for reconstruction
>filter with much higher cut-offs, smoother roll-offs, and therfore greatly
>reduced phase shifts at audio frequencies.

Every now and then, sombody comes up with some sort of interpolation
scheme. These invariably warp the spectrum and therefore don't work. The
point of oversampling is that you have "data to burn" so you can afford
to miss a few samples here and there.

-- 
From the land of Chaldea.
-Charles

ron%brl-sem@brl-sem.UUCP (04/30/86)

> Every now and then, sombody comes up with some sort of interpolation
> scheme. These invariably warp the spectrum and therefore don't work. The
> point of oversampling is that you have "data to burn" so you can afford
> to miss a few samples here and there.
> 
This is wrong.  The only reason for oversampling (which is really not
really sampling many times but running the output D-to-A's at a higher
rate than the original sampled material) is because good digital filtering
is easier (read CHEAPER) than good analog filtering.

-Ron

todd@nbisos.UUCP (Todd Wilson) (04/30/86)

[My appologies if this article has already been posted to the net.  Upon
posting, got 'file system full', and this article was not added to 
net.analog here.]

>   Everyone talks about the wonders of oversampling in their CD players, but
> I have yet to hear as coherent explanation of what oversampling actually is.

Not implying that this is a "coherent explanation", but following is
my understanding of oversampling:

   In a CD player utilizing digital filtering, the digital filter can be
considered the oversampling device (oversampler).  The stream of 16 bit
words that have been constructed from the data read off of the disc,
before and after having been subjected to error correction and error con-
cealment, is flowing at a rate of 44,100 words per second (44.1 K) for
a given channel.  This 44.1 K stream of data
is presented to the digital filter's input.  The digital filter is sampl-
ing it's input at a rate four times greater than this (with 4 X Oversam-
ling) for a 176.4 K rate.  Each word of the 44.1 K stream is sampled four
times by the digital filter such that the input stream of the digital
filter is formatted as follows (read right to left):

	W4  W4  W4  W4  W3  W3  W3  W3  W2  W2  W2  W2  W1  W1  W1  W1

                                  **OR**

Each word of the 44.1K stream is sampled one time and zeros are entered
as the remaining three samples for that given period.  The digital filt-
er input stream would appear as follows:

	0   0   0   W4  0   0   0   W3  0   0   0   W2  0   0   0   W1

I won't discuss much of the differences in results when using each of
these methouds.  I don't know which of these is commonly used by manufac-
turers of CD players. I do prefer the first approach because it does give
some interpolation between inputted samples (in addition to the filtering
function) due to the implementation of the digital filtering. The digital
filter's output stream is at a 176.4 K rate.

> I have heard that it is a method of error correction,

   This process does not correct errors, but will help some in filtering
high frequency components of 'ticks' resulting from poor error conceal-
ment.  Unrecoverable errors (mis-read words off of disc that cannot be 
corrected) must undergo error concealment attempting to substitute accep-
table values for missing words.  Some methouds used in error concealment
are 1) muting (convert missing value to 0), 2) repeating [?] (convert
missing value to most recent correct value), 3) interpolation (substitute
missing value with the average of the previous and following values), 
and 4) use of polynomial algorithm.  The methouds of concealment are 
listed in order from most to least likely in causing audible 'ticks'.
Error concealment is performed while the data stream is still at the 
44.1 K rate and before oversampling.

> that the buffer to the A/D doesn't run dry during misreads, and a number of
> other seemingly absurd ideas. 

(I think you mean D/A converter.)

   Certainly is an absurd idea.  The D/A converter will ordinarily always 
have an input to convert to an analog voltage level, even if the input is
considered erroneous.  The digital filter discussed above, will demand
the D/A to make 176.4 K converts/sec corresponding to the output data 
stream rate of the filter.

> My best guess is that it refers to the
> process of interpolating data points between the recorded data, providing
> a higher effective pseudo-sampling rate,

   Although I do not know of application of this is any product, a data
interpolator could be considered an effective oversampling device.
Consider a case in which the interpolator takes four samples of each
word in the 44.1 K stream.  The interpolator could take the mean 
average of each group of four inputs from the effective inputted 
176.4 K rate.  Note the following diagram illustrating this:

	W4  W4  W4  W4  W3  W3  W3  W3  W2  W2  W2  W2  W1  W1  W1  W1
	 {M--------M}{J--------J}{G--------G}{D--------D}{A--------A}
	 ------N}{K--------K}{H--------H}{E--------E}{B--------B}
	 --O}{L--------L}{I--------I}{F--------F}{C--------C}

	A=(W1+W1+W1+W1)/4
	B=(W1+W1+W1+W2)/4
	C=(W1+W1+W2+W2)/4
	D=(W1+W2+W2+W2)/4
	E=(W2+W2+W2+W2)/4
	F=(W2+W2+W2+W3)/4
	G=(W2+W2+W3+W3)/4
	H=(W2+W3+W3+W3)/4
	I=(W3+W3+W3+W3)/4
	J=(W3+W3+W3+W4)/4
	K=(W3+W3+W4+W4)/4
	L=(W3+W4+W4+W4)/4
	M=(W4+W4+W4+W4)/4
	        :
	        :

The algebraic expressions above represent the values of each word 
outputted from the interpolator.  Notice that there will be four
outputted values for each of the words in the 44.1 K stream, giving
an output rate of 176.4 K.  Also, notice that the output at A, E,
I, and M are equal to the words in the original 44.1 K stream, and
that the three values between are linearily interpolated points
between each original word value.  (This interpolator can also be 
considered as a four tap, FIR digital filter characterized by a
wide, square impulse response. ___+---+___  As it's impulse response
is symetrical, no phase distortion will be introduced.)

> Is anyone SURE of what 
> over-sampling is, what it REALLY does for you, and how this extra data (if
> any) is generated without causing further distortion?  I would love to know.

   Oversampling in itself, does nothing for us.  The oversampling
device is what gives us advantages.  Oversampling digital filters as
well as interpolators can be considered to minimize quantitization
distortion (giving smoother transistions between any two originally
sampled values).  Digital filters have the advantages of filtering
in the digital domain without stability problems and added noise
distortion typical of analog filters.  Also, if the digital filter's
impulse response is symetrical, it will introduce no phase distortion
throughout the entire intended audio range.

   It is possible to have an oversampling system that is of no prac-
tical value.  This would be a system that simply took four redundant
samples of each original sample from the 44.1 K stream.  This would 
give a data stream at a 176.4 K rate, but every four words in a row
would be identical.  This would require a faster D/A and sample-hold
with little appearant benefeit.


Bye Now

***** I would have prefered having this discussion on net.dsp. *****
-- 
...{allegra|hao|ucbvax}nbires!nbisos!todd(USENET)Welcoming your flames :-)ingly!

csdf@mit-vax.UUCP (Charles Forsythe) (05/02/86)

In article <175@brl-sem.ARPA> ron@brl-sem.ARPA (Ron Natalie <ron>) writes:
>> Every now and then, sombody comes up with some sort of interpolation
>> scheme. These invariably warp the spectrum and therefore don't work. The
>> point of oversampling is that you have "data to burn" so you can afford
>> to miss a few samples here and there.
>> 
>This is wrong.  The only reason for oversampling (which is really not
>really sampling many times but running the output D-to-A's at a higher
>rate than the original sampled material) is because good digital filtering
>is easier (read CHEAPER) than good analog filtering.

Ron is right, I was in error. I was told later about how oversampling
really works. The CD data is only sampled at ~40KHz.

The important point is that oversampling is not some sort of linear
interpolation but rather "upsampling". In upsampling, you insert 0's
between samples and you get the same information with a higher
bandwidth. This can then be filtered more easily ect.

-- 
From the land of Chaldea.
-Charles

todd@nbisos.UUCP (Todd Wilson) (05/03/86)

[My appologies if this article has already been posted to the net.  Upon
posting, got 'file system full', and this article was not added to 
net.analog here.  If you find three copies of this, it's because I'm not
sure if my second posting had been relayed off our system before all news
files were wiped off.]

>   Everyone talks about the wonders of oversampling in their CD players, but
> I have yet to hear as coherent explanation of what oversampling actually is.

Not implying that this is a "coherent explanation", but following is
my understanding of oversampling:

   In a CD player utilizing digital filtering, the digital filter can be
considered the oversampling device (oversampler).  The stream of 16 bit
words that have been constructed from the data read off of the disc,
before and after having been subjected to error correction and error con-
cealment, is flowing at a rate of 44,100 words per second (44.1 K) for
a given channel.  This 44.1 K stream of data
is presented to the digital filter's input.  The digital filter is sampl-
ing it's input at a rate four times greater than this (with 4 X Oversam-
ling) for a 176.4 K rate.  Each word of the 44.1 K stream is sampled four
times by the digital filter such that the input stream of the digital
filter is formatted as follows (read right to left):

	W4  W4  W4  W4  W3  W3  W3  W3  W2  W2  W2  W2  W1  W1  W1  W1

                                  **OR**

Each word of the 44.1K stream is sampled one time and zeros are entered
as the remaining three samples for that given period.  The digital filt-
er input stream would appear as follows:

	0   0   0   W4  0   0   0   W3  0   0   0   W2  0   0   0   W1

I won't discuss much of the differences in results when using each of
these methouds.  I don't know which of these is commonly used by manufac-
turers of CD players. I do prefer the first approach because it does give
some interpolation between inputted samples (in addition to the filtering
function) due to the implementation of the digital filtering. The digital
filter's output stream is at a 176.4 K rate.

> I have heard that it is a method of error correction,

   This process does not correct errors, but will help some in filtering
high frequency components of 'ticks' resulting from poor error conceal-
ment.  Unrecoverable errors (mis-read words off of disc that cannot be 
corrected) must undergo error concealment attempting to substitute accep-
table values for missing words.  Some methouds used in error concealment
are 1) muting (convert missing value to 0), 2) repeating [?] (convert
missing value to most recent correct value), 3) interpolation (substitute
missing value with the average of the previous and following values), 
and 4) use of polynomial algorithm.  The methouds of concealment are 
listed in order from most to least likely in causing audible 'ticks'.
Error concealment is performed while the data stream is still at the 
44.1 K rate and before oversampling.

> that the buffer to the A/D doesn't run dry during misreads, and a number of
> other seemingly absurd ideas. 

(I think you mean D/A converter.)

   Certainly is an absurd idea.  The D/A converter will ordinarily always 
have an input to convert to an analog voltage level, even if the input is
considered erroneous.  The digital filter discussed above, will demand
the D/A to make 176.4 K converts/sec corresponding to the output data 
stream rate of the filter.

> My best guess is that it refers to the
> process of interpolating data points between the recorded data, providing
> a higher effective pseudo-sampling rate,

   Although I do not know of application of this is any product, a data
interpolator could be considered an effective oversampling device.
Consider a case in which the interpolator takes four samples of each
word in the 44.1 K stream.  The interpolator could take the mean 
average of each group of four inputs from the effective inputted 
176.4 K rate.  Note the following diagram illustrating this:

	W4  W4  W4  W4  W3  W3  W3  W3  W2  W2  W2  W2  W1  W1  W1  W1
	 {M--------M}{J--------J}{G--------G}{D--------D}{A--------A}
	 ------N}{K--------K}{H--------H}{E--------E}{B--------B}
	 --O}{L--------L}{I--------I}{F--------F}{C--------C}

	A=(W1+W1+W1+W1)/4
	B=(W1+W1+W1+W2)/4
	C=(W1+W1+W2+W2)/4
	D=(W1+W2+W2+W2)/4
	E=(W2+W2+W2+W2)/4
	F=(W2+W2+W2+W3)/4
	G=(W2+W2+W3+W3)/4
	H=(W2+W3+W3+W3)/4
	I=(W3+W3+W3+W3)/4
	J=(W3+W3+W3+W4)/4
	K=(W3+W3+W4+W4)/4
	L=(W3+W4+W4+W4)/4
	M=(W4+W4+W4+W4)/4
	        :
	        :

The algebraic expressions above represent the values of each word 
outputted from the interpolator.  Notice that there will be four
outputted values for each of the words in the 44.1 K stream, giving
an output rate of 176.4 K.  Also, notice that the output at A, E,
I, and M are equal to the words in the original 44.1 K stream, and
that the three values between are linearily interpolated points
between each original word value.  (This interpolator can also be 
considered as a four tap, FIR digital filter characterized by a
wide, square impulse response. ___+---+___  As it's impulse response
is symetrical, no phase distortion will be introduced.)

> Is anyone SURE of what 
> over-sampling is, what it REALLY does for you, and how this extra data (if
> any) is generated without causing further distortion?  I would love to know.

   Oversampling in itself, does nothing for us.  The oversampling
device is what gives us advantages.  Oversampling digital filters as
well as interpolators can be considered to minimize quantitization
distortion (giving smoother transistions between any two originally
sampled values).  Digital filters have the advantages of filtering
in the digital domain without stability problems and added noise
distortion typical of analog filters.  Also, if the digital filter's
impulse response is symetrical, it will introduce no phase distortion
throughout the entire intended audio range.

   It is possible to have an oversampling system that is of no prac-
tical value.  This would be a system that simply took four redundant
samples of each original sample from the 44.1 K stream.  This would 
give a data stream at a 176.4 K rate, but every four words in a row
would be identical.  This would require a faster D/A and sample-hold
with little appearant benefeit.

Bye Now

***** I would have prefered having this discussion on net.dsp. *****
-- 
...{allegra|hao|ucbvax}nbires!nbisos!todd(USENET)Welcoming your flames :-)ingly!