An electrically TRUE square wave possible?

Square waves are, like squares or any other geometric primitive, theoretical mathematical constructs.

A 1kHz square wave has an infinite bandwidth if it has an instantaneous rise time.

Played through an audio system, a 1kHz square waves highest bandwidth component will be a 20kHz sinewave. and produce a rise time of 17.5ns. Which wouldn't be of much use to anyone and would sound hideous.... or dubstep.

The requirements around that rise time being in the order of 1-2ns on even slow digital hardware is why it's mostly given up on by the time you get into high speed serial stuff.

At those speeds things like parasitic inductance and capacitance cause all manor of issues. I recently scoped a basic 115200 baud serial link. The square wave signal was fine at about 0-3.3V. However zooming in on the scope the bottom rise was curved by capacitance and the top left corners had inductance/capacitor tank inductance around 1Mhz ringing and again 1Mhz ringing on the bottom round out, which brought the total peak to peak voltage of 14V. From -5 to +9V.

So I encourage you that square waves are not your friend. They take a huge amount of current to get them rising, and ring like a bell at the top and bottom if you don't take exactly the correct meaures. Any attempt to filter it will round the corners of the square wave.

I'm just of my sick bed, but if I get round to it I'll post some scope shots of what square waves really are.
 
Interesting question.

What physical music instrument produces the fastest rise time and what would that time be?
That might be a drum head and limited by how fast the stick tip is moving, but most of the sound doesn't even come from the tiny impact area of highest velocity and the relative amplitude of that is probably quite low from reasonable mic positions.
 
Last edited:
A 1kHz square wave has an infinite bandwidth if it has an instantaneous rise time.
Played through an audio system, a 1kHz square waves highest bandwidth component will be a 20kHz sinewave. and produce a rise time of 17.5ns. Which wouldn't be of much use to anyone and would sound hideous.... or dubs

I think you mean mS, and wait till you see what an audio band square wave looks like after going through a crossover near the cutoff frequency. It might make you want to give up on the whole thing.
 
Square waves are, like squares or any other geometric primitive, theoretical mathematical constructs.

A 1kHz square wave has an infinite bandwidth if it has an instantaneous rise time.

Played through an audio system, a 1kHz square waves highest bandwidth component will be a 20kHz sinewave. and produce a rise time of 17.5ns. Which wouldn't be of much use to anyone and would sound hideous.... or dubstep.

The requirements around that rise time being in the order of 1-2ns on even slow digital hardware is why it's mostly given up on by the time you get into high speed serial stuff.

At those speeds things like parasitic inductance and capacitance cause all manor of issues. I recently scoped a basic 115200 baud serial link. The square wave signal was fine at about 0-3.3V. However zooming in on the scope the bottom rise was curved by capacitance and the top left corners had inductance/capacitor tank inductance around 1Mhz ringing and again 1Mhz ringing on the bottom round out, which brought the total peak to peak voltage of 14V. From -5 to +9V.

So I encourage you that square waves are not your friend. They take a huge amount of current to get them rising, and ring like a bell at the top and bottom if you don't take exactly the correct meaures. Any attempt to filter it will round the corners of the square wave.

I'm just of my sick bed, but if I get round to it I'll post some scope shots of what square waves really are.
Yes, but your numbers are way off. There are no even harmonics in a square wave so the highest harmonic of a 1KHz square wave in the audio band is 19KHz. The rise time is approximately the sum of harmonics 1/4 wave of all the odd harmonics up to 19KHz times 1/n, which will be about twice the quarter wave of 19KHz, ie 1/19k/2 ~= 26uS, about 1500 times your 17.5nS. The fastest slew required for full power of any waveform limited to 20KHz is 2πF* Vp = 0.126 * Vp V/uS where Vp is the clipping voltage. A quarter wave of 20KHz is 12.5uS. A 20KHz square wave is irrelevant since ALL the harmonics are beyond the audio band.
 
Last edited:
  • Like
Reactions: Tony Salsich
The friend said that the 'digital signal', where his understanding was that the digital signal was that of a square wave, was 'perfect' and meaning in its 'squareness and exactly SHARP corners'. The signal was never, ever 'in-between' and only always exactly electrically representing a '0' or a '1'.
That friend of yours got stuck to an ideal world in his mind. In the physical world all signals are analog in nature. Humans did get smart enough and have come up with "digital" ways of doing things by using signals that are analog in nature, but that does not make those signals "digital".
 
That friend of yours got stuck to an ideal world in his mind. In the physical world all signals are analog in nature. Humans did get smart enough and have come up with "digital" ways of doing things by using signals that are analog in nature, but that does not make those signals "digital".
If you apply that logic then there would be no need to create an entire "branch" of electronics. Digital electronics. Compared with analogue electronics are very, very different and the two do not get along or transition without careful considerations.

The digital space might be considered virtual, but it's really just interruption of the physical layer to gain a actually world of 1s and 0s.

However ... so many people forget that most logic circuits are tri-state (or more). You can have high, low and "no idea". You can have source, drain or "don't care"/"Undefined".

The point at which our modern world meets the physical is often referred to as the "phy" layer. You send the phy layer 1s and 0s as fast as it can support. Square waves with infinite bandwidth. The PHY layer does it best to give you what you want, but will have limitations based on the analogue components abilities and signal integrity et.al. The "media layer", the other name is almost always the limiting factor in digital communications. Even to the point of calculating speed of light in copper, air and glass.

It should not be forgotten that once in the digital space information can be duplicated perfectly an infinite number of times and theoretically for an infinite amount of time. There are theoretical limits on how fast you can process information that far exceed all the limitations of analogue by orders of magnitude and our current technology. It scales far, far better.
 
The idea of binary digital signals is very superficial, a bit like Santa Claus, without regard to how things work in the real world. Before I retired, I solved several hardware issues that involved transmission line echoes and signal bounce. Note that "tri-state" outputs are associated with shared bus structures that are driven by multiple sources, such as an array of memory chips. But tri-state transitions are relatively slow so modern computers have largely eliminated them in favor of serial busses like PCIe, USB and SATA. These standards are called "point-to-point" because they have only two ends to the "bus", and the signal is a (~8b/10b) chirp of LVDS (low voltages differential signal) serial bits. Such signals are bipolar and potentially AC coupled. Digital TV and cell phones use very complicated mathematical functions like sine(x)/x to deal with InterSymbol interference and multipath distortion. Note that these digital signals use "symbols" that represent a set of bits, not single bits, and a symbol is when the RF carrier wave is modulated to a certain amplitude and phase. And data is always sent with redundancy bits so that errors can be detected and possibly corrected. Modern data communications use a lot of frequency domain theory, similar to Fourier analysis.
https://en.wikipedia.org/wiki/8VSB
https://en.wikipedia.org/wiki/Orthogonal_frequency-division_multiple_access
https://en.wikipedia.org/wiki/PCI_Express
 
  • Like
Reactions: Bruce Gillingham
I was going to mention the "perfect square waves" as seen in so many eye diagrams, but I see people have already posted several such images.

If we on Earth were generating such perfect square waves, the UFO aliens would have contacted us or done SOMETHING to stop it, as the harmonics would go through the hundreds of gigahertz, the light band, ultraviolet, x-rays and gamma rays that they likely use to communicate, thus interfering with them ordering their cosmic pizzas.
Tell your friend to get this book (never mind the wavy signals on the cover) "High Speed Digital Design: A Handbook of Black Magic." There's nothing 'spiritual' about it, though sometimes high-tech stuff can seem mysterious. It's a very sophisticated treatment of how digital signals come out of one digital chip, travel along a PC board trace, and are detected by another digital chip. A big part of the treatment is how high of a frequency can be transmitted, involving something called a resistor-capacitor (often abbreviated r-c or r/c) time constant (yes, you read that right). It's amazing!
https://www.amazon.com/High-Speed-Digital-Design-Handbook/dp/0133957241

The gigabit ethernet chip story reminds me of reading something similar done with disk drives to make for more dense data storage. The bits are written so close together that they can't be read back on the read head as individual distinct bits, but rather the read-head signal has a different waveshape (!) depending on which combination of bits were written. I first read about this in the 1990s and it blew my mind. I though "so that's how they make disk drives that can store several gigabytes!" There were and are a lot of different tricks and techniques like this used, of course. The wonder is that disk drive density has only increased by three orders of magnitude since then.
https://en.wikipedia.org/wiki/Partial-response_maximum-likelihood
 
The bits are written so close together that they can't be read back on the read head as individual distinct bits, but rather the read-head signal has a different waveshape (!) depending on which combination of bits were written.

You should see how they use fibre optics these days. A single fibre about twice the width of a human hair doesn't just take one light signal, but potentially hundreds simultaneously. They can send multiple signals per "beam" by overlaying FM and AM, but also send multiple beams by sending them at specific angles which gaurantee an exit at the same angle, regardless of how many twists and turns the fibre takes. The sensors on the ends are able to not only split out individual beams based on their refraction angles, but then demodulate all the different frequency modulated signals.

I honestly don't remember the numbers, only that they were huge! But we calculated the theoretical bandwidth of a single multimode fibre, if all existing technology could be applied maximally. It was way, way into the petabit/s or higher. Then it was noted that even cheap fibre for running around buildings comes with multi-cores and new telecom lines have hundreds.

I don't think the world has really explored the full potential there yet, however I do believe the older trans-oceanic cables have been repurposed at far higher rates than they were original built for.

Then we have TOSLink. Hmmm. A LED and a LDR.
 
I can not believe that I saw this thread, before I logged in this morning.
I may not even ever read through all 73 posts.

But I could easily spend a day or two as an instructor talking about several of these subjects.
So many things are very misunderstood about both analog and digital signals.

How about your 'digital' wireless smart phone for example.
Digital:
Lots of digital, lots of compute power, OK.
Analog:
How about the microphone, A/D convertor. Is that it?
No, there are D/A convertors to send analog signals to the I and Q channels of the modulator, There is an oscillator at IF for the modulator, and then there is another oscillator and mixer to up convert the IQ modulated signal to the channel frequency, and RF power amplification to the analog antenna.
Oh, did I forget to talk about all the analog items of the receive functions from antenna to speaker?
And . . . the new smart phones probably do not do it this way anymore; may have changed all or most of this.

Square Waves:
Real world rise and fall times; Gaussian response or not; phase of each odd harmonic; amplitude of each odd harmonic; and all those even harmonics if there is any uneven on and off times; etc.
A 51%/49% on/off square wave has all those even harmonics; in addition to all the odd harmonics you already know about.
Hmm, a digital signal that is on 1 and off 2 clock times (1,0,0) has the odd harmonics, but has all those even harmonics, for example.

And how does the receiver of a digital stream make decisions about what is a 1 and what is a 0, what is two 1s, what is two 0s; not to mention twelve 1s and 4 0s, etc.?

Just the tip of the iceberg.
 
Capacitance, Inductance, Resistance.

Everything's got them in abundance esp. once you get into the Mhz and Ghz.

Changes everything.

In short. Capacitance will control the current to maintain a voltage, while inductance will control the voltage in an attempt to maintain the current. The former has inrush/outrush considerations and the later has over and under voltage spikes to consider. Sometimes WAY outside your 5VDC system voltage into the 10s of Volts of resonance.

Tonight I seen an I2S signal on the scope from a 3.3V component that had a peek to peek voltage of 6V. The corners of the square wave have resonance caused by the inductance and capacitance of the breadboard. The 6V peek to peek is not an illusion or an artefact either.

Looking at a 24.576Mhz clock on a 200Mhz scope still shows a sine-ish wave because .... capacitance. Square edges "ring" with inductance and capacitance. It's a fact of life. Clock receivers know thing. Xtals have load capacitors for that reason. Touching an open ground circuit stabilises it / destabilises it... all the sme thing.

From the perspective of audio none of these things are a big concern. Really. When you start dealing with serial data channels at 1Ghz and higher your 48-368kHz seems "simple". Audio is "easy" in modern electronics, human ears are far more limited than what can be reproduced for our consumption.
 
Last edited:
Here's a good article the Original Poster might want to show the friend:
https://sound-au.com/articles/analogue-vs-digital.htm

Why is it the most annoying articles on these things come from Audio websites.

Well it's because the rest of the digital electronics community moved on 40 years ago and now look upon audiophiles as the mad uncle in the basement playing around with 1970s opamps believing they (alone) sound different.

It's went said mad old uncle comes up into the house and proclaims that he can hear clock jitter on his 24.576Mhz clock and rant about how clock congruency is paramount... while you and your friends are writing the audio engine for a game which doesn't have an audio clock in sight in the code, just arrays of ints.

"Yes uncle. Here's an RS voucher, go any buy yourself a £50 xtal, and a cable warmer"