LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to interpolate one signal to fit sample rate of another signal

 

Hi all!

 

 

I have two signals. One is original with about 10k samples, duration - 1s. 

 

The second - is a demodulated signal almost the same as original but with about 200-500 samples.

 

To be able to compare two signals I should have samples for both signals at the same time. 

 

 Then I need to substract one signal from other to get deviation and calculate error.

 

 

 

 

 How can I interpolate second signal to get samples at the sime time that first signal has ?

 

Thanks in advance 

 

0 Kudos
Message 1 of 13
(4,716 Views)

I would say by doing what you ask: Interpolate using the interpolate function in the array category.

 

Herbert

0 Kudos
Message 2 of 13
(4,698 Views)

Herbert wrote:

I would say by doing what you ask: Interpolate using the interpolate function in the array category.

 

Herbert


 

The most used way of doing it I think you will find here http://en.wikipedia.org/wiki/Upsampling. But I think the interpolate idea is good to. If you need to insert more than one sample use the ramp pattern

I made something quick and dirty. Test it and see if you can use it. You have to do something about the missing samples at the end.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 3 of 13
(4,691 Views)

 

Thanks, but I don't undestand what your example does.

It seems not what I wanted, as the timing of signals should remain unchanged - 1 second. Only increased number of samples
0 Kudos
Message 4 of 13
(4,686 Views)
I need something like in attached VI. But the problem left is - I can't determine where I lose the last value in array so I get incorrect graph for "Interpolated Signal 2"
0 Kudos
Message 5 of 13
(4,678 Views)
I am not sure I follow your dataflow now. If I sample a 10Hz sinus for 1 second with 200Hz I get 200 samples. If I sample the same sinus with 1KHz i get 1K samples. The FFT shows that the frequency is preserved during upsampling.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 6 of 13
(4,665 Views)
What does "Samples" control do in your code?
0 Kudos
Message 7 of 13
(4,658 Views)
0 Kudos
Message 8 of 13
(4,653 Views)

 

Yes, and after that I get array of 990 elements not 1000. Which means Align & Resample functions does something wrong. Please see attached VI.

 

 

 Why after linear interpolation, when I compare signals -  I get continuously increasing deviation between two signals ? 😞

 

 

 

 

 

Message Edited by ACiDuser on 05-23-2009 01:54 PM
0 Kudos
Message 9 of 13
(4,650 Views)
It see it seems to be working, but I don't want to waste 6 hours of work. Maybe anyone see what I might did incorrect in changing signal sampling rate?
0 Kudos
Message 10 of 13
(4,630 Views)