1

I know the discrete cosine transform (DCT) is used for compression, but can anyone give an example of how to use it for bandlimited interpolation?

One way might be zero-padding in the DCT domain and then taking the IDCT. What is the time domain result of zero-padding in the DCT domain, and does it have any advantages over traditional windowed sinc interpolation? Are their other ways of using the DCT for interpolation?

Edit:

This question is motivated by this answer, where the poster references "discrete sinc interpolation" (as opposed to windowed sinc) and interpolation using the DCT in the work of Yaroslavsky. The potential advantage of using the DCT rather than the DFT is that the DCT treats the signal as if it is symmetric periodic (mirror image replicas), whereas the DFT treats it as simply periodic. I believe this reduces Gibbs phenomenon at the edges of the signal.

Gillespie
  • 1,767
  • 4
  • 26
  • 1
    //"does it have any advantages over traditional windowed sinc interpolation?"// - - - - - - In what context? Real-time processing (like sample rate conversion)? And why DCT instead of DFT? – robert bristow-johnson Jul 11 '23 at 18:56
  • @robertbristow-johnson I've edited the question. I think the advantage might be reduced edge effects. – Gillespie Jul 11 '23 at 19:14
  • 1
    When I learned about the DCT I was able to connect it to the DFT of a sequence nearly twice as long. $$ \big{ x[0], x[1], ... x[N-2], x[N-1], x[N-1], x[N-2], ... x[1], x[0] \big} $$ or nearly twice as long: $$ \big{ x[0], x[1], ... x[N-2], x[N-1], x[N-2], x[N-3], ... x[2], x[1] \big} $$ There is even symmetry naturally in the latter case and, with a little offset, also in the former case. That's how the DCT reduces edge effects. – robert bristow-johnson Jul 12 '23 at 02:04
  • Now, if you're using a DFT or DCT to interpolate, you're using the transform to circularly shift by a fractional sample amount. I don't think you'll do that for real-time operation unless your throughput delay is very long. If you use sinc-based interpolation, you would be reconstructing a continuous-time function with truncated sincs and they'll be whatever edge effects you get when you're close to the edge. – robert bristow-johnson Jul 12 '23 at 02:14
  • Or, depending on if $N$ is even or odd, you can sinc interpolate exactly for a circular buffer. $$ f(x) = \sum_{n=0}^{N-1} a_n , g(x-n), $$ For $N$ odd, we get the Dirichlet kernel: $$ g(u) = \frac{\sin(\pi u)}{N \sin(\pi u/N)}. $$ The expression for $g(u)$ I get when $N$ is even is

    $$ g(u) = \frac{\sin(\pi u)}{N \tan(\pi u/N)}. $$

    – robert bristow-johnson Jul 12 '23 at 02:22
  • Interesting, your formula for odd N is the same as a form of what Yaroslavsky calls the "discrete sinc" or "sincd" interpolator. – Gillespie Jul 12 '23 at 03:41
  • 1
    @robertbristow-johnson what do you mean by "sinc interpolating exactly for a circular buffer?" I think you're getting at the answer to my question, but I don't quite see it yet. – Gillespie Dec 06 '23 at 18:17
  • It was what I meant about using a circular lookup table for wavetable synthesis. If you get this paper, download it and read it from Adobe Acrobat because it's old and some of the math doesn't render correctly on other pdf readers. Also in the sense of this answer. It's about bandlimited interpolation of periodic functions. – robert bristow-johnson Dec 06 '23 at 19:17

0 Answers0