LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

interpolation of a complex vector

Hello All

I have a complex vector, this is the complex numbers corresponding to a frequency vector.

I would like to interpolate the complex vector at the points between the frequency vector.

Is there is LV such a interpolation function which can interpolate a complex vector?

Thanks in advance.
PP
0 Kudos
Message 1 of 20
(9,639 Views)
In other words, you have a series of complex numbers C[0], C[1], C[2], ... , each number associated with a frequency F[0], F[1], F[2], ...

And you want to find a value C(f) for an arbitrary f.

If (I repeat, --IF-- ) the C[] array was simple (not complex) numbers, then it's easy:

1... Make sure the F[] array is in ascending order. Sort it (and re-arrange the C[] array to match) if necessary.

2... Feed the F[] array and the f term into a THRESHOLD 1D ARRAY function (ARRAY palette). This gets you the fractional index where f would lie in the F[] array.

3... Feed that fractional index and the C[] array into a INTERPOLATE 1-D ARRAY function.

4... Out comes the C value at f, assuming that f lies within the min / max of the F[] array.

---
----------- HOWEVER ----------

The INTERPOLATE ARRAY function will not work on a COMPLEX array.... Why?
The trouble is the interpolation of complex numbers is mathematically undefined. Or, more precisely, it is defined TWO ways.

Consider two points, in rectangular notation:
2 + j0
0 + j2

What is the point halfway between them?
If you add them and divide by 2, you get the answer of 1 + j1
That is reasonable.

Consider two points, in polar notation

2 /_ 0
2 /_ 90

What is the point halfway between them?
If you average the magnitudes, and average the angles, you get:

2 /_ 45

And that, too, is reasonable.

Note that the two points are the same in either notation, but THE ANSWERS ARE DIFFERENT !

1 + j1 is NOT EQUAL to 2 /_ 45 !

It all depends on what makes sense in your application. Both answers are reasonable in certain circumstances.

This is why the INTERPOLATE function refuses to work on COMPLEX arrays.

You COULD split the complex array in
to REAL and IMAGINARY parts, interpolate each, using steps 1-4 above, and combine the two results back into a complex number. Is it the RIGHT number? Only you can judge that.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 2 of 20
(9,638 Views)
Another way to look at this, assuming you know a bit about U.S. geography, is to ask "What point is halfway between New York City and Los Angeles?"

The "polar" answer would be "Kansas City" (or thereabouts).
The "rectangular" answer would be "22.7 miles beneath Kansas City" (or thereabouts).

Either answer could be considered correct, depending on what you really wanted to know.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 20
(9,638 Views)
Thanks CoastalMaineBird
That realy helps a lot.

regards
Pawel
0 Kudos
Message 4 of 20
(9,638 Views)
Sorry for splitting into two mails.

I am also thinking how the interpolation of a frequency response works in LV or in other signal processing alghoritms.
After the Fourier transfor, we have a complex variable. It might be useful to find its values between the samples it was created (e.g. change the sampling rate).
Than, how the interpolation is done? Probalby the magnitude and phase is separatelly interpolated.
On the other hand, in the meanwhile, I checked the Matlab interp1 function. And what I found out, that the interpolation is done at the real and imaginary parts separatelly!!! and it is not possible to determine how the interpolation is taken.

Interesting problem.

kind regards
Pawel
0 Kudos
Message 5 of 20
(9,638 Views)
For interpolating an FFT output, consider re-sampling the input (interpolating the input wave to simulate a higher sample rate than you actually have), then do an FFT on the higher-resolution timewave.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 6 of 20
(9,638 Views)
Hi Pawel and coastama..
 
 
 i am just beginning to build a vector from mathematical equation between 2 wave.
i 've got similar problem combine 2 X and Y axis wave for machining purposes and convert into vector, but i am not very clear what coastama explain,can you give to me the labview file to me easy   understand
 
many thanks,
 
i am using Labview 7.0
0 Kudos
Message 7 of 20
(9,367 Views)


@shidi5579 wrote:
 i am just beginning to build a vector from mathematical equation between 2 wave.
i 've got similar problem combine 2 X and Y axis wave for machining purposes and convert into vector, but i am not very clear what coastama explain,can you give to me the labview file to me easy   understand

If I read your description right, your problem is very different. You added to a 4 year old thread that deals with interpolation of a complex 1D array.

Can you be a bit more specific what you mean by an "axis wave" and what you mean by "vector". Maybe attach a simple example. So far it is not clear what you mean.

Message 8 of 20
(9,363 Views)
Hi expert...
 
Actually, i am trying to build a system with 2 waves act on different axis, X and Y simultaneously. the result of two waves which present in vector that fullfil to vector law which V= (asin2*pi*f*t)i + asin2*)+ (asin2*pi*f*t)j. where X=(asin*2*pi*f*t)i + 0j, Y=0i + (asin2*pi*f*t).
and from the vector i have a lot of equations for make the system fully optimize.
This is some piece of  the part from my system to explain the situation.maybe some of tool is not correct.( modified draft)
Hope u  can give some advise and some suggestion..
 
thanks..
0 Kudos
Message 9 of 20
(9,346 Views)
Hi, Altenbach,
 
is there any advise from you..?
many thanks
0 Kudos
Message 10 of 20
(9,300 Views)