What's up with these messed up square waves?

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I have this soundcard: ASUS Xonar Essence ST/STX soundcards Measurements | Stereophile.com

I was scoping some square waves from it and found some disgusting amounts of distortion. I know square waves are hard on audio equipment but this seems a bit extreme. These waveforms were taken from the left channel of a stereo out with no filters engaged:

3f0e99543356cee4bad6ba9e50c79c89.png

927357425b16fc2c86ff4919def847c7.png


Don't really get why these are getting so messed up with increasing frequency.
 
Last edited:
Okay with the xonar cards make sure you've got the sample rate in the ASUS control window set to the sample rate of interest. Then open windows sounds set up and make sure that the output and input sampling rates match the ASUS control panel. Better yet is to use ASIO because even then software somewhere can bandwidth limit.
 
The "ringing" is an inherent property of a band-limited (sharp low-pass) signal (specifically a square wave). Digital audio uses such a signal before the ADC to prevent aliasing. You can read all about how it works here:
The Scientist and Engineer's Guide to Digital Signal Processing

You can run a square wave through a sharp rolloff low-pass analog filter and it will do the same thing. As a 17kHz square wave's lowest harmonic would be at 51kHz, you would need the filter to have a passband of 51kHz or above, else it will look like the sine wave of your last image.
 
If you can use Excel, here's an experiment for you. Write out the Fourier series for a 2kHz square wave up to some high order term (limited by your patience), then truncate above that term (i.e., perfect brickwall filter, the ideal for preventing aliasing and maintaining flat response over the desired bandwidth). Now enter the equations into Excel, then plot them over a cycle or two.

Don't feel bad. Every few months, someone accidentally discovers the Gibbs phenomenon and posts a question about what they're doing wrong to cause such horrible "distortion."
 
You can run a square wave through a sharp rolloff low-pass analog filter and it will do the same thing. As a 17kHz square wave's lowest harmonic would be at 51kHz, you would need the filter to have a passband of 51kHz or above, else it will look like the sine wave of your last image.

Except that the "ringing" is symetric in the pictures we see in this thread (as much ringing before and after transition from low to high/high to low), due to linear phase.

An analog lowpassfilter will be minimum phase and show no pre-ringing on the rising edge.
Of course it's possible to arrange with a digital lowpass filter as well with minimum phase, which is very common. Some of the Apple devices are some kind of intermediate phase response devices. Showing pre and post ringing in different amounts.
 
Dont worry,
almost every dac showing pretty much the same, that is why they don't give these measurements...
:)
almost every contemporary dac chip have more or less the same like You measured.
But I was really amassed when put trough the square gen to the old 14bit TDA1540
measuring much much better. If I found the pics I will post
cheers
 
I have this soundcard: ASUS Xonar Essence ST/STX soundcards Measurements | Stereophile.com

I was scoping some square waves from it and found some disgusting amounts of distortion. I know square waves are hard on audio equipment but this seems a bit extreme. These waveforms were taken from the left channel of a stereo out with no filters engaged:

3f0e99543356cee4bad6ba9e50c79c89.png

927357425b16fc2c86ff4919def847c7.png


Don't really get why these are getting so messed up with increasing frequency.

I am not familiar with sound card, but it sure look bad. You actually see different duty cycle jitter at 5KHz and higher. This cannot be normal. You mean people cannot tell it sounds bad?
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.