AndreYew
500+ Head-Fier
- Joined
- Jun 21, 2001
- Posts
- 660
- Likes
- 657
Out of respect for requests that technical discussion be left out of the other upsampling threads:
Upsampling DACs v2
Upsampling DACs
I've created this thread where technical discussion is allowed. Subjective opinions are welcome as well. And technical discussions correlating to subjective opinions are most welcome.
I mentioned in the v2 thread that Jan's analysis of sampling a 21 kHz sine wave at 44.1 kHz and the conclusions he draws are wrong. The analysis is in Jan's Analoguer project writeup:
Jan Meier's Analoguer
The analysis is in error because Jan uses linear interpolation rather than sinc interpolation. What is sinc interpolation? Instead of connecting the sample points with straight lines, as Jan does, you connect, or interpolate, several sample points with sinc functions (sin(x)/x). The technical phrase is you convolve the sample points with a sinc function. This basically means, to compute the value of the curve at one point, you center a sinc function on that point, and multiply it by that point's value. Move the sinc function down the left a little bit (an infinitesimally small amount in theory), and repeat, and add to the original multiplication. Do the same thing to the right also. Do this for every sample point you have.
Why such a convoluted scheme? First some basic math. Fourier analysis is the best tool to analyze this because we're talking about sine waves. A Fourier transform (FT) of a convolution of two things, A and B (here A are the sample points and B is the sinc function) is a multiplication in frequency domain of the FT of A and FT of B. If you work out the math, a sinc function is a brickwall low-pass filter in frequency domain, that is, when you perform brickwall filtering, you are actually interpolating your sample points with a sinc function.
The FT of the sample points is the well-known spectrum where the baseband frequencies of the original signal sampled is accompanied by images centered at multiples of the sample rate frequency. Why it looks like that after sampling is another interesting application of convolution, except this time you're convolving the original signal with a chain of delta functions (point-sampling).
Because we have images at high frequencies, we need to apply the low-pass filter (which is equivalent to sinc interpolation as mentioned above) to get rid of all the high frequency noise. Because we want to use a brickwall filter is why we need to use sinc interpolation instead of a linear interpolater.
Anyway, what Jan's done in his analysis is to use the wrong reconstruction filter (the linear interpolater which looks like some kind of funny parabolic-shaped filter with all kinds of non-linear phase) on his points, and that's why he gets his high-frequency wobble.
A useful way to think about digital sampling is that the sampling method has to be matched to the reconstruction filter. Sort of like the RIAA curve for LPs. For an LP mastered to RIAA standards, there is exactly one RIAA filter curve that will correct the LP back to what the engineer intended. Similarly for sampling, there is one reconstruction filter for each sampling method. If you use point-sampling (as Jan does in his analysis), then you must use sinc-interpolation.
--Andre
Upsampling DACs v2
Upsampling DACs
I've created this thread where technical discussion is allowed. Subjective opinions are welcome as well. And technical discussions correlating to subjective opinions are most welcome.
I mentioned in the v2 thread that Jan's analysis of sampling a 21 kHz sine wave at 44.1 kHz and the conclusions he draws are wrong. The analysis is in Jan's Analoguer project writeup:
Jan Meier's Analoguer
The analysis is in error because Jan uses linear interpolation rather than sinc interpolation. What is sinc interpolation? Instead of connecting the sample points with straight lines, as Jan does, you connect, or interpolate, several sample points with sinc functions (sin(x)/x). The technical phrase is you convolve the sample points with a sinc function. This basically means, to compute the value of the curve at one point, you center a sinc function on that point, and multiply it by that point's value. Move the sinc function down the left a little bit (an infinitesimally small amount in theory), and repeat, and add to the original multiplication. Do the same thing to the right also. Do this for every sample point you have.
Why such a convoluted scheme? First some basic math. Fourier analysis is the best tool to analyze this because we're talking about sine waves. A Fourier transform (FT) of a convolution of two things, A and B (here A are the sample points and B is the sinc function) is a multiplication in frequency domain of the FT of A and FT of B. If you work out the math, a sinc function is a brickwall low-pass filter in frequency domain, that is, when you perform brickwall filtering, you are actually interpolating your sample points with a sinc function.
The FT of the sample points is the well-known spectrum where the baseband frequencies of the original signal sampled is accompanied by images centered at multiples of the sample rate frequency. Why it looks like that after sampling is another interesting application of convolution, except this time you're convolving the original signal with a chain of delta functions (point-sampling).
Because we have images at high frequencies, we need to apply the low-pass filter (which is equivalent to sinc interpolation as mentioned above) to get rid of all the high frequency noise. Because we want to use a brickwall filter is why we need to use sinc interpolation instead of a linear interpolater.
Anyway, what Jan's done in his analysis is to use the wrong reconstruction filter (the linear interpolater which looks like some kind of funny parabolic-shaped filter with all kinds of non-linear phase) on his points, and that's why he gets his high-frequency wobble.
A useful way to think about digital sampling is that the sampling method has to be matched to the reconstruction filter. Sort of like the RIAA curve for LPs. For an LP mastered to RIAA standards, there is exactly one RIAA filter curve that will correct the LP back to what the engineer intended. Similarly for sampling, there is one reconstruction filter for each sampling method. If you use point-sampling (as Jan does in his analysis), then you must use sinc-interpolation.
--Andre