DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform - Find Y value at specific time (X)

Hi,

This may sound like a noon question but here it goes:

I have two waveform signals sampled at different frequencies but with the same time duration. Therefore they vary in the number of rows (index).

Example:

Wf_1 - Sampled at 100Hz for 200 secs

Wf_2 - Sampled at 1600 Hz for 200 secs

 

Now I find a specific event in Wf_1 at say 10 secs, I want to find the corresponding value in Wf_2 @ approximately 10 secs.

 

Right now I am using index values but this is cumbersome and was looking for a more straight forward way to achieve this. Unfortunately, re sampling the waveforms results in data loss so that is not an option.

0 Kudos
Message 1 of 3
(1,473 Views)

Hello,

 

I would like to know what hardware you are using.

If represent data not by samples but convert them to time then the task should be solved.

__________________________________________
The best way to thank, is to give KUDOS
0 Kudos
Message 2 of 3
(1,380 Views)

Hi dmurthy,

 

The index approach is not elegant in the script code but has the advantage that you don't have to create a temporary channel in the Data Portal.  If you're willing to do that, then you can use the WfChnToChn() function ("Numeric Channel <==> Waveform Channels") to create the corresponding X channel, then use PNo() with that X channel and the time value you've determined from the other waveform channel.  I think if it were me, I'd stick with the index approach-- I'm not convinced the alternatives are any cleaner to look at in the script code.

 

You could also consider interpolating the low point density waveform channel onto the X values of the high point density waveform with the ChnMapLinCalc() function to gain row to row parity, and that should NOT lose any granularity.  Nothing else is coming to mind.

 

Brad Turpin

Principal Technical Support Engineer

NI

 

0 Kudos
Message 3 of 3
(1,350 Views)