Live data from Hacker News

Interpolation Tricks

sol.gfxile.net

1–10 of 18 posts

Re: Interpolation Tricks

#2
Imagine you are watching the ball, but instead of traveling along a line, it is tracing a circle- however you are viewing it from the one-dimensional angle. Is that smoothstep, or would that be a different equation? They look similar to my naked eye.

Re: Interpolation Tricks

#3
post #2

Imagine you are watching the ball, but instead of traveling along a line, it is tracing a circle- however you are viewing it from the one-dimensional angle. Is that smoothstep, or would that be a different equation? They look similar to my naked eye.

That would be a sinusoidal function. Smoothstep looks similar but is different.

Re: Interpolation Tricks

#4
post #2

Imagine you are watching the ball, but instead of traveling along a line, it is tracing a circle- however you are viewing it from the one-dimensional angle. Is that smoothstep, or would that be a different equation? They look similar to my naked eye.

[deleted]

Re: Interpolation Tricks

#5
post #2

Imagine you are watching the ball, but instead of traveling along a line, it is tracing a circle- however you are viewing it from the one-dimensional angle. Is that smoothstep, or would that be a different equation? They look similar to my naked eye.

The reason smoothstep looks similar to a sinusoid is because it is a polynomial approximation. I remember Dan Perlin discussing it in his (book|paper|website), but googling around doesn't seem to show anything that I remember. For Perlin Noise, a sinusoid was the highest-quality interpolation because it was continuous everywhere, even at the endpoints. Smooth-step is discontinuous at the endpoints, but it is close enough for discrete computer graphics.

Re: Interpolation Tricks

#6
The most useful thing I ever learned about interpolation was how it relates to resampling to different rates and the specific techniques used to perform resampling when dealing with the Nyquist limits.

If you're removing samples, the biggest concern is whether the original signal has been bandlimited to the target rate, which can be achieved in the interpolator or by preparing the signal elsewhere.

If you're adding samples, then the interpolation function is burdened with reconstruction and the avoidance of artifacts in the process. This tends to inevitably lead towards the use of windowed sinc.

For this reason, scaling down images and raising the pitch of sound samples work out to be easier tasks than scaling up or lowering the pitch.

Of course, for the application shown in the article, the use of interpolation is in a different realm entirely.

Re: Interpolation Tricks

#7
post #2

Imagine you are watching the ball, but instead of traveling along a line, it is tracing a circle- however you are viewing it from the one-dimensional angle. Is that smoothstep, or would that be a different equation? They look similar to my naked eye.

Smoothstep is a polynomial approximation of a sine wave through (0, 0) and (1, 1), but it's pretty darn close.

http://www.onlinefunctiongrapher.com/?f=3*x%5E2-2*x%5E3|.5-c...

Re: Interpolation Tricks

#8
post #6

The most useful thing I ever learned about interpolation was how it relates to resampling to different rates and the specific techniques used to perform resampling when dealing with the Nyquist limits. If you're removing samples, the biggest concern is whether the original signal has been bandlimited to the target rate, which can be achieved in the interpolator or by preparing the signal elsewhere. If you're adding s…

I'd like to add that the reason we use windowed sinc is because we're lazy and it works well. There are techniques for making better FIR filters, e.g., Parks-McClellan/Remez for small filters or other techniques for larger ones.

Also, there is no inherent difference between upsampling and downsampling. Lowering the pitch of an audio sample is no harder than raising it, and in both cases you make the same tradeoff when designing the filter (aliasing, bandwidth, impulse response, and processing time).

The problem is with resizing images, because using the windowed sinc function makes the (incorrect) assumption that the desired result can be directly sampled from the band-limited input. The fact that we use Lanczos interpolation as the standard "high-quality" image interpolation algorithm shows that this assumption is false. (I should elaborate: Lanczos is still windowed sinc, but is subjectively better even though it has demonstrably higher amounts of aliasing than competing windows. Or rather, the assumption that is false is the assumption that the same priorities we use for designing filters for signal analysis can be used for resampling images.)

Re: Interpolation Tricks

#10
post #6

The most useful thing I ever learned about interpolation was how it relates to resampling to different rates and the specific techniques used to perform resampling when dealing with the Nyquist limits. If you're removing samples, the biggest concern is whether the original signal has been bandlimited to the target rate, which can be achieved in the interpolator or by preparing the signal elsewhere. If you're adding s…

I'd like to add that the reason we use windowed sinc is because we're lazy and it works well. There are techniques for making better FIR filters, e.g., Parks-McClellan/Remez for small filters or other techniques for larger ones. Also, there is no inherent difference between upsampling and downsampling. Lowering the pitch of an audio sample is no harder than raising it, and in both cases you make the same tradeoff whe…

I'm referring more specifically to mipmaps. They let you cheat when downsampling.
Post reply on HN