Add fancy sample ramping.

Also added compilation flags to enable or disable ramping and linear
interpolation.