|
Audio Asylum Thread Printer Get a view of an entire thread on one page |
For Sale Ads |
71.112.27.9
In Reply to: Re: How right? Don't challenge my aural intelligence, pls. posted by b.l.zeebub on February 13, 2007 at 05:42:18:
Howdy
You said "I guess there are some misunderstandings about Nyquists theorem. It states that it is POSSIBLE to recreate a sampled waveform accurately if the sampling frequency is at least twice the highest signal frequency. This does NOT mean that accuracy is guaranteed!"That's actually wrong. It more accurately says that in the ideal world you will exactly reconstruct (no matter where the samples land) any bandlimited waveform. There is still a lot of wiggle room there, but not as you state.
Some of the problems are building perfect anti-aliasing and reconstruction filters. Other problems are that truly bandlimited signals have properties that may be counter intuitive. But with proper filters and a bandlimited signal every freq up to the Nyquist rate are reconstructable even if there are almost only two samples per cycle.
This subject has been beaten to death here and else where, but reading a real book on sampling theory should help to make it clear.
Follow Ups:
Ted,
you are absolutely right about Nyquists theorem. Of course when it says 'bandlimited waveforms' this actually means that it is not possible to reproduce a square wave of any frequency as square waves contain all harmonics at equal level. Personally I like my kit to be able to reproduce any waveform successfully, at least within the range of human hearing.
And I don't know about you or anybody else but I can quite easily hear the difference between sine, sawtooth and square wave up to at least 16kHz (thats were my generator cuts out).
It is also true that I have not read the "real book on sampling theory"; my sources here are a lecturer at a technical college (his subject: Digital Audio) and my uncle (Phd in higher mathematics and > 10 years of R&D for the European Space Agency specialising in all things digital ie digital data transmission, fractals etc).Either way I can't really see how it would be possible to recreate a sine accurately if during the recording process the actual peak values are missed. You can't recreate what has never been encoded. By the way last time I looked the 'reconstruction filter' was nothing more then a slew generator which leads to a phase delay which tends towards 90deg as the 'two samples per cycle' situation is approached. Feel free to elucidate...
and I wondered about a similar point myself. If you sample a sine wave at EXACTLY twice its frequency, it is possible to get all zero values. And obviously, this tells you nothing about the signal. Here are a couple of answers:First, the Nyquist theorem has, I believe a greater than sign, not greater than or equal to. And if you are even slightly greater than twice the frequency, you will eventually hit a peak.
Secondly, Pohlmann addresses this exact question in his book Principles of Digital Audio. His answer, to paraphrase from memory, is that, in practice, you are sampling complex signals that are not sine waves and this issue is never important.
> Either way I can't really see how it would be possible to recreate a
> sine accurately if during the recording process the actual peak values
> are missed.Consider sampling a single sine wave 4 times per period starting at 0 degrees:
0 +1 0 -1 0 ...
or starting at 45 degrees:
0.707 0.707 -0.707 -0.707 0.707 ...
The magnitude of 1.0 is contained in the information in second series even though the peak value never occurs. This is because the signal is not reconstructed by joining up the dots but by integration over orthogonal functions.
If you consider the coefficients of a DFT for the first series the one involving a sine wave at a quarter the sampling frequency will sum to 1.0 (ignoring scalng) with all the other sine and cosine coefficients summing to zero.
For the second series you will get non-zero coefficients for both the sine and the cosine coefficients at a quarter the sampling frequency with the other coefficients summing to zero. This will be a sine wave of magnitude 1.0 shifted by 45 degrees.
Of course a series like 0.707 0.707 0.707 will never arise unless the frequency is exactly half the sampling rate which is impossible.Also how does the D/A convertor know that the original was a sine wave when the only information its got is a numerical voltage value?
Its easy for you because you got prior knowledge, there are no such luxuries for the convertor. Could have been a sawtooth, ramp, triangle or square wave.
Or worse still a complex, non repetitive audio signal.
HowdyHere's an 18KHz Sine wave (in a 16bit 44.1K sampled signal.) The little squares are the samples and the green waveform is the (unambiguously) reconstructed sine wave. Obviously there are fewer than 3 samples per cycle (44.1/18 = 2.45 to be precise).
If you wish you may specify any band limited wave you want and I'll show you the unambiguous reconstruction.
> Of course a series like 0.707 0.707 0.707 will never arise unless the
> frequency is exactly half the sampling rate which is impossible.It was an easy to understand example to show why your thinking was wrong. Analogue signals are not reconstructed from digital ones by joining the dots. (The example was quarter the sampling frequency because half the sampling frequency aliases - DC and half the sampling frequency give the same sequence.)
> Also how does the D/A convertor know that the original was a sine
> wave when the only information its got is a numerical voltage value?I take it from this question that you do not know what a DFT is or how a D/A convertor works. I will pass on giving the lecture since it easy enough for you to look up on the web.
> Its easy for you because you got prior knowledge,
A DFT is linear and so will only ever give one answer. Prior knowledge of the answer does not change the answer.
> there are no such luxuries for the convertor. Could have been a
> sawtooth, ramp, triangle or square wave.These would all give a different series. They also all contain an infinite number of frequency components as mentioned by Ted and so cannot be represented exactly by a finite number of samples.
> Or worse still a complex, non repetitive audio signal.
Again we return to your not understanding how to transform samples between time and frequency space and what information is contained in the samples and what is not.
HowdyYou said "... Could have been a sawtooth, ramp, triangle or square wave." But this isn't true. It had to be band limited before conversion so those don't apply.
That's part of what I was trying to get at by stressing the band limiting in my first post.
Also a proper reconstruction filter is the same as a proper antialiasing filter: ideally it passes all freqs less than the Nyquist rate unchanged and eliminates all higher freqs. There are better and worse implementations (approximations) to this in practice and you described one of the worst.
"Also a proper reconstruction filter is the same as a proper antialiasing filter: ideally it passes all freqs less than the Nyquist rate unchanged and eliminates all higher freqs."Actually, if you go back to Shannon's proof for the theorem you'll find that the reconstructor is unambiguously defined, and that the AA filter is not defined at all.
--
The reconstructor, for the theorem to hold, has to be our infinitely-wiggly f(r)iend Sinc(x). If applied in all its glory the wiggles cancel out completely, so it has no drawbacks in the time domain (despite contrary claims from, oh, the Wadias and the Todds).
Small detail: most silicon-based reconstructors aren't quite like Sinc, but are half-band low-pass FIRs, with only 3dB attenuation at
fs/2.--
The AA is not defined. It is up to humanity to come up with an AA filter that guarantees zero aliasing all the while being transparent to the human ear. If you use Sinc(x) or a wiggly FIR here you introduce wiggles into the recording. These are there to stay.
And again, most silicon-based AAs are half-band FIRs, even the ones in 'pro' gear.--
Much more interesting for AA duties are linear phase low-pass filters with a strictly monotonic frequency curve (no ripple) and a wide transition band. If you want a (more or less) flat extension to 20kHz then the latter can only be supported by using a higher sampling rate. In the case of 96kHz you would keep everything flat to 20kHz (or rather, slowly dropping to -0.1dB at 20kHz or so), and then slowly roll off to -140dB at 48kHz. Such filters still introduce time-domain wiggles, but they are much shorter/faster than conventional brick wall filters.
See Dunn, Craven, ...
--CD's Catch-22:
1) We can only hear out to 20kHz.
2) Nyquist/Shannon are right and fs > 40kHz perfectly captures a 20 kHz band-limited signal.
3) So 44.1kHz is fine.
3) There is no way for transparently limiting a signal to 20kHz while using a 44.1kHz sampling rate AND keeping the in-band frequency response ruler flat.
5) So either 44.1kHz is not sufficient OR the system's frequency response should be allowed to roll-off through the upper octaves.
HowdyThanks for the correction RE the anti-aliasing. I tend to think of the pure audio world and the simplification of both filters being the same works well, at least in the abstract. Obviously when you get to best practices things are different...
-Ted
P.S. Why didn't you jump in earlier when people were making a mockery of Nyquist rather than picking on me :)
Hi Ted,not picking on you, not at all.
And why not earlier? Well, I only visit PHP twice a year ;-)
Back to business. All too often the reconstructor is specified as a filter (any filter?) with flat in-band response and infinite rejection past fs/2, and the specification for the ideal (ideal according to whose requirements?) AA filter. But specifying the reconstructor like that is wrong, or at least misleading. And copying the spec for the AA filter is wrong, as it is good for Nyquist, but not necessarilly so for the application at hand.
bring bac k dynamic range
HowdyWell that was my point :)
The op claimed that you needed more samples and that you could only represent signals whose peaks got sampled exactly. My point was that there are counter intuitive (to the uninitiated) restrictions caused by the requirement for band limited input (e.g. between 1/4 and 1/2 Nyquist only sine waves can be represented, no triangle, square, ...) and even more so the fact that there are no perfect implementations of the required filters. I was pretty careful to talk about ideal vs. actual implementation being a problem.
Oh well, back to "The Nutcracker" in multichannel on SACD which doesn't have these particular problems :)
Ted and Werner - Excellent discussion! Thanks so much...
This post is made possible by the generous support of people like you and our sponsors: