Okay, RAP members... You've reached the new home for Jay Rose's “dplay.com” articles and tutorials!

Can you have a squarewave at the upper frequency limit of a system?

Consider a perfect squarewave at 20 kHz. Some people seem to think that a digital system at 44.1 kHz s/r can't accurately reproduce it except at one very lucky phase, but that a 20 - 20 kHz analog system can.

The truth is, neither system can reproduce the squarewave at any phase.

The digital one can store the wave as a square, but it'll round its waveform to a sine when it hits the DAC's output filter.

The analog one -- if its upper frequence limit is truly 20 kHz -- will do exactly the same rounding.


I proposed the following experiment to prove it, in rec.audio.pro:
In article [noLunchMeat-1607991136570001@csq.tiac.net], I wrote:

|:  I am sorry to have to tell you that math doesn't agree. Try an experiment:
|:  take a signal generator at 1 kHz square wave and plug it into a scope. Now
|:  insert a sharp lowpass filter at 1 kHz. What do you see on the scope? Is
|:  it, uh, slightly rounded?
|:  
|:  If you don't have a function generator, scope, and thoretically perfect
|:  filter handy, you can do the same thing in your computer and look at the
|:  waveform... just make allowences for the fact that software-based filters
|:  in music programs are seldom sharper than first order: whatever effect you
|:  see will be a lot greater with a true cutoff.
|:  
|:  After you've done this experiment, please report the results.
I proposed 1 kHz, so the results wouldn't get confused with the individual samples. But what works with a 1k signal and filter will also work with a 20k signal and filter.

In either case, you're simulating a system with an upper frequency limit close to the squarewave frequency.

For those of you who don't want to actually do the experiment, here are screenshots of how it turns out:

squarewave at 1kHz This is the original wave, 1 kHz square.

screenshot of filter settings Here's the filter I used: a cutoff at ~1.5 kHz.

the wave after the filter is applied Here's what that squarewave file looked like, after the filter.

You could do exactly the same experiment with analog generator, filter, and scope and the results would be the same.


Any questions?

The original wave was generated in SoundEdit/16. The screenshots were taken from Bias' Peak 2.01 -- it does a prettier job of displaying waveforms -- and I used Waves' AudioTrack for the filter. I used a somewhat higher filter frequency to allow a margin for filter problems.

You'll notice a steppiness to the rounded wave. Somebody is sure to raise the issue that this quantization error proves that analog is superior, because an analog system could reproduce precisely the instantaneous value of the wave.

The analog system can't. If you postulate a real-world analog system with 96 dB s/n -- equivalent to 16 bit audio -- the ambiguity due to noise will be equivalent to the quant error.

Figure out why this is true for yourself, or attend session S18 at MacWorld NY on 7/21/99 where I'll prove the case with either screenshots or scope photos (I haven't decided which I'll use yet). Copyright 1999 Jay Rose. May not be reproduced without written permission.


To tutorials index

To Digital Playroom main page

Mail to

16Jun99
11