CD square wave pre-ringing a filter problem?

Today I made a test cd with among other things, a 1kHz square wave. Looking at on a scope showed the ringing that is often described when a CD player tries to reproduce a square wave. This is often blamed on the sharp rollof (and therefore high Q) of the low pas filter that lets below 20kHz pass, but more or less stops the 44.1 kHz getting through. Of course oversampled dac's have a higher sampling frequency and so need a less sharp filter but that's a different story.

Anyway, I got to thinking about all this, and while any ringing after the vertical transition is understandable, what I also saw is some ringing building in amplitude just before the transition as well. Now I generated the square wave using Cool Edit 96 and I suppose it constructs the waveform by adding odd harmonics and this is what you see in the pre-ringing and post-ringing, but to blame any pre-ringing on the sharp cutoff low pass filter after the dac is ridiculous because the filter cannot know that a transition is coming and start to get all wobbly! I have seen again and again people whingeing and whining about rotten square waves coming out of cd players, and as "evidence" they show a pic of one of these pre and post ringing square waves.

Post ringing from crook filters I can believe, but pre-ringing ? No way!

GP.

P.S. This pre-ringing could also be seen right at the dac output too, BEFORE the filter. :confused: Also, here's an ascii output of the Cool edit file. As you can see, there is no pre-ringing in it. :confused: :confused: :confused:

Left and right channels, 1 kHz, -3dB level, 44.1kHz sample rate.
23198 23197
23197 23197
23197 23197
23198 23198
23198 23198
23197 23197
23197 23197
23197 23198
23197 23197
23197 23197
23197 23197
23198 23198
23197 23197
23197 23197
23197 23197
23197 23197
23197 23197
23198 23197
23197 23197
23198 23197
-23198 -23197
-23197 -23198
-23197 -23197
-23197 -23197
-23197 -23197
-23198 -23197
-23198 -23197
-23198 -23197
-23198 -23198
-23198 -23197
-23197 -23198
-23197 -23197
-23197 -23197
-23197 -23197
-23198 -23197
-23197 -23197
-23197 -23197
-23197 -23197
-23197 -23198
-23197 -23197
-23198 -23198
-23198 -23196
23197 23198
23198 23197
23197 23197
23197 23197
23198 23197
23197 23198
23197 23197
23197 23197
23198 23197
23198 23197
23198 23197
23197 23197
23197 23197
23197 23197
23198 23198
23197 23197
23197 23198
23197 23197
23198 23198
23196 23196
23198 23197
23197 23197
-23197 -23197
-23197 -23198
-23198 -23196
-23197 -23196
-23197 -23198
-23197 -23197
-23197 -23197
-23197 -23197
-23197 -23198
-23198 -23198
-23198 -23197
-23197 -23197
-23198 -23197
-23197 -23197
-23197 -23197
-23197 -23197
-23197 -23198
-23198 -23197
-23197 -23198
-23197 -23197
-23198 -23197
-23197 -23197
23198 23197
23197 23197
23197 23197
23197 23197
23198 23197
23198 23197
23198 23198
23197 23198
23197 23197
23197 23198
23198 23197
23197 23197
23197 23197
23198 23197
23198 23197
23197 23197
23197 23198
23197 23198
23198 23197
23197 23197
23197 23197
23197 23197
-23197 -23197


:confused:
 
Ringing on Squarewave

Hi circlotron,
The (pre)ringing is due to the digital filter. See f.a.
http://www.sakurasystems.com/articles/Kusunoki.html
If you have a NON-OS DAC you get a perfect square wave without any ringing. If you have a analog low pass filter with sharp rolloff you get ringing too but no preringing. See the Filter-Pro program on www.ti.com for illustrations of ringing squarewaves with various lowpass filter topologies.;)
What is the meaning of that large row of numbers?:confused:
 
I think that we need to give Dave's comment more thought, because it is absolutely right, whether you are in the digital domain or analog domain. The issue is more "pronounced" in the digital domain, because you can build close to a perfect filter.

A square wave, in the frequency domain, is a bunch of sine waves, of amplitude sin(x)/x added together. When you add all these sine waves together, you get a square wave. If you take away the higher frequency sine waves completely, you end up with something that looks like a square wave with ringing. What looks like pre-ringing is simply the inability to have flat tops and bottoms because the high frequency sine waves are not there.

The same issue also occurs in the analog domain. The initial brickwall filters in the early days of CD players generated some nasty looking square waves as well. Not only taking away the high frequency sine waves causes post and pre-ringing, but screwing up the phase alignment of those sine waves does as well. Non-linear phase analog filters create nasty square waves. One of the great advantages of massive oversampling is the ability to use first order filters linear in phase. However, you can use higher order analog linear phase filters (bessel) and still get nice square waves. These were not used for the brick wall filters as the slope was too shallow.

There is no reason the digital filter has to exhibit pre/post ringing and there is no reason the combination of the digital and analog filter has to create pre and post ringing. Bad implementation will though.

Alvaius
 
Here's where it starts to get interesting! This pic is of the
output of a very ordinary 11 year old Teac CD player when
playing my test CD I made, this track is of a 1kHz square wave
at -3dB. The ringing and overshoot is as expected.
 

Attachments

  • square wave overshoot.jpg
    square wave overshoot.jpg
    35.8 KB · Views: 1,190
Now this pic is the speaker output of my pc sound card, a
Creative CT3600 SB32. To make super sure, I ripped the track
of the test CD and saved it as 44.1 kHz wave file. Then I
played it using Winamp http://www.winamp.com/ and the output
is like you see. Notice the very great reduction in ringing!
The sloping top and bottom of the waveform is because the bass
response is not flat because it is only adjustable in coarse
notches. What do we do now? Rip all our CD's to wav's and play
them with Winamp?

GP.
 

Attachments

  • square wave no overshoot.jpg
    square wave no overshoot.jpg
    36.7 KB · Views: 1,101
Of course, we are missing one important thing here. Is the fact that there is ringing on the square wave bad? I am not saying it is or is not, just making the statement.

A lot of people seem to be going for this ideal of being able to recreate a square wave. However, square waves do not exist in the real world of audio. It is easy to create mathematically and play on your sound card, but you will never record one from real music.

Just a thought.

Alvaius
 
Elso, if we use a Bessel filter and no oversampling for good looking square-waves, this filter will not have rolled off very far by the time you reach the 44k1 of the non-oversampled sampling rate. The remnant of the sampling bumps may be audible somehow by intreracting with something else. So what do we do now? How does my soundcard produce such relatively good waveshape while there are no sampling artifacts?

GP.
 
Some thoughts on the square waves you played. Your TEAC CD player I would expect oversamples, but maybe not very much. It is quite possible that the oversampling is done with a non-linear phase digital filter, butterworth, chebychev, etc. as opposed to a linear phase digital filter. The non-linear phase filters take less computing power and hence lower cost so they were used in early oversampling filters. It could also not be oversampling and have a brick wall analog filter that is almost definately not-linear phase.

Your Sound-Blaster has a more advanced digital-analog filter section. You would find similar results in modern CD players, even cheap ones.

Alvaius
 
Please let's not forget that a digitally-synthesised square wave is an illegal signal in a system that relies on proper anti-alias filtering at its input (i.e. during recording). In other words: there is no way that by means of recording an analogue real world signal with an ADC, you can end up with that particular test signal on the CD.

As such looking at square wave reproduction of CD is a bit pointless. All it does is reveal to you the nature of the digital filter, which when it is an approximation of the ideal Sinc filter, is supposed to have pre and post ringing. Sinc itself, the perfect reconstructor, rings ad infinitum.
 
Circlotron,
Original intention of this article is a bit differnet, but it also answers some questions about the digital filters (their time domain behaviour is included).


Dave said:
Through Fourier analysis you'll find that this is perfectly normal for a system that is band limited to 20K. To get perfectly flat tops and you need infinite bandwidth.
If frequency response doesn’t start at DC, horizontal line (of the squarewave) can not be absolutely horizontal. If freq response is not unlimited at upper end, vertical line can not be absolutely vertical. This is all how squarewave is unconditionally related to amplitude response. It is not a problem to have a limited bandwidth and no ringing. Ringing is indroduced by the steep filters, not by default with the limited bandwidth. :eek:


alvaius said:
If you take away the higher frequency sine waves completely, you end up with something that looks like a square wave with ringing.
No, you'll get the sinewave. :eek:


Werner said:
As such looking at square wave reproduction of CD is a bit pointless.
If you say it is pointless to investigate the transient behaviour of some device, that could mean:
1. Device has bad transient behavior by default :cd:, or
2. The transient bahaviour is not important at all :att'n: (?)


Pedja
 

halcyon

Member
2002-04-08 12:48 pm
Doesn't NON-OS DAC cause AID ?

I have read Kusunoki's papers and have read also several reviews of non-oversampling AND filterless DACs.

My question is:

If you let aliasing noise and sampling images to occupy the stop band (for CD >22kHz), then won't you get Alias Intermodulation Distortion when you actually play back that signal?

What I'm referring to in specific is the following AES paper by Mr Black:

Anti-alias filters: the invisible distortion mechanism in digital audio
http://www.musaeus.co.uk/aespaper.htm

Or am I confusing things here?

comments welcome.

regards,
Halcyon
 
AID

Hi halcyon,
I have not yet read the AES paper. After I discovered the prescribed silly RCA connectors and chassis parts for the 75 Ohm digital interface cable I am very suspecious of all that reads AES.
Of course you get intermodulation distortion with unfiltered NON-OS DAC especially in the high frequencies.
Now what compromise we are going to chose to get rid of it?
Steep 7 th order Chebyshev filtering at 20kHz?
Less steep say fifth order Butterworth filtering at 17 kHz?
Bessel filter at 10kHz?. It is all up to the DIY how much ringing or phase distortion do you accept? And how much attenaution above 20kHz is really needed? And most important what is the impact on the sound?
In my KWAK-DAC-schematic is <B>not</B> available (sorry for that)- I am using a third order Bessel lowpass filter. -3dB point at 10 kHz.
Haaaah, I see my mailbox overflowing! That must be sounding very dumb and dull!
In fact it does not. Also I wanted a smooth 3150Hz sine wave not those fancy steps caused by the LATCH.
Maybe I will change to a third order Butterworth -3dB point at 15 kHz, if that one will sound better? Who knows?. I will build it and try it.
:confused: [9 asking signs in this post]