| |
 |
|
|
Science Forum Index » Math - Numerical Analysis Forum » Linear Interpolation Inversion for N even?...
Page 1 of 1
|
| Author |
Message |
| Greg Heath... |
Posted: Mon May 05, 2008 9:23 pm |
|
|
|
Guest
|
Linear Interpolation Inversion for N even?
Under certain conditions the sampled function
x(1:N) can be reconstructed from the linearly
intepolated midpoints
xm = (x(1:end)+x(2:end))/2
For example, if one of the original points
(e.g. x(j)) is known, then
for i = j:N-1
x(i+1) = 2*xm(i)-x(i);
end
for i = j:-1:2
x(i-1) = 2*xm(i-1)-x(i);
end
If x(j) is arbitrarily initialized, the above
algorithm will yield errors that are constant
in magnitude and alternating in sign. Therefore,
if mean(x) = 0 and N is odd, the error is easily
removed by using sum(x).
y = zeros(N,1);
z = cos(pi*(0:N-1)'); % [+1,-1,...,-1]'
if rem(N,2) ~= 0 % N odd
for j=2:N
y(j) = 2*xm(j-1)-y(j-1);
end
s = sum(y)
x = y - s*z;
else
error('Reconstruction unknown for N even.')
end
The algorithm obviously doesn't work for N even
because sum(y) = 0 for arbitrary x(j).
Is there a way to recover x if no original points
are known and N is even?
Thanks in advance,
Greg |
|
|
| Back to top |
|
| Gordon Sande... |
Posted: Tue May 06, 2008 7:36 am |
|
|
|
Guest
|
On 2008-05-06 04:23:38 -0300, Greg Heath <heath at (no spam) alumni.brown.edu> said:
Quote: Linear Interpolation Inversion for N even?
Under certain conditions the sampled function
x(1:N) can be reconstructed from the linearly
intepolated midpoints
xm = (x(1:end)+x(2:end))/2
xm will have one less value than x.
Quote: For example, if one of the original points
(e.g. x(j)) is known, then
An original point will be a value not supplied in xm.
Quote: for i = j:N-1
x(i+1) = 2*xm(i)-x(i);
end
for i = j:-1:2
x(i-1) = 2*xm(i-1)-x(i);
end
If x(j) is arbitrarily initialized, the above
algorithm will yield errors that are constant
in magnitude and alternating in sign. Therefore,
if mean(x) = 0 and N is odd, the error is easily
removed by using sum(x).
An external assumption that supplies one value. Why
do you need n odd?
Quote: y = zeros(N,1);
z = cos(pi*(0:N-1)'); % [+1,-1,...,-1]'
if rem(N,2) ~= 0 % N odd
for j=2:N
y(j) = 2*xm(j-1)-y(j-1);
end
s = sum(y)
x = y - s*z;
else
error('Reconstruction unknown for N even.')
end
The algorithm obviously doesn't work for N even
because sum(y) = 0 for arbitrary x(j).
Is there a way to recover x if no original points
are known and N is even?
Find some way to supply an additional value. For some
applications the initial value will be available as
used above. For others the total (or mean) may be known
as also used above. Sometimes the initial difference
(derivative) might be know. And so on. Some of the
external values will be easy to use and others will take
a bit more work.
Write it out as a matrix equation. It will be missing one
row. Find another row that is linearly independent.
Quote: Thanks in advance,
Greg |
|
|
| Back to top |
|
| |
|
Page 1 of 1
All times are GMT - 5 Hours
The time now is Fri Dec 05, 2008 6:53 am
|
|