0
$\begingroup$

I'm trying to understand interpolation in discrete time. We know that for linear interpolation we use h(t)=triangle waveform. When we talk about linear interpolation in discrete time, I'm using expression=$x(n-1) + (x(n) -x(n-1)) \cdot u$. Where $u$ is the value between $2$ input samples. It is between $0$ and $1$.

For such kind of system, to calculate impulse response, I gave impulse input($1$ followed by lot of $0$'s). Here I have kept $u=0.2$. The output I got is $0.2$, $0.8$. The expectation was a triangle. Because we know theoretically that's the interpolating function I used. Where am i not thinking right here? May be the way discrete time impulse response works? Although in time domain it interpolates correctly.

$\endgroup$
3
  • $\begingroup$ en.wikipedia.org/wiki/Upsampling $\endgroup$
    – ZR Han
    Commented Jun 17, 2021 at 6:09
  • $\begingroup$ Are you taking about interpolation at the same sample rate (e.g. fractional delays) or interpolation for up-sampling? Up-sampling is not a time invariant operation so the concept of impulse response doesn't really apply here, at least not with some clarification of what exactly you mean by that. $\endgroup$
    – Hilmar
    Commented Jun 17, 2021 at 13:54
  • $\begingroup$ I am talking about fractional delay. Actually my broader question, if I have discrete time samples coming at some rate and I pass it through black box(internally it has equation x(n−1)+(x(n)−x(n−1).u) Then how can I convince myself that I am using a linear interpolator. Ideally in continuous time signal processing when we give impulse and get a triangle we can say its linear interpolator. But in discrete time what can I do? $\endgroup$ Commented Jun 18, 2021 at 17:18

2 Answers 2

3
$\begingroup$

Duane Wise and I tried to sorta generalize this issue to interpolation using higher-order polynomials than the linear interpolation (which is first-order polynomial interpolation).

If your interpolation was "nearest-neighbor" (a.k.a. "drop-sample") interpolation, that is like convolving with a rectangular pulse. that's like multiplying by the $\operatorname{sinc}(\cdot)$ in the frequency domain or with $\operatorname{sinc}^2(\cdot)$ in the power spectrum.

If your interpolation is linear interpolation, that is like convolving by the triangular pulse (as shown by Dan) which is multiplying by $\operatorname{sinc}^2(\cdot)$ in the frequency domain or with $\operatorname{sinc}^4(\cdot)$ in the power spectrum.

If you're oversampled a little bit, that means that the width of the images are a little skinny and that $\operatorname{sinc}(\cdot)$ function (from nearest-neighbor interpolation) passes through zero in the middle of each of those images and beats them motherfuckers down so that the power left in those images are small. Even moreso does the $\operatorname{sinc}^2(\cdot)$ beat them motherfuckers down even more. Higher-order polynomial interpolation does even better, but costs more computation.

In my former life when I worried a bit about quality samplerate conversion, I found that upsampling by a factor of 512x and linearly interpolating between the upsampled samples was sufficient in quality and decently cheap.

$\endgroup$
3
  • 1
    $\begingroup$ Interesting! And you’re one tough interpolator; I wouldn’t want to be an interpolated sample around you on a bad day! $\endgroup$ Commented Jun 17, 2021 at 18:23
  • 1
    $\begingroup$ i'm badass! you wouldn't want to be an image that hopes to foldover and alias and fuck up my interpolated audio. you interpolated samples are fine with me. just the goddamn images that i wanna push into the dirt. $\endgroup$ Commented Jun 18, 2021 at 2:03
  • 1
    $\begingroup$ I know where to go if you want the best F’in audio you could possibly get $\endgroup$ Commented Jun 18, 2021 at 2:04
2
$\begingroup$

Since a picture is worth thousand words, I saved nine-hundred-eighty-four words by pasting the image below:

triangle

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.