[net.audio] 20kHz Square Waves

hal@pur-phy.UUCP (Hal Chambers) (06/26/84)

    All this talk of digital audio being unable to reproduce frequencies
above 22kHz is all very nice but has nothing to do with 20kHz square wave
reproduction.  Similarly arguments about summing sine waves to produce a
square wave and the presence of "Gibb's ears" are also very true and totally
irrelevant.  The digital reproduction process doesn't do a Fourier trans-
formation or Fourier synthesis of the audio signal.  The signal is digitized
(like reading a voltmeter) and that number later converted back to a voltage
by the D/A converter.  Sampling at 44kHz, a 22kHz square wave can be reproduced
exactly (alternate samples are a high voltage then a low voltage).

    This afternoon, I set up the D/A converter on a microcomputer here in
the lab to sample at 40kHz; fed it data of alternating +N and 0; and
observed the output on an oscilloscope.  Result: A 20kHz square wave.
The only limitation being the finite rise time (2 usec.) of the D/A converter.
(Note: at 20kHz the period is 50usec.).

    In commercial players, any ringing on the square wave output is due to
the use of digital filtering; an analog filter with a high frequency
resonance; or something else after the D/A conversion.

Hal Chambers
Physics Dept.
Purdue Univ.
(...pur-ee!pur-phy!hal)

2212zap@mhuxm.UUCP (putnins) (06/26/84)

<The feature of this bug is that is only sometimes occurs>
>    All this talk of digital audio being unable to reproduce frequencies
>above 22kHz is all very nice but has nothing to do with 20kHz square wave
>reproduction.  Similarly arguments about summing sine waves to produce a
>square wave and the presence of "Gibb's ears" are also very true and totally
>irrelevant.  The digital reproduction process doesn't do a Fourier trans-
>formation or Fourier synthesis of the audio signal.  The signal is digitized
>(like reading a voltmeter) and that number later converted back to a voltage
>by the D/A converter.  Sampling at 44kHz, a 22kHz square wave can be reproduced
>exactly (alternate samples are a high voltage then a low voltage).
Point 1: what is digitized is not the signal, but a filtered version
of the signal.  Specifically, low pass filtered at just above the Nyquist
rate.  As soon as you do this, you cut off the higher harmonics and now
you have to start dealing with the Gibbs phenomenon.  The same is when you
convert back to a voltage: you only pass back information up to the
corner frequency of the LPF.  Up to the first harmonic, a 20kHz square wave
is the same as that of a 20kHz sine wave.  With the recording of the signal
onto a disk, your have cut off the higher harmonics, and it is these harmonics
that carry the information that the original signal was a sq wave, not a sine
wave.
Point 2:  digitize a 20kHz square wave at the peaks, and get alternating
hi values and lo values, and you digitize a 20kHz sine wave at the peaks,
and get alternating high and lo values, how do you distinguish the two?
(look at point one for the answer).
>    This afternoon, I set up the D/A converter on a microcomputer here in
>the lab to sample at 40kHz; fed it data of alternating +N and 0; and
>observed the output on an oscilloscope.  Result: A 20kHz square wave.
a
Point 3: if you only sampled at 40kHz, you must have been LPF at 20kHz
(if not, throw out your results).  Since the first harmonic distinguishing
sine/square/triangle waves occurs at 40kHz, which you were not even passing
to your scope, how do you know what your orginal wave form was?
>    In commercial players, any ringing on the square wave output is due to
>the use of digital filtering; an analog filter with a high frequency
>resonance; or something else after the D/A conversion.
Point 4: there is another possibility that I have not seen brought (sp?) up.
That is the time is takes for the filter to settle into its steady state
response.

ron@brl-vgr.ARPA (Ron Natalie <ron>) (06/30/84)

Well sure.  If all you want to do is make square waves a D to A is just fine.
The thing generates unbelievably high frequencies every time it steps from
sample to sample.  The hard part is filtering these out of the signal.  It
is not easy for the CD player to determine the difference between a switch
between two values of a fast waveform and high and low values of a square
wave.

-Ron

charles@sunybcs.UUCP (Charles E. Pearson) (07/02/84)

Since you keep forgetting, I will remind you.
The frequency in question is 1KHz not 20K or 22K.
 
the 20K figure was brought in by somebody who was trying to bias
the discussion/flame cession  in favor of the CD and away from
reality (as well as the attempt at obscuring the question entirely)