|
Audio Asylum Thread Printer Get a view of an entire thread on one page |
For Sale Ads |
130.149.86.77
In Reply to: Re: Not quite right. posted by b.l.zeebub on February 14, 2007 at 02:07:27:
> 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.
Follow Ups:
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: