CD square wave pre-ringing a filter problem?

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hello Chad,

I was patient, I did try that function, but something was wrong... see the picture. It seems a lot of thing depends on the amplitudes of the harmonics.

According to my spectrum analyzer (and Blackman window) sin(3x) has amplitude which is equal to 35% amplitude of the fundamental freq, sin(5x) has 21% etc. So, I put amplitudes (only approximately) in that equation and I got sin(x)+sin(3x)/2.8+sin(5x)/4.6+sin(7x)/6.1

If you think now I will agree this should be, no, I will not. Because the harmonics exist till some frequency, and they have their full amplitude, and then all higher freqs harmonics completely disappear, here we have (“ideal”) brickwall filter.

In reality we don’t operate with such filters. Actually, filters attenuate slowly. Changing spectral content and internal amplitude relations between harmonics inside one squarewave, you also change the form you get. Attenuating slowly you’ll get slow transition from squarewave toward sinewave. And you will not get any ringing.

Pedja
 

Attachments

  • square.gif
    square.gif
    5.7 KB · Views: 487
Doh! Silly me. I forgot to include the amplitude factors... duh :headbash:

The equation should be:

y = E(n=0->infinite) [1/(2n+1)]sin[(2n+1)x]

where E is supposed to be the sum symbol...

broken down, it looks like:

y = sin(x) + (1/3)sin(3x) + (1/5)sin(5x) ...

Sorry about the confusion there...
 
If you want to see what happens when you attenuate the harmonics with a more realistic filter slope such as -80dB/dec. (4th order slope), you can simply multiply the amplitude coefficients by the proper attenuation value at each frequency... proceeding until the amplitudes are negligible. To do this, you'll have to pick a -3dB frequency, then do the log calculation to get the amount of attenuation.

Of course, this is assuming a completely linear phase filter, which isn't quite possible in the analogue domain (even Bessel isn't truly linear phase).

I think you'll still find ringing... ;) That is, of course for something like a 1kHz square wave and a 10 or 20kHz -3dB filter cutoff. If you drop your -3dB point down close to or below the fundamental frequency of the square wave, then things change, and yes you can probably get something which has little or no ringing, but that's not exactly relevant to our discussion here though. As before, this ignores phase shift effects which will distort how the waveform looks...
 
Oh, and you might be able to avoid obvious ringing with a really low order filter such as first or second order... this one I'll have to give some further consideration. But, again, 1st and 2nd order filters are not going to be very relevant to our application.

Also, you should have a look at the impulse response of some of these analogue filters... you might be surprised by that too.
 
I don’t think something really good about the analog filters. Actually, I don't think something realy good about the filters at all. :no: But Bessel does not ring. There is a 1kHz squarewave filtered by the fifth order Bessel filter at 20kHz (-3dB) at page 15 of the TI's Application Report SBFA001A (there is already this link in this thread.)
Oh, and you might be able to avoid obvious ringing with a really low order filter such as first or second order... this one I'll have to give some further consideration. But, again, 1st and 2nd order filters are not going to be very relevant to our application.
I wouldn’t be so sure. If you determine spectral content of the noise that should be suppressed, the thing can become easier than it seems. Then even such filters could be relevant. Alone or in conjuction with something else. ;)

Pedja
 
hifiZen said:
Since you can't hear the harmonics above 20kHz, you may as well get rid of them. If this is done with mathematical perfection, you'll get a squarewave that looks funny with the pre- and post-ripples, but it will still contain exactly the same audible components.

I may not be an expert on digital filter desing, but I know a thing or two about perceptual acoustics.

And I tend to respectfully disagree with the above statement, based on the following psychoacoustics and neurological research:

"Ultrasound activates the auditory cortex of profoundly deaf subjects", Imaizumi S, Hosoi H, Sakaguchi T, Watanabe Y, Sadato N, Nakamura S, Waki A, Yonekura Y., Neuroreport 2001 Mar 5;12(3):583-6

"Inaudible high-frequency sounds affect brain activity: hypersonic effect", shi T, Nishina E, Honda M, Yonekura Y, Fuwamoto Y, Kawai N, Maekawa T, Nakamura S, Fukuyama H, Shibasaki H., J Neurophysiol 2000 Jun;83(6):3548-58.

I know I'm leading this discussion a bit off context (beyond the scope of CD playback), but here goes. In short:

If you take music with natural ultrasonic harmonics and play back the A) music with ultrasonic harmonics B) music WITHOUT the ultrasonic harmonics C) only the ultrasonic harmonics, then people will report hearing:

- increased naturality with ultrasonic harmonics intact
- lessened perceptual naturality with ultrasonics removed
- nothing heard at all when only the ultrasonics are playing

Clearly there is still more to the whole process of auditory perception than we currently know. While we may not hear simple tones of 22+ kHz (most of us can't hear simple tones above 16 kHz anymore), we still can perceive their combined effect if they are part of the ultrasonic harmonics of the audible frequency range.

All this under scientifically valid blind testing conditions with results reported in a respected international peer reviewed medical journal.

Based on above, I'd rather have a ADC/DAC/filter combo that:

- Doesn't remove ultrasonic contents (unless it violates the Nyquist frequency)
- Has steep enough and quick enough attenuation in the stop band (to avoid AID in loudspeakers)
- Does not cause significant errors in the pass band (no -10 dB already at 18 kHz)

Does such a beast exist?

regards,
Halcyon
 
What about DVD players with 24-bit DAC's

Back to the original intent of the thread (not that I minded it drifting off to wherever) how well do ordinary DVD players with their fancy 24-bit dac's go at reproducing a square wave? I'd try it myself but my rotten LG player won't read any CD-R discs I have. I'm thinking of buying a DVD player to use just for playing CD's if in fact they do a better job of it.

GP.
 
Re: Re: Re: AID

Elso Kwak said:

Hi circlotron,
We could make a higher order Bessel filter, but this will increase complexity. With the three pole filter; the first pole being in the IV-converter I only use two discrete "opamps". The whole thing was designed with Filter-Pro. For a 5-pole filter a extra "opamp" would be needed etc. Due to the soft knee of the Bessel filter the situation in the 10kHz to 20kHz area will not be improved. A third order filter regardless of being it Bessel or Butterworth has a 18dB per octave ultimate rolloff.;)
This again raises the question how much attenuation beyond 20kHz do we need?:confused:

Hi Elso,

Good to see you kicking around these woods.
WRT analog LPF's in 0 x OS DACs, I have been listening
to a very simple 0 x OS DAC based on 1543 with NO
analog LPF! In fact it is the simplest DAC I have ever seen.

The sound thru SET (45) is great and top end is fine!
We even had it running thru 47labs type closed loop
SS gain clone amp and still no problems.

So you may need less HF rolloff than you think!

Is your kwak dac a 1541 jobby. Let me know how
it sounds, I have a few nice crown 1541's sitting
around waiting for a purpose in life!

Terry
 
Since you can't hear the harmonics above 20kHz, you may as well get rid of them.

Actually, I don't agree with this statement myself. I can hear those stupid ultrasonic motion sensors and door openers etc, and they drive me nuts. :snoopy: My point with that statement was not related to my opinion on the matter of ultrasonics, but rather I was focused on illustrating the effect of removing high frequencies in order to fit the waveforms into the bandwidth constraints of CD media.

I would assert that if one were to remove the ultrasonic components in order to comply with Nyquist constraints, then a digital FIR filter with the pre- and post- "ringing" is the best way to do it, as it has by far the least effect on the remainder of the waveforms... that is, the 20kHz and less frequencies, about which there is no dispute regarding the audibility. The same goes for reconsructing a waveform from data which does not contain the ultrasonic information... using digital FIR filters will have by far the least impact on the waveforms which <i>are</i> encoded on the disc.

Curious thing, Halcyon... the filter which meets your ideal criterion to the letter is the digital FIR filter (sinc function based, with high quality windowing)... basically your typical digital oversampling filter. Of course, as I have mentioned in prior posts, the quality of the results are very sensetive to how well the FIR filter was designed and implemented. Many synthesis techniques give very poor audio performance, and it takes a careful optimization to ensure that the filtering is done well so that it does not leave any audible artifacts. The subject of FIR filter implementation for audio oversampling and bandlimiting purposes is extremely complex, and goes far beyond the scope of this thread or perhaps even this forum, but the basic principles are as I have stated.

What my posts boil down to is that there is nothing fundamentally wrong with digital oversampling filters or the pre- and post-edge "ringing" observed on waveforms passing through these filters. There may very well be, however, serious problems with the way these filters have been implemented in the past. Thus, I am sure that on direct comparison testing, someone might well find a non-OS implementation which sounds better. But, I contend that the best sound is obtainable with the careful use of digital FIR OS filters. The former Pacific Microsonics proved with their HDCD technology just how much can be gained in fidelity by implementing a quality FIR filter system compared to the usual filters. For this reason alone, it may be worth building your own oversampling filter, but it is extremely difficult for the DIYer to do, and this is what alvaius is after with the DSP project.
 
Actually, a very important point that many people may be missing is that a perfect sinc-based FIR filter will leave no trace or signature whatsoever in a real waveform which passes through it, other than to remove the unwanted frequencies. I don't think everyone on this thread understands that. Whether it's used for oversampling or not, real music waveforms which pass through a "good" FIR filter (dare I call it a "blameless" filter? ;) ) come out the other side with <i>precisely</i> the same shape. This cannot be said of any other filter type.
 
Re: Re: Re: Re: AID

Terry Demol said:


Hi Elso,

Is your kwak dac a 1541 jobby. Let me know how
it sounds, I have a few nice crown 1541's sitting
around waiting for a purpose in life!

Terry
Hi Terry,
No my DAC is a AD1865N-K (highest selection grade). I sold all my TAD1541AS1 and I posted a comparison of the sound of the two DAC chips on AA quite some time ago.;)
http://db.audioasylum.com/cgi/m.pl?forum=tweaks&n=33102&highlight=elso+ad1865&r=&session=

http://db.audioasylum.com/cgi/m.pl?forum=digital&n=26834&highlight=elso+ad1865&r=&session=
:)
 
How about PMD200?

Hifizen,

do you have further knowledge on whether Pacific Microsonics (or MS) changed the filters within the PMD200 implementation?

I know that PMD100 is supposed to act really well, but I have no experience/data on the PMD200 chip.

And thanks for the insightful comments! I'm happy to learn more about FIR design (in fact, am just wading through a book to understand the basics).

regards,
Halcyon
 
Unfortuantely, I haven't read much about the PMD200 either. I'm pretty sure the filters are roughly the same as the PMD100, but with increased word widths to help keep quantization noise to a minimum. They may also employ some new techniques in the HDCD scheme, but to be honest I'm not sure, as I haven't been looking into HDCD technology for a few years now.

The reason I think the basic filter implementations haven't changed is because the HDCD scheme makes use of a nifty conjugate filter pairing arrangement, whereby the filter coefficients applied in the playback device are a paired with the filter coefficients used in the recording studio. By pairing sets of filter coefficients with certain "conjugate" characteristics, some of the non-ideal effects of the filter used to record the music can be cancelled by the filter doing the playback on the DAC end. It's a great idea, IMHO. Note that there are several filter pairs which can be applied... this is the other nifty thing HDCD encoding does: in the studio, a proprietary algorithm is used to dynamically analyze the waveforms being recorded, and select which filter pair to use from the available filters (something like 8 different filter pairs) - each filter pair is designed to optimize certain performance aspects depending on what is going on in the music. Apparently, the original HDCD crew did extensive listening tests to determine how to optimize the filters for different characteristics of the music.

There are a few other little things that HDCD does (so-called "peak restoration", and also properly implemented dithering, both of which are used to extend the dynamic range). However, there's nothing so special about proper dither, and many high quality CDs are produced with a good dithering algorithm to wring as much resolution as possible out of 16-bit CDDA... notably, Sony SuperBitMapping (SBM) and Apogee UV/22 (which uses some other tricks in the studio ADC process).

The HDCD process encodes a randomized pattern of data in the LSBs of the music data which, when detected and decoded in the playback device, tell the player which matched filter to use, and when to do peak restoration on clipped waveforms. Pretty slick system all in all, but all the goodies buried in the LSBs are lost if you do any digital processing before the data reaches the HDCD filter.
 
Hi,

Werner (an some others) is quite right when he states that a real square wave is never been recorded on a CD. The signal MUST be band limited to ½ fs to avoid nasty aliasing effects. So, testing with real digital generated square waves is pointless.

A real truly band limited square wave will look like this in the digital domain (as recorded on CD):

An externally hosted image should be here but it was not working when we last tested it.


You can make this signal yourself. HERE you will find a nifty program called GoldWave Digital Audio editor. You can use it for free, but it is shareware. It has a very kind way of remembering you.

It has an Expression Evaluator (under the “Tools” menu) where you can fill in any mathematical expression representing a waveform. You can make a band limited square by filling in the Fourier expression for it (first open a new file of the appropriate sample rate and length) :

(2/pi)*(sin(2*pi*f*t)+(sin(2*pi*3*f*t))/3+(sin(2*pi*5*f*t))/5+(sin(2*pi*7*f*t))/7+(sin(2*pi*9*f*t))/9+(sin(2*pi*11*f*t))/11+(sin(2*pi*13*f*t))/13+(sin(2*pi*15*f*t))/15+(sin(2*pi*17*f*t))/17+(sin(2*pi*19*f*t))/19+(sin(2*pi*21*f*t))/21)

Don’t forget to set f to 1000 in de the editor window for a 1 kHz square wave (it defaults to 500). You can save this generated wave as .wav and eventually burn it to CD. You can also generate a truly digital square wave. This already predefined in the library.

Now if you watch the band limited square on an oscilloscope you will see LESS ringing than a truly digital square, despite it rings more in the digital domain. This is something to think about when talking about a filterless dac. CD is meant for real life signals, not for technical signals.

A truly band limited square filtered by an analog filter shows also pre-ringing. How can these happen? There is no negative time, is it? Well it has the same behaviour as a digital filter: It has also delay! Such a filter is not easy to make but is possible to a far extend. It is usually made with bi-quadratic filters, which also adds several filter sections together. But it also follows from filter theory.

And oh yes, I have heard the original non-oversampling-no-filter 4715 Shigaraki DAC. It sounds pretty good. :) :cool:
 
hifiZen said:
...perfect sinc-based FIR filter will leave no trace... I don't think everyone on this thread understands that.

Objection your honour. This is precisely what I have been stating here and in other threads.

But never mind. What about 'knowledgeable' people like journalist Keith Howard who actually do some experiments and report on them in the press. He tried a Sinc filter on a test signal and reported pre- and post echos...

Shock. Horror.

Only ... his 'Sinc' was in reality a twice-oversampled, but sampled, Sinc.
No Sinc at all then.

The real thing remains elusive, unless massive oversampling is employed.
 
Don't look at me when you say that!

I'm starting to sick of hearing about this crap. What some people seem to forget is that there is an AAF on the A/D side of things. You will always have this pre-/post- ringing stuff if you use a CD made at 44.1 kHz. That is just the laws of physics at work.

I don't know of any CD player that uses computer-generated test signals to produce something worth listening to.

If there was, I'm sure Stereophile would do a review of it. And wax eloquently on how magical the 1kHz square wave sounds.

Jocko
 
Hi Jocko,

That was just what I am trying to say! Maybe, I still was not clear enough. ;) Besides that, I gave a hand to a tool to find it out by “Trial and Error” for people who still don’t accept the truth of reality. And yes a square is not something for music lovers, but it is still a valid signal for testing and judging audio equipment.

And oh yeah, listen to the not band limited technical square AND the truly band limited square. You will definitely hear a difference. Whether or not your hearing capabilities reach in the supersonic region. Even played back over you computer speakers.

The modern AKM AK4395 AD-chip is doing the whole mess of proper filtering and DA converting pretty well. This tiny piece of plastic is sitting in my M-Audio SuperDac. Sonically it outperforms many so called, High End Dac’s costing ten times more. Building your own DSP based filters to improve the sound from what is already out there is to my opinion silly nowadays.

If you want better sound from digital recorded stuff, you simply need higher sample rates in the first place and higher bit depth second place. As already mentioned by some in this thread, there is life above 20 kHz. For now most of us have to live with the fact that the end of the (audio) world is 20 kHz as dictated by Philips and Sony more than 20 years ago.

I did some extensive listening test comparing 44.1 kHz / 16 bit with 96 kHz / 24 bit (actually no more than 20 bit). Both compared to the non-digital processed stuff right from the mixing console. 96 kHz / 24 bit definitely comes much more close to the real played music stuff than 44.1 kHz / 16 bit.

_______________________________

hifiZen, if you work this out:

y = E(n=0->infinite) [1/(2n+1)]sin[(2n+1)x]

you will end up with a square with a infinite high (in ampitude) and infinite small (in time) pulse at the edges of the square ...
 
Ahem, I think I’m among those who don’t understand... :redhot:

Important thing here is what squarewave we have, not what maths says. But, if someone likes maths more than audio, and scientific theories more than music, I have some links. This article claims that the Gibbs phenomenon is not conditio sine qua non. Those more interested for this could try Google search :hypno2: Real math-freaks would want to read nothing less than something like this :scratch: (also listed in the second page of Google's search).

Now, about the audio. :hphones:

What you get when you in reality sample (i.e. bandlimit, AD convert) squarewave entirely depends on the filter that is used in the AD process.

Testing with digitally generated square waves is not pointless at all, because it shows how device reacts to transitions. Not naive, not unimportant, and no external reason can tell me it is wrong to expect good squarewave (!!!). That means clean and possibly fast transitions. I don’t care how squarewave sounds. It is entirely unessential. But I care how system behaves when transient event occurs in the system. And that is what the squarewave shows us, and that it is what is squarewave for. It is transition that is important. To understand this, try to think about the transition, not about the square, not about its frequency.

What I want to say is: the point is not in the mathematics, the point is in the transitions.

Pedja
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.