Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Badly drawn waveforms vs. the audio that’s actually output—filters etc (Read 13453 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Is it possible to explain non-mathematically (or just a little) why this linked from Wombat's link is wrong? I know it is, just don't understand it very well.

This is one of the pictures accompanying the article:



Quote
I tested some 10 kHz and 20 kHz sine waves that were recorded at several word lengths (16 bit or 24 bit) and sampling frequencies (44.1 kHz, 96 kHz, 192 kHz), analyzing them in a software sequencer.

Isn't that just Audacity? I wonder if they "analyzed them in a software sequencer" to sound more professional.

 

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #1
This is how it looks when just painting lines between the points. A DAC does apply a reconstruction filter. If you measure this sinus played back and attach an oscilloscope you´ll see a perfect sinus. Audacity can´t do better. You may try some application like  Audition. You´ll see with these few points it is perfectly possible to reconstruct a clean signal.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #2
You may try some application like  Audition.
Last time I checked, Audition sinc-interpolated PCM data points, as it should.

In short, andy o, that looks bad because of an Audacity bug.

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #3
Hehe, shortly after posting here there was a nice picture posted that tells the whole story
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #4
Ah, I see, thanks

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #5
Those curves are utter bull.
I have used test cd signals of 20 - 20kHz sinewaves on 16 bit  44.1 kHz samples replayed through a micromega stage 2 and various other cd players and any sample that I threw at the player was reconstructed as a PERFECT sinewave - as displayed on an external oscilloscope.

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #6
This seems very obvious, but I'll ask anyway. Has anyone made an actual wave that looks like that (I assume it can't look exactly like it), and played it alongside that misrepresentation of a 44.1kHz sine? They should sound completely different, shouldn't they?

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #7
This seems very obvious, but I'll ask anyway. Has anyone made an actual wave that looks like that (I assume it can't look exactly like it), and played it alongside that misrepresentation of a 44.1kHz sine? They should sound completely different, shouldn't they?


If you wanted to make a wave that looks like the Audacity fictional waves, you'd have to use a far higher sample rate because the rounding that proper wave display programs like Audition provide is the result of applying the effects of an ideal brick wall filter ("sinc filter").

That means that the weirdness from Audacity is a consequence of something  very much like a DAC that lacks a reconstruction filter.  DAC's that lack a proper reconstruction filter are the rage among some audiophiles. I know of no DBTs comparing DACs the same resistor ladder with and without proper brick wall reconstruction filtering.

I can speculate with some technical support that there probably isn't an audible difference due to the presence or non-presence of a reconstruction filter, as long as the equipment downstream from the DAC has low nonlinear distortion. As a rule I would expect that they would sound very similar unless significantly nonlinear equipment were used for monitoring. Of course, SET amplifiers and some tweeters are significantly nonlinear.

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #8
DAC's that lack a proper reconstruction filter are the rage among some audiophiles.
That’s ironic, considering how often the square-/pointy-wave fallacy is trotted out by anti-digital ‘audiophiles’…

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #9
Hehe, shortly after posting here there was a nice picture posted that tells the whole story
where is the nice picture? That is really important to share!
The whole point of FFTs is that using if I am drawing what the FFT has stored in the time domain (ie if I am drawing sine waves) then I only need a couple of points to draw a PERFECT reproduction!
That is one of the biggest issues that people need to first get their head around when understanding digital audio.

when you see an irregular wave, what you need to ask your self is "what regular wave would I have to add together (ie what frequencies would have to be simultaneously present) to create the irregular wave I see”

so an irregular sine wave is in effect a regular one augmented with higher or lower frequency wave to varying amplitude.

Each of the additional waves only needs a couple of points to represent their frequency. As per usual it appears that CA article really doesn’t get what the Nyquist theorem is saying…

However it is right when it says that it is possible for a perfect 8kHz signal sampled at 96kHz to sound better than sampled at 192kHz if the DAC has trouble with 192kHz (ie is a cheaper DAC). The whole point is that a perfect DAC will produce a perfect 8kHz signal when sampled at 16kHz. But the quality of the output has little to do with the conversion and more to do with the analogue output. One of my earliest posts on HA was asking about DACs in AVRs as I am keen to understand the practicalities on consumer grade stuff.

Quote from: my earlier post link=msg=0 date=
What determines a good DAC?
I assume the main issues are post the conversion to analogue and that these issues are the usual ones that impact an amp (pre or power), such as clean power supply, suitable analogue filters, etc.
However are there any differences in the digital part of the amp (such as up/over sampling circuits, or the conversion itself)?

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #10
From that link:
Quote
The dots represent finite voltage values that are fed in sequence as a stream to the DAC, which then produces a stair-stepped output, after which a low-pass reconstruction filter smooths out the signal. What I want you to notice is how jagged the lines are at standard Redbook CD 16/44. The DAC and reconstruction filter's job is to make these jagged lines more sinusoidal, so that it will be like the music that was recorded, which is also sinusoidal. There are various ways of applying filters, and we won't get into that here, but I was really surprised at how poorly the 16/44 digital stream is representing the original 10 kHz sine wave. Notice that even at 16/96, the lines are not all that smooth. But, at 16/192, the sine wave looks very good. If we were observing a 10 kHz sine wave coming off an LP and displayed on an oscilloscope, it would be essentially sinusoidal, not jagged (it would not be perfectly smooth of course, as there would be at least a little distortion in the signal being played).

Translation:
1. Hardware after the CD player will smooth the waveform
2. The unsmoothed wave looks bad
3. Therefore, vinyl

Does anyone else see something missing here?

But! There is for this purpose one simple manoeuvre, wherewith the inconvenient requirement of logical progression is vanquished. Behold! the silver bullet:
Quote
There are various ways of applying filters, and we won't get into that here, but I was really surprised at how poorly the 16/44 digital stream is representing the original 10 kHz sine wave.
‘There are filters, but they don’t fit with my argument, so I’m going to brush them off altogether and DIGITAL SUX.’

I only read this one paragraph, and I’m already staggered by the level of disengenuity/dishonesty.

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #11
Quote
If we were observing a 10 kHz sine wave coming off an LP and displayed on an oscilloscope, it would be essentially sinusoidal, not jagged [...].

Well, it's exactly the same case with a 44.1 kHz sampled signal that went through the reconstruction filter of an (oversampling) DAC...

How can they simply get away with spreading such kind of misinformation?
"I hear it when I see it."

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #12
Quote
(it would not be perfectly smooth of course, as there would be at least a little distortion in the signal being played).


I have compared digital signal with perfect reproduction of sinusoidal waveforms and no sidebands of the fundamental (or at least none that I could see in my Oscilloscope) and the sinusoidal crap that comes from a tests LP, with a lot of harmonics all over the place.
I have also checked out IM pictures from a CD that were simply perfect. All measured of course at the analogue output of a CD player.

Just listen to a 1kHz or above sine wave from a test LP - the harmonics produced are in the audible range. I am always astonished to then go back to music where those harmonics are hidden and how good in comparison a LP still can sound despite all the crap the system produces.

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #13
Here's a proper screenshot (adobe audition) of a 20 kHz sine wave sampled at 44.1 kHz:
[attachment=6930:44.1khz_.png]

2x oversampled:
[attachment=6931:44.1kHz_2x.png]

4x oversampled:
[attachment=6932:44.1kHz_4x.png]

8x oversampled (2x zoom so that the samples are still visible):
[attachment=6933:44.1kHz_8x_zoom2x.png]

16x oversampled (4x zoom so that the samples are still visible):
[attachment=6934:44.1kHz_16x_zoom4x.png]

Many DACs oversample by a factor of 128..
"I hear it when I see it."

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #14
Hehe, shortly after posting here there was a nice picture posted that tells the whole story
where is the nice picture? That is really important to share!

Sorry, the link was to computeraudiophile and after this thread here was splitted the link was gone:
http://www.computeraudiophile.com/content/Why-2496-not-24192

Here's a proper screenshot (adobe audition) of a 20 kHz sine wave sampled at 44.1 kHz:

Thank you very much for these pics xnor. Fascinating how things work, isn´t it?
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #15
Guys, please do you know of any open source editor which displays the wav correctly, i.e. using the sinc filter? Thanks.

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #16
Guys, please do you know of any open source editor which displays the wav correctly, i.e. using the sinc filter? Thanks.

Audition?


Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #18
Quote
If we were observing a 10 kHz sine wave coming off an LP and displayed on an oscilloscope, it would be essentially sinusoidal, not jagged [...].

Well, it's exactly the same case with a 44.1 kHz sampled signal that went through the reconstruction filter of an (oversampling) DAC...

How can they simply get away with spreading such kind of misinformation?


In fact, a 10 KHz wave from a CD player is typically far more perfectly sinusoidal than that coming off of a LP. Think of THD as a way for characterizing how non-sinusoidal a signal is, because that is what it is. The THD of a 10 KHz wave coming off of a CD will be on the order of 0.01% or less, even for fairly humble hardware. The THD of a 10 KHz sine wave coming off a LP might be from 100 to 1,000 times that!


Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #20
I'm not sure if there are any free tools available that don't just draw straight lines. But you could resample to some (much) higher sample rate to take a look at the waveform.
"I hear it when I see it."

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #21
I'm not sure if there are any free tools available that don't just draw straight lines. But you could resample to some (much) higher sample rate to take a look at the waveform.



Well, resampling to pixels is what have used so far. But not very comfortable though :-)

Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #22
Put another way it is impossible to know with any certainty the amplitude of a pure tone with only two regularly spaced points per cycle.

Ah, no, this isn't true. The only point at which reconstruction falls over is when the sampled waveform frequency reaches exactly half the sampling frequency or exceeds it. Below the Nyquist frequency there is one, and only one sinewave of a given frequency and amplitude which can be drawn through any two points (per cycle) on the graph.[/size]

I saw somebody asking about other problems inherent in sampling and reconstruction.

The 2 most obvious are ADC and DAC nonlinearity. These are fairly easy to understand. This is where the voltage intervals in either device don't exactly coincide with their numeric representation. A 16-bit DAC should be capable of outputting 65536 equally spaced voltages. This is not always the case. The spacing may vary from step to step, or there can even be values missing.

Less commonly understood is the sampling (or playback) instant.

Thinking in terms of the graph, in order to accurately record and play back a sinewave, the line must have no thickness and the points on the graph must be dimensionless. To put this another way, the sampling must be done instantaneously i.e. it must take no time at all, because if it takes time then the value can change over the time that the sampling takes. Similarly, on the playback side, a DAC would be required to output extremely short (zero duration, in fact) pulses of a given amplitude.

It is impossible to meet these goals. An ADC can employ a circuit called a sample-and-hold to reduce the duraation of the sampling instant, but the time taken is always finite. We know as well that the output from the majority of DACs is not a series of very short duration pulses, but a staircase function. In terms of re-drawing the graph, if the point is of finite size or is stretched into a line then there is an uncertainty about exactly where to draw the line of the reconstruction.

These sampling and reconstruction problems give rise to what are called sin x/x (sin x over x) errors. Such errors do not make digital recording/playback systems unusable, but they need to be taken note of, and in some instances a correction must be applied.

w
wakibaki.com


Badly drawn waveforms vs. the audio that’s actually output—filters etc

Reply #24
The digital waveform in the first picture is a plot of the samples. It is a correct plot of the samples . The nearer the audio signal  frequency gets  to half the sampling frequency the more  pronounced those undulations in the digital waveform get, and the spikiness. At just under half the sampling frequency there is only two sample per period of input frequency and those samples can be near the peaks or near the zero points . The undulations and spikiness wont be in the output of the reconstruction filter.