4 ms·
I'd like to answer your questions. While no finite audio clip qualifies as bandlimited, the Nyquist theorem cheats by assuming that the audio clip repeats inde
by amavect 2y ago
I'd like to answer your questions.
While no finite audio clip qualifies as bandlimited, the Nyquist theorem cheats by assuming that the audio clip repeats indefinitely. Doing so results in sharp frequency lines, separated by gaps of zero. Each frequency line lies on an integer multiple of the audio clip's length, the fundamental frequency.
Equivalently, every finite audio clip has a time-discrete Fourier transform.
Mathematically, an audio clip of length T seconds at a sample rate S Hz must have DFT coefficients separated by 1/T Hz, with a maximum frequency less than S/2 Hz. For example, a 1 second clip at 48000 Hz has DFT coefficients between [0,24000) at every 1 Hz. By increasing the length of the audio clip, the frequency resolution increases.
In asking for the error, you ask for the values between the discrete Fourier coefficients. What happens outside of the audio clip determines what happens between coefficients. If the signal repeats, interpolate zeros between coefficients. If the signal goes to zero (not exactly bandlimited), interpolate a sinc function summation between coefficients (this has to do with summation of the rectangular/boxcar function).
How much overhead/error/lookahead is needed to approach the Nyquist result? Theoretically, none. But in practice, perfect filters don't exist.
In practice, how big is the difference? In order to properly record a real waveform, the signal must go through a physical low-pass filter, or else risk unbounded aliasing. The answer depends on the filter specification. I pulled up a Realtek ALC892 datasheet. When sampling at 44100 Hz, a -1 dB passband at 20158 Hz, and a -80 dB ADC stopband at 24916 Hz. Yep, that allows aliasing to pass through, yet it remains somewhat passable. No surprises from a cheap chip. Hence the importance of oversampling during recording or reconstruction in better chips. The audio files themselves don't need it because the error comes from imperfect filters.
https://www.alldatasheet.com/html-pdf/1137676/REALTEK/ALC892/26789/77/ALC892.html https://www.alldatasheet.com/html-pdf/1137676/REALTEK/ALC892...
Hope this helps.
- 112233 2y agoIt does! Thank you a lot. But I still don't know the name for the hard part (how to quantify the "almost" of the reconstruction filter) Making signal band-limited by repeating it does a nice hat trick: it makes any part of the signal depend on all preceding and all following samples. That effect is not insignificant -- sinc(x) decays as 1/x . This requires that low-pass filter either to generate long pre-ringing tails, or to emit way above the cut-off. I'm sure analog filters have pre-ringing too (by delaying the peak), I just don't know how it is called. But, in short, sampling signal and then reconstructing it causes it to "travel back in time". Trying to limit pre-ringing messes up phase. Nothing in there looks like the ideal iFFT case, and it is hard to find accurate information about all of this.
- amavect 2y agoBecause of your comment, I spent some time reading about DSP. https://www.analog.com/en/resources/technical-books/scientist_engineers_guide.html https://www.analog.com/en/resources/technical-books/scientis... Chapter 14 demonstrates how digital filters can achieve perfect linear phase accuracy. Chapter 17 demonstrates how digital filters can also compensate for the phase inaccuracy of physical filters. Blew my mind when I read that. I can't thank you enough for spurring me into reading about this. The book calls "pre-ringing" ripple and overshoot. Ripple happens on both ends, the ringing before, and the delayed peak after. (See the step response examples in Chapter 14, page 267.) We also call it the Gibbs phenomenon, a necessary effect of a bandlimited Fourier series reconstructing a discontinuous waveform. Analog filters don't have ripple because of they exhibit exponential decay to a step function, necessarily a non-linear phase response. Symmetric ripple and overshoot in the filter step response demonstrates a linear phase response (Chapter 14, page 268). In fact, I would call the pre-ringing a desirable trait for dealing with audio: a reconstructed bandlimited phase-accurate signal will enter the ear in the same way as the original non-bandlimited signal (unless >20000 Hz actually matters). Additionally, we likely want a windowed sinc filter (Chapter 16), which deals with the 1/x ripple decay of the sinc function with acceptable stopband performance. So, with all of that, I see how modern codec chips can achieve a nearly linear phase response in the 0-20000 Hz range, with -80 dB of aliasing noise at 20000 Hz, during both recording and playback. For recording, these modern chips likely use a cheap physical low pass filter, followed by sampling at a high rate, followed by a digital filter, followed by downsampling. For playback, do the reverse: the chip likely uses upsampling, followed by a digital filter, followed by a delta-sigma circuit (or some other DAC), followed by a cheap physical low pass filter. Check out the block diagram of the ALC892. https://www.alldatasheet.com/html-pdf/1137676/REALTEK/ALC892/4169/12/ALC892.html https://www.alldatasheet.com/html-pdf/1137676/REALTEK/ALC892... Utter DSP victory.
- 112233 2y agoSuper thanks for the book rec, on first look seems to contain all the important things a DSP textbook needs. And it is free!