Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Downsampling with fixed intervals

Subject: Downsampling with fixed intervals

From: Wolfgang Schwanghart

Date: 24 Sep, 2008 11:50:03

Message: 1 of 4

Dear all,

I am searching for a function that can perform following:

I have coastline data where the vertices are unequally spaced. Now I want to sample the data in a way, that may be best described as going with a rod of specified length along the beach and taking a gps measurement at every length of my measuring rod. What I finally want is the list of measured coordinates. What this requires is "of course" an interpolation scheme that may be e.g. linear or spline.

Does anyone know, if there is a function available, that can perform this. So far I couldn't find anything in the FEX nor in the Matlab Help.

Best regards,
Wolfgang

Subject: Downsampling with fixed intervals

From: John D'Errico

Date: 24 Sep, 2008 12:10:04

Message: 2 of 4

"Wolfgang Schwanghart" <schwanghart@googlemail.com> wrote in message <gbd9hb$9u$1@fred.mathworks.com>...
> Dear all,
>
> I am searching for a function that can perform following:
>
> I have coastline data where the vertices are unequally spaced. Now I want to sample the data in a way, that may be best described as going with a rod of specified length along the beach and taking a gps measurement at every length of my measuring rod. What I finally want is the list of measured coordinates. What this requires is "of course" an interpolation scheme that may be e.g. linear or spline.
>
> Does anyone know, if there is a function available, that can perform this. So far I couldn't find anything in the FEX nor in the Matlab Help.


No, you will not find anything that does this
explicitly, although one could write it without
too severe mental anguish.

Assume that you have a curve defined by a
sequence of points in the (x,y) plane. The
curve may be piecewise linear, or it may be
a parametric spline, defined in terms of a
piecewise linear arclength along the curve.

Start at the beginning of the curve. Find the
(first) intersection of your curve and a circle
with center at the start point. Step along
said curve, solving a sequence of root
finding problems along the way.

You might use the intersections tool, written
by Doug Schwarz and on the file exchange.
It will require you to define the initial curve
as a piecewise linear one, and then to
approximate your circle using a piecewise
linear, polygonal approximation to a circle.
But doing so will then be a very fast way to
solve your problem.

The only issue that you must deal with,
regardless of how you choose to solve the
problem, is if the coastline is so tightly
convoluted that these convolutions are
smaller than the length of your ruler. But
in that case, it just means that your ruler
is way too long for this problem.

HTH,
John

Subject: Downsampling with fixed intervals

From: Wolfgang Schwanghart

Date: 24 Sep, 2008 12:30:06

Message: 3 of 4

Thanks for your reply, John. I think, I'll try it your way. I just wanted to be sure that something like this is not already available and I'd waste time on something others could do better.

Best regards,
Wolfgang

>
> No, you will not find anything that does this
> explicitly, although one could write it without
> too severe mental anguish.
>
> Assume that you have a curve defined by a
> sequence of points in the (x,y) plane. The
> curve may be piecewise linear, or it may be
> a parametric spline, defined in terms of a
> piecewise linear arclength along the curve.
>
> Start at the beginning of the curve. Find the
> (first) intersection of your curve and a circle
> with center at the start point. Step along
> said curve, solving a sequence of root
> finding problems along the way.
>
> You might use the intersections tool, written
> by Doug Schwarz and on the file exchange.
> It will require you to define the initial curve
> as a piecewise linear one, and then to
> approximate your circle using a piecewise
> linear, polygonal approximation to a circle.
> But doing so will then be a very fast way to
> solve your problem.
>
> The only issue that you must deal with,
> regardless of how you choose to solve the
> problem, is if the coastline is so tightly
> convoluted that these convolutions are
> smaller than the length of your ruler. But
> in that case, it just means that your ruler
> is way too long for this problem.
>
> HTH,
> John

Subject: Downsampling with fixed intervals

From: Dave Brackett

Date: 10 Nov, 2008 16:09:02

Message: 4 of 4

Did you get some code to do this Wolfgang? I am trying to do something fairly similar so would be interested in seeing how you did it if so.


"Wolfgang Schwanghart" <schwanghart@googlemail.com> wrote in message <gbdbse$kh9$1@fred.mathworks.com>...
> Thanks for your reply, John. I think, I'll try it your way. I just wanted to be sure that something like this is not already available and I'd waste time on something others could do better.
>
> Best regards,
> Wolfgang
>
> >
> > No, you will not find anything that does this
> > explicitly, although one could write it without
> > too severe mental anguish.
> >
> > Assume that you have a curve defined by a
> > sequence of points in the (x,y) plane. The
> > curve may be piecewise linear, or it may be
> > a parametric spline, defined in terms of a
> > piecewise linear arclength along the curve.
> >
> > Start at the beginning of the curve. Find the
> > (first) intersection of your curve and a circle
> > with center at the start point. Step along
> > said curve, solving a sequence of root
> > finding problems along the way.
> >
> > You might use the intersections tool, written
> > by Doug Schwarz and on the file exchange.
> > It will require you to define the initial curve
> > as a piecewise linear one, and then to
> > approximate your circle using a piecewise
> > linear, polygonal approximation to a circle.
> > But doing so will then be a very fast way to
> > solve your problem.
> >
> > The only issue that you must deal with,
> > regardless of how you choose to solve the
> > problem, is if the coastline is so tightly
> > convoluted that these convolutions are
> > smaller than the length of your ruler. But
> > in that case, it just means that your ruler
> > is way too long for this problem.
> >
> > HTH,
> > John

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us