10-19-2007 02:36 PM
10-22-2007 08:49 PM
10-23-2007 08:23 AM
10-23-2007 10:04 AM - edited 10-23-2007 10:04 AM
Don, you should give a glance to the resample waveform function (in the signal processing subpalette. Seems that it does what you are looking for !
Message Edité par chilly charly le 10-23-2007 05:05 PM
12-04-2010 04:15 AM
Dear Chilly,
thanks for this solution it worked quite well for me although I have a small problem with it for which you might have a solution or an idea.
I posted my problem in a similar topic/thread:
So I tried several methods to sort out my resample/interpolation problem and your way seems to be the best, but it's adding a few 0s at the end of my resampled array. I wonder if you have an idea why this would happen, because everything else (size of the array and the rest of the interpolated values seem to be good).
Thanks,
Attila
12-04-2010 04:30 AM
I'd rather post a screenshot too, to make things easier to understand:
So as you can see I'm trying to match the template to the final array size (236 to 600(left) and 625(right)).
Any idea or suggestion is welcome!
Thnaks,
Atttila
12-06-2010 10:24 AM
Hello Attika,
With the Resample Waveforms (single shot).vi you have the option to 'open interval? (F)' This option chooses the interval of the input to sample. If you set this value to true, the trailing zeros will be removed. If the value is set to false, these trailing zeros appear.
The Align and Resample Express VI has the same options and you can play around with these settings to determine which work for your application. You can read more about them here: http://digital.ni.com/public.nsf/allkb/3DADE9F3962FF89E86256D25005EBD48?OpenDocument.
Best of luck!
12-06-2010 12:39 PM
My favorite 1d interpolation routine is now the 'Interpolate 1d Fourier.vi'.
It allows choice of interpolation factor or interpolation size. It works great.
Don
12-07-2010 09:21 AM
Dear Don,
thank you for the reply, I've been trying different options to tackle this problem, but the situation seems to be qutie complex.
To summarize my problem I describe it in a different way now:
the orginal task is to compare to 'graphical signals', two spirals; one is a template, a perfect spiral genereted previously by a different program, the other is a hand-drwan figure (these are different in size: the template is a fixed-size array, but the hand-drawn array is completely random sized). To make matter worse, the problem is that this hand-drawn array of X,Y points is that they are not sampled equally in time. I have a timestamp for each, but they are not equally spaced. My goal is to somehow make it possible to compare these two signals first coordinate-wise, then in a polar system and eventuially in the frequency domain.
My approach right now is to somehow interpolate the timestamp vector first, and then resample/interpolate the X and Y vectors of the hand-drawn figure to the same size as the previously interpolated time vector. this way I could get an equally spaced time/X/Y set of vectors of a certain length. Then I should interpolate the template signal to the size of the previously interpolated set of vectors of the hand-drawn figure so I could compare the two signal at the same positions in time and frequency.
Unfortuanetly I've still haven't solved the first part, where I want to create the equally spaced time/X/Y vectors, so if anyone has any suggestions please share it here!
Thank you again for your continuous help!
Attila
12-08-2010 04:36 PM
Hi Attila,
You should be able to interpolate the timestamp using the Interpolate 1D VI. If you set the X input to the timestamp vector (converted to a number - I used seconds in my testing) and the Y input as the index vector for the timestamp vector, i.e. [0, 1, 2, ..., length(X)-1, length(X)]. You then can set the xi input to your desired equally-spaced timestamp vector. This will then output yi, your updated index vector. Using that xi though, you are able to interpolate your X and Y vectors accordingly.
Regards,
Lynn