Adding points to a periodic contour using a trigonometric interpolant

2 vues (au cours des 30 derniers jours)
Alex Kerzner
Alex Kerzner le 3 Août 2017
Modifié(e) : Matt J le 3 Août 2017
I have a closed curve in the complex plane, call it
Z = [z_1,z_2,...,z_n];
with all entries complex numbers.
I'd like to increase the number of points on the curve by using a trigonometric interpolant (so that I get spectral accuracy), however I only want to increase the number of points between, say, z_a and z_b (with a < b).
If I want to increase the total number of points, I can just use
Z = interpft(Z, 2*numel(Z));
Unfortunately this adds points to the whole curve, which is not what I want. Does anyone know of a way to do this? I suspect it can be done using the FFT coefficients, but I have to admit my knowledge of FFT and how to use it is rather poor, so I'm hesitant to dive in.
Any help is much appreciated. Thanks :)

Réponses (1)

Matt J
Matt J le 3 Août 2017
Modifié(e) : Matt J le 3 Août 2017
If you're happy using interpft, then why not just use cubic spline interpolation, via the spline() command? Using interpft is the same as using a sinc interpolant and cubic splines are a close approximation of sincs.
Unfortunately this adds points to the whole curve, which is not what I want.
Alternatively, why not add points to the whole curve, then throw away the ones you don't want?
  2 commentaires
Alex Kerzner
Alex Kerzner le 3 Août 2017
Thanks for the reply, Matt. The reason I don't want to use a cubic spline is because I'd like to represent the closed curve with spectral accuracy. Does that seem reasonable?
Your suggestion of adding points and then throwing some away is very clever. I might end up using that if I don't think of another way. Thanks.
Matt J
Matt J le 3 Août 2017
Modifié(e) : Matt J le 3 Août 2017
The reason I don't want to use a cubic spline is because I'd like to represent the closed curve with spectral accuracy. Does that seem reasonable?
I don't really know what that means, but again, cubic splines should not give a very different result from interpft, and give you the flexibility of interpolating wherever you want.

Connectez-vous pour commenter.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by