LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

linear interpolation

hello,
 
I would like to reduce the effective sampling frequency by linear interpolation from 5 kHz. How must I do ?
 
Thank you
0 Kudos
Message 1 of 11
(4,611 Views)

If I understood you correctly, you have data sampled at 5kHz, and you want to reduce the effective sampling frequnecy, say to 1 kHz (just to illustrate the point)

Assuming data are in an array,  there are  many options

1) pick points from the array at indices that are multiple of 5  (0, 5, 10, 15,....etc)

2) average every 5 points

3) use the median of every 5 points

4) use a weighted average of every 5 points ,

etc....

.

.

.

 

0 Kudos
Message 2 of 11
(4,602 Views)

Exactly, I have data sampled at 4kHz and I want to reduce at 3kHz.

Do you know what VI of labview do I use to do this. For example, what VI for mediane, for average ????

Thank you

0 Kudos
Message 3 of 11
(4,595 Views)
try the attached vi, it uses linear interpolation.   Simple and illustrates the point
0 Kudos
Message 4 of 11
(4,587 Views)
To use this VI, I must transform my signal in a array ????
 
But I have a small problem, I don't know how integrate the VI at my project.
 
Thank you
0 Kudos
Message 5 of 11
(4,584 Views)
How are you getting the data ?  When you collected the samples, they are read as an array, and you probably saved them in a file ?
 
What is the format of your data ?  at least you should be able to have LV read it as an array
 
 
0 Kudos
Message 6 of 11
(4,577 Views)
hello,
 
For the VI that you gave me, I put the VI in library user. But when I open the VI in an other VI, I haven't input or output. So, I can't connect it.
 
Thank you
0 Kudos
Message 7 of 11
(4,553 Views)
You need to connect the control inputs and output indicators to terminals
 
Right click on the vi icon.....slect the right pattern.
then, select the controls and indictors and connect them to terminals
 
If you are not aware of that, I suggest that you review some LV tutorials
0 Kudos
Message 8 of 11
(4,547 Views)

Dr. Imad

 

The VI you provided for the linear interpolation works well and very useful. I had a question though - Is there a way to increase the size of the new array to show all the numbers containing in that array. For example if the old sample rate is 1 and new sample rate is 2, and have 3 elements in the old array. The new array will show 3 elements only. (see attachement). 

 

Any help will be appreciated. Thanks. 

0 Kudos
Message 9 of 11
(3,794 Views)
0 Kudos
Message 10 of 11
(3,770 Views)