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.
Pedja said:
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: (?)

Not happy with both formulations. If you define 'transient response' as the response to the classical infinite-bandwidth impulse and/or square wave, then you should know that these stimuli can not exist as legal signals in a properly bandlimited (Nyquist) sampled digital system. We can only make them exist by cheating, i.e. generating them on a computer as e.g. a 0-0-0-0-65535-0-0-0 sequence and sending that to a DAC.
But in a real-life situation, with stimuli bandlimited and sampled, no such a situation could possibly occur.
Hence the reponse of the system to it is irrelevant and possibly misleading. Again: all that ringing is supposed to be there, it is a necessary part of the perfect reconstructor.
 
Re: Re: AID

Circlotron said:

why couldn't you use one with as high an order as you want?

GP.
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:
 
Illegal Signal

Werner said:
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.
Hi Werner,
You make a very good point. What we need is a testdisc with a recorded squarewave not digitally generated but taken from a analog signal generator and subjected to the normal CD-recording process i.e. lowpass-filtering that signal and AD-conversion, transfer to Reed-Salomon code etc. etc.
Would be interesting how that looks like comparing NON-OS DAC's and oversampled DAC's when playing back that CD.;)
Would we get back a squarewave???;)
 
Re: Ringing

Elso Kwak said:
Hi Circlotron,
If you go to non-oversampling you will get a <B>PERFECT</B> square wave even without the slight wiggles.
I did not say this is the cause for the better sound of NON-OS though. If you use Bessel low-pass filter after the DAC the fidelity of the waveform is preserved.;)
Elso, this is not true for many NON-OS players because of the sharp filters. My old Denon DCD-1000 had rather typical step response for 20 kHz, 7th order LC-filter, no pre-ringing of cource since it's an analogue filter, and than some ringing.
 
Werner is absolutely correct. What looks like pre-ringing and post-ringing is, in fact, not ringing at all!

Ringing implies some response to a signal which was not part of the original signal... Often times, it's the result of overshoot error in feedback systems, or some energy trapped in a passive component and oscillating around, thus producing some little wiggle that was not part of the original signal. But what we have here is not ringing! Those ripples are are supposed to be there! They are a perfect non-bandwidth-limited representation of what was recorded on that CD!!!

The observed "ringing" (this is a really improper term to apply here) is actually exactly what was recorded on that CD, but the numeric sample values don't show it, because the data on the CD is band-limited to 20kHz. However, when we reconstruct these samples as an analogue waveform, the digital filter tries to reconstruct a perfect squarewave, since that's what the samples describe. The only problem is, the sampled data bandwidth was limited to 20kHz, and so the information recorded on the disc does not contain the square wave harmonics above 20kHz.

As anyone with an education in signal theory knows, a squarewave contains harmonics to infinite frequency. If we chop off the harmonics above 20kHz, presto... you get a squarewave with this funny-looking pre and post- "ringing". Lop off all the harmonics, then yes, you'll be left with nothing but a sine wave. But, Pedja, we're not losing all of the harmonics, just those above 20kHz.

For a more interesting trial, record something like a 11.025 kHz squarewave on a CD, and see what you get out the analog side. Better yet, record an 18kHz squarewave / sinewave (doesn't matter) and play that back. Then you'll really see the difference between oversampling and non-oversampling DACs! (take note, Elso!)

So, take a perfect squarewave with sharp corners and listen to it. 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. Identically. Precisely. No phase shift, no amplitude errors, nothing. Play that back through a non-OS DAC, and the subsequent analogue filter, and you will have all sorts of amplitude and phase errors, even with the touted Bessel alignment... although what you see on a scope screen may look a little prettier. Just ignore it, it's only psychology - human perception of what's "right" or "wrong", and sorry to tell you folks, but this stuff isn't intuitive. In this instance, your instincts are wrong.

In the middle of a flowery meadow lies a rotting, stinking deer carcass. Is it bad for the environment? Of course not, it's perfectly natural - happens all the time. We could clean it up... haul it away and incinerate it. Wouldn't that look nicer? Would you feel better about it? Sure, but nature was better off ugly and undisturbed, not altered to fit someone's perception of what's "right". Think about that the next time you receive some Greenpeace propoganda. ugly != bad
 
Ringing

Hi HifiZen,
I was talking about a 1kHz squarewave. Forgot to mention that. Right in the middle of the audio band. Also I am not saying that the sound of NON-OS is better <B>because</B> of the lack of ringing.
I simply made a DAC in my Sony with the standard CXD1244 digital filter and AD1865, and I made a NON-OS DAC in my Sony omitting the digital filter. The difference in sound was really <B><I>jawdropping! </B></I>:att'n: This has nothing to do with instincts. Kusunoki offered a explanation for the difference in sound. I am not a expert in digital filters.

I do not agree with you about a bandwith limited squarewave having ripples. It depends HOW you bandwith limit it in other words it depends on the lowpass filter method. Again my third order Bessel lowpassfilter with the crossoverpoint at 10kHz leaves the 1kHz squarewave as it is; perfect.:eek:
See also my first post on NON-OS:
http://www.diyaudio.de/forum/messages/248.html

:)
 
Another scope pic

This is a shot from a Sony Discman with a 1-bit dac. Notice no re-ringing here. There was a slight trace of 176 kHz on the waveform too , if that's relevant.
 

Attachments

  • square wave from jon's discman.jpg
    square wave from jon's discman.jpg
    7.6 KB · Views: 588
FACT: Digital filters are no more responsible for the "misnomer" pre-ringing, than analog filters are. Sorry, but that is not disputable, that is the truth.

FACT: "Pre-Ringing/Ringing" is just a result of a bandwidth limited representation of a square wave. However, if you do the filtering with a linear phase filter, and I don't care if that is in the analog or digital domain, you will find that the ringing magically (okay mathematically!), goes away.

This is just simple signal processing theory. What seems to have been confused on this thread (and many others), is the difference between "what" is being implemented, and "how" it is being implemented.

If you make a non-oversampled DAC and put on a 3rd order butterworth, chebychev, elliptic, or any other non-linear phase analog filter, you will get ringing, even though no digital processing has occured. Only with a linear phase bessel will you not get ringing.

In the digital domain, if you oversample with a non-linear phase filter, and then follow it with any analog filter, you will have ringing.

If in the digital domain, if you oversample with a linear phase digital filter, either Bessel IIR, or an FIR filter, and follow it with a linear phase analog filter, then you will not have ringing.

So, for all those oversampling nay-sayers, may I suggest that you implement a linear phase oversampling digital filter (probably with a DSP), and then follow that with a non-oversampling DAC, and follow that with a bessel analog filter. You will get all the benefits on the non-oversampling DAC that you wanted, but will also get the benefits of oversampling in being able to keep the wide bandwith and also eliminate aliasing.

*** Some things to keep in mind. ***

* Sigma-Delta DACS are inherently oversampling! Though you may feed that ADI/TI, etc. DAC with (4*44.1KHZ) = 176KHz oversampled with a linear phase digital filter, it may then be passed through a non-linear phase filter in the DAC! There goes your nice square waves out the window! Start reading the data sheets or asking the suppliers, or even prototype the DACs and see what the square waves look like.

* What methodology does your oversampling digital filter use? Is it a linear phase digital filter?

* What is that sample rate convertor you are using doing? Is it using linear phase filters internally?


For purity, you will need to go back to a minimalist approach. A DSP56K series from Motorola or ADSP21065 from ADI, which both have IIS ports. Do the code for oversampling yourself (dead easy actually). And then feed it to a true non-oversampling DAC, such as the TI 1702/1704

I am not saying that the non-oversampled DACS people are building don't sound better. Heck, they probably do. But it is wrong to blame it on digital filtering and oversampling. If you make proper use of these tools, you could make an even better DAC.

Alvaius
 
Oh, by the way, I did read Kusunoki's article.

http://www.sakurasystems.com/articles/Kusunoki.html

Frankly, what a crock of crap (sorry for the expletive). Before people write such articles, it is best that they understand the science behind what they are writing about. The "diffusion of sound coherence". My, my, my ..... I have some swamp land in Florida I would like to sell!

If you understand the math, you will understand that an analog filter must also create a "diffusion of sound coherence" with an infinite number of speakers all adding together, but even more complicated with each speaker recursing on itself with an infinite number of recursions and speakers ....... hmmm, maybe I could coin "infinite resolution of diffusion of sound coherence"?

No doubt I have pissed at least half the people off on this system, but no doubt I will generate some interesting, and hopefully well thought out replies, maybe one from Mr. Kusonoki?

"If what you hear does not match what you are measuring, then perhaps you are measuring the wrong thing."

Alvaius
 
NON-OS DAC's

alvaius said:
FACT: Digital filters are no more responsible for the "misnomer" pre-ringing, than analog filters are. Sorry, but that is not disputable, that is the truth.

FACT: "Pre-Ringing/Ringing" is just a result of a bandwidth limited representation of a square wave. However, if you do the filtering with a linear phase filter, and I don't care if that is in the analog or digital domain, you will find that the ringing magically (okay mathematically!), goes away. :checked:

This is just simple signal processing theory. What seems to have been confused on this thread (and many others), is the difference between "what" is being implemented, and "how" it is being implemented.

If you make a non-oversampled DAC and put on a 3rd order butterworth, chebychev, elliptic, or any other non-linear phase analog filter, you will get ringing, even though no digital processing has occured. Only with a linear phase bessel will you not get ringing. :checked:

In the digital domain, if you oversample with a non-linear phase filter, and then follow it with any analog filter, you will have ringing.:checked:

If in the digital domain, if you oversample with a linear phase digital filter, either Bessel IIR, or an FIR filter, and follow it with a linear phase analog filter, then you will not have ringing.:checked:

Hi alvaius,
Fact 1 not agreed. Digital filters give pre-ringing and after-ringing. Analog filters only after-ringing. For other statements I agree I filled in the checked:checked: sign
You suggest a linear phase digital filter. Please name a partnumber so we can enjoy it. You call a DSP deadsimple. Sorry I don't think so. Are you suggesting the Wadia approach? Looks quite complicated to me.
My simple experiment stands as it is: with this digital filter (CXD1244) it sounds much better without it:)
 
According to the article I gave the link for, there are a digital filters without preringing. But there are not a digital filters without ringing at all.

Also, analog filters with preringing do not exist.

Chad, whatever is the quantity of the harmonics you remove from the squarewave, removal of the harmonics changes the shape from squarewave toward the sinewave (i.e. vertical lines became less vertical, and edges soften). Ringing doesn’t belong here in itself. Bessel filter is good example. With given amplitude roll-off, phase response determines time domain behavior.

Btw, if you would record 18kHz squarewave on the CD you would get 22.05kHz sinewave (does it mean "nothing"?)
Werner said:
But in a real-life situation, with stimuli bandlimited and sampled, no such a situation could possibly occur.
Hence the reponse of the system to it is irrelevant and possibly misleading.
CD is not unable to play the transients. When I say transient, I mean acoustical equivalent of the transitions in electrical domain. Transitions in square wave and impulse correspond to transients in acoustical domain. Music is full of transient, actually, it’s biggest part is about the transients. System can soften that transitions, system can ring, can have only partially vertical line, can do these in a many ways and combinations, but in all this, I simply can not agree with that “the response of the system to it is irrelevant and possibly misleading”. There are limits in CD format, there are the limits in the technical execution in response to demands established by the format, but it is not irrelevant. Regarding this, squarewave and impulse response stay irreplaceable to determine behavior of the system.

At the other hand, following your thoughts, what data do you expect to see when you make AD conversion of the 1kHz squarewave? Some ringing data inside? More than one sample that show the rise of the signal? Do we need the same type of filtering during AD and DA process? Shortly, what data would be needed to produce perfect square wave in the system that rings with generated square wave?

Pedja
 
oops... Brain fart, I mean't minimum phase, not linear phase. Long day, what can I say.....

Other than that, I did not mean to imply analog filters will pre-ring. What I mean't simply is that digital filters do not inherently pre-ring.... you can design ones that do and ones that dont. You can design ones that don't post-ring as well. Bessel filters can be implemented in the digital domain. Just make sure you use lots of precision, i.e. 48 or 64 bits, or you may find you have a worse signal than you started with.

.. If you playback an 18KHz square wave on a CD player, you should get an 18KHz sine wave, but it will all come down to how the player implementation.

All recording systems include anti-aliasing filters on the front end. Could you build one without one? Of course, but if you ever got any harmonics above nyquist frequency on the input, then on the output, you would suddenly have sounds that did not exist on the input. So the 1KHz square wave will record as a bandwidth limited square wave and the amount of ringing will be dependant on the filter type.

You can of course build a DAC without an aliasing filter on the output, and while there may not be audible distortion at the output of the DAC, if any thing beyond the DAC generates IM distortion, then you will end up with system distortion. Like everything in this game, there is tradeoffs.


pedja, the issue I have with the article you posted is that there is no description of the anti-aliasing and reconstruction filters used in the ADC/DAC, and the Ring-Dac is to my knowledge a sigma-delta type converter and hence there are decimation filters that will have effects on the waveforms over and above whatever effects the digital filters the authors created.

Alvaius
 
Hello Alvaius,

“.. If you playback an 18KHz square wave on a CD player, you should get an 18KHz sine wave, but it will all come down to how the player implementation.”

Problem is that the highest frequency squarewave that 44.1kHz sampling format can register is 14.7kHz. Not enough samples for more. :cannotbe:

“So the 1KHz square wave will record as a bandwidth limited square wave and the amount of ringing will be dependant on the filter type.”

This is something I can easily agree with. :cool:

“You can of course build a DAC without an aliasing filter on the output, and while there may not be audible distortion at the output of the DAC, if any thing beyond the DAC generates IM distortion, then you will end up with system distortion.”

There are a few ways to fight against this, directly (leaving slight and/or prudent analog filtering) or methodically (use of NFB and/or tube amps). :bulb:

“pedja, the issue I have with the article you posted is that there is no description of the anti-aliasing and reconstruction filters used in the ADC/DAC, and the Ring-Dac is to my knowledge a sigma-delta type converter and hence there are decimation filters that will have effects on the waveforms over and above whatever effects the digital filters the authors created.”

Yup, we can only surmise about them. Sorry, but I did not find a place where is better shown time domain behavior of the digital filters. I’m not sure is my English good enough to understand your last sentence, but if it means what I understand... the only things were changed were digital filters, it is quite logical these differences are up to them. If it is not what you are talking about, please rephrase, sorry.

Pedja
 
I assumed you would put that 18KHz square wave into an anti-aliasing filter before you sampled it and hence would get an 18KHz sine wave. Actually if you directly sampled the 18KHz square wave, you would get an 18KHz sine wave, plus a range of harmonics at multiples of 44.1 and 18KHz, as you are essentially taking a signal with harmonics at:

18KHz,
54KHz,
90KHz, etc.

and modulating it with a signal at
44KHz,
132 KHz,
220 KHz, etc.

with all the resultant signals in the 22KHz bandwidth, so just from the 2 sets of 3 frequencies above, you would have 18KHz and 10KHz, but of course there will be lots more. [Sorry for any minor mistakes in my arithmetic, but the concept is accurate.]

Alvaius
 
Elso:

I certainly didn't mean to imply anything about how non-OS <i>sounds</i> in comparison to OS DACs, but I did want to illustrate the technical differences, and the theoretical superiority of a properly implemented OS approach. If you want to see a linear phase digital filter, any of the numerous symmetrical FIR-based OS chips will have precisely linear phase. It is the linear phase characteristic which is actually responsible for the pre-ringing. If the pre- and post-edge ripples are symmetrical, you're dealing with a linear phase filter. PMD100, SM5847, DF1704 are examples, though they differ in the quality of the implementation.

Consider the following: a digital filter has the capability to "see" a limited distance into the future, thanks to a short data buffer. This allows the implementation of filters which are more ideal... that is, closer to the mathematical perfection we can only obtain on paper. In the analogue world, a filter circuit can only react to signal components which have already passed. Hence, no pre-ripple. So, the result is that the ripple components are all phase-shifted (think group delay) so that they all appear after the square wave's edge. In a perfectly linear phase system, the ripple components are not delayed at all, with respect to the edge, and hence are distributed symmetrically around it.

Also, digital systems are perfectly capable of implementing any filter which is possible in the analogue world. So, if you really want, you can write the transfer function for your Bessel filter, change it into the Z-domain, and drop the coefficients into a digital IIR filter implementation. Presto, you'd have a carbon copy of your analogue filter, only done digitally. The actual DSP algorithms which perform the filtering really are extremely simple. If you've done the work to generate the optimum filter coefficients, then programming a real implementation of that filter is a piece of cake. Now, from a DIY construction point of view, building a DSP is not easy... on that I can agree with you.

As for Kusunoki's article, oh my... I'm not even going to go there! Alvaius pretty much summed it up.

Pedja:
Chad, whatever is the quantity of the harmonics you remove from the squarewave, removal of the harmonics changes the shape from
squarewave toward the sinewave (i.e. vertical lines became less vertical, and edges soften). Ringing doesn’t belong here in itself.
Bessel filter is good example. With given amplitude roll-off, phase response determines time domain behavior.
Sure it does. If you have a math program on your computer, try plotting the following function:

y = sin(x) + sin(3x) + sin(5x) + sin(7x)...

You'll see that the more harmonics you add, the closer it gets to a squarewave. As you start to get really close, it'll look just like that square wave with pre- and post-"ringing". Re-write the above equation as a series, and you can show the result for n=0 -> infinite, which will be a perfect squarewave.

In any case, the operation of a sinc filter is not so obvious, and it's effect on a square wave seems a bit dubious (though i assure you, it's not... it just doesn't "look" right). What is much more interesting is to see how a sinc filter works on real signals, and this is one reason I suggested recording an 18kHz tone to CD: playback through non-OS vs. OS (using sinc FIR filter) system will reveal the magic behind the sinc function... :wiz:

sinx/x is, quite literally, the "perfect reconstructor". In the real world, it's perfection is limited only by the quality of the implementation. :wrench: :up:
 
Let me add to HifiZen's previous long reply (which was excellent), that the notion of Sinc as 'perfect reconstructor' is not a matter of opinion, agreement, or tone-deaf engineering. It is a simple matter of mathematics, proven beyond dispute by Nyquist and Shannon, long before people were thinking of digital audio for pleasure.

I invite the people who have issues with pre/post ringing to look up the early work of above two scientists, and also to take a look at the time domain representation of the Sinc function (it rings like a bell), and its frequency domain representation (perfect cutoff above fs/2).

It is the convolution of the infinitely ringing Sinc function with the sample train as recorded on the CD that ultimately yields the original band-limited signal.

The only caveat is that there exists no real-world implementation of Sinc: our digital FIR oversampling filters can only approximate this ideal. Some do better than others, and yet others deviate from ideal (Wadia, ...) and a last group thinks to do without any reconstructor at all, believing that the ear itself makes a good enough reconstructor.

But again, in the context of a band-limited input signal, the response to digitally synthesized impulse and square functions is not very relevant.

Perhaps people have issues with the band limiting, in which case increasing the sample frequency is the single one solution.
 
Yes, if you filter that 18kHz, it would be the same.

No need to understate Kusunoki’s research. Kusunoki himself recognized that with non-os there is a problem with higher freqs sinewaves. You can see it in the page mentioned here. Sinx/x corrections suggested by Thorsten Loesch should solve this problem, in the analog domain.

”Perhaps people have issues with the band limiting, in which case increasing the sample frequency is the single one solution.”

Absolutely.

But again, I can not agree the response on (synthesized or not) squarewave and impulse is irrelevant.

Pedja
 
Pedja said:
with non-os there is a problem with higher freqs sinewaves. You can see it in the page mentioned here. Sinx/x corrections suggested by Thorsten Loesch should solve this problem, in the analog domain.

Two different things. Thorsten's Sin(x)/x correction is there to compensate for the slight treble loss implied by the zero-order hold nature of a practical R2R DAC chip (aperture). That's all, and it is standard practice in non-oversampling DAC systems like digital video.

Kusunoki's treble 'problem' is there because he looks at a non-filtered waveform, and tries to understand how it would sound (= filtered action).
If you would take a mathematical representation of that ill-sampled 20kHz with all its amplitude modulations, and apply a boxcar filter to it at fs/2, you would end up with a clean 20k sine wave. And guess what the impulse reponse of that boxcar function would look like...
 
Hello Werner,

I must say I have not made it yet, only made some simulations with conventional test signals. But, I am not so sure this filter will leave raw non-os’s 20kHz “sinewave” untouched. At least, it rings... :rolleyes: Will measure when I make it.

It is not the same when you say impulse response is irrelevant, and impulse response is sacrificed in the name of the some other stuff.

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