public abstract class WarpFunction1
extends java.lang.Object
Warping is the computation of the sequence g(y) = f(x(y)). Unwarping is the computation of the sequence f(x) = g(y(x)).
For warping, we need the function x(y) = y-u(x(y)) = y-uy(y). We compute the displacement uy(y) by iteration so that uy(y) = u(x(y)).
We also define a midpoint m(x) = (x+y(x))/2, and compute the displacement um(m) = u(x(m)) from u(x) by iteration so that um(m) = u(x(m)).
Modifier | Constructor and Description |
---|---|
protected |
WarpFunction1(int n) |
Modifier and Type | Method and Description |
---|---|
static WarpFunction1 |
constant(double u,
int n)
Returns a warping for a constant shift.
|
static WarpFunction1 |
constantPlusSinusoid(double c,
double u,
int n)
Returns a constant-plus-sinusoidal warping.
|
static WarpFunction1 |
gaussian(double u,
int n)
Returns a derivative-of-Gaussian warping.
|
static WarpFunction1 |
sinusoid(double u,
int n)
Returns a sinusoidal warping.
|
abstract double |
u(double x)
Returns the shift u(x).
|
float[] |
um()
Returns an array[n] of shifts um(m) = u(x(m)).
|
double |
um(double m)
Returns the shift um(m) = u(x(m)).
|
float[] |
unwarp(float[] g)
Unwarps a sampled function.
|
float[] |
ux()
Returns an array[n] of shifts u(x).
|
double |
ux(double x)
Returns the shift u(x).
|
float[] |
uy()
Returns an array[n] of shifts uy(y) = u(x(y)).
|
double |
uy(double y)
Returns the shift uy(y) = u(x(y)).
|
float[] |
warp(float[] f)
Warps a sampled function.
|
public static WarpFunction1 constant(double u, int n)
u
- shift.n
- number of samples.public static WarpFunction1 gaussian(double u, int n)
u
- maximum shift.n
- number of samples.public static WarpFunction1 sinusoid(double u, int n)
u
- maximum shift.n
- number of samples.public static WarpFunction1 constantPlusSinusoid(double c, double u, int n)
c
- constant shift.u
- maximum sinusoidal shift.n
- number of samples.public abstract double u(double x)
x
- the coordinate x.public double ux(double x)
x
- the coordinate x.public double um(double m)
m
- the coordinate m.public double uy(double y)
y
- the coordinate y.public float[] ux()
public float[] um()
public float[] uy()
public float[] warp(float[] f)
f
- array of values f(x).public float[] unwarp(float[] g)
g
- array of values g(x).