LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resample Waveforms (single shot): Pair of X and Y Arrays - Interpolation Mode?

Hi all,

I am currently trying to resample x/y-data. In the waveform utilities, there is a polymorphic routine that is able to perform resampling on pairs of x and y arrays. So far, that's fine.

However, when using the waveform version of the polymorphic vi, I can set i.e. FIR filtering and the corresponding parameters. When using the x/y-array-version of the vi, I can set the interpolation mode to FIR, but cannot set its parameters. The resulting data also looks like linear interpolation.

Is there anyone around with experience in this field?

Regards,
Matthias
0 Kudos
Message 1 of 7
(4,644 Views)
The FIR Filter mode interpolation only works for equally spaced input samples. So the feature is not supported when the input signal is XY data. The default used is, as you noticed, linear interpolation.

I'll suggest you to try the Spline (cubic) interpolation as an alternative. It is a good alround interpolation mode that is doing a good job in most cases.
Message 2 of 7
(4,644 Views)
Hi LocalDSP,

I will try spline. So for x/y-pairs, coerce, linear and spline are supported?

Thank you very much for your fast help!

Regards,
Matthias
0 Kudos
Message 3 of 7
(4,644 Views)
Yes the three other options "coerce", "linear" and "spline" all work for un-equally spaced (XY type) input data. Actually the FIR option should have been disabled and grayed-out. Thank you for pointing that out.
0 Kudos
Message 4 of 7
(4,644 Views)
One further question regarding spline: Is that suitable when I try to drastically reduce the sampling frequency of my data? I.e., I have data at 1 kHz, and reduce it to 5 Hz. Linear interpolation just interpolates between the two neighbouring points AFAIK. What about splines in this context?

Matthias
0 Kudos
Message 5 of 7
(4,644 Views)
In your case (with a very high decimation order), linear interpolation may be a good choice, assuming that the bandwidth of your signal is low compared to the input sample rate.

Another idea, if you really need the aliasing rejection that the FIR filter mode offers you AND your sample rate of 1 kHz is "almost" equally sampled, could be to do a two-step process.
1 - Resample your xy data to a waveform sampled at 1 kHz using linear interpolation or spline and then

2 - decimate (resample) the resulting waveform down to 5 Hz using the FIR filter mode.

Whether this will work in a satisfactory way for you or not depends a lot on your actual signal, but it may be worth trying.
0 Kudos
Message 6 of 7
(4,644 Views)
Hi,

good point. But we have some noise, so low pass filtering is really desirable. I will try the two-step process.

Thanks a lot,
Matthias
0 Kudos
Message 7 of 7
(4,644 Views)