11-21-2012 12:53 PM
Hi everyone.
I'm a beginner on Labview. I would like to ask about my problem described below:
I'm making a waveform signal and I want have another signal which has delay time as 1 min (the amplitude not change). Then I want to compare the amplitude of the two signals at the same time. Actually, I only find how to make a signal by discrete values (array) but I dont know how to find an amplitude at a defined time.
Solved! Go to Solution.
11-21-2012 01:30 PM
I think what you are really wanting to do is compare the waveform's data points. Data point 1 at t and data point 2 at t+1minute. If you know the sampling rate, this isn't hard. If you are going be sample rate (samples/second, we'll call it S), then you want to compare indecies t and t+S*60. If you have dt instead (seconds/sample), then your indecies are t and t+60/dt.
11-21-2012 02:28 PM
Thanks crossrulz but what I'm confused here is about labview funtions.
I did a kind of example to show my problem as attached.
I tried to make a delay funtion by extracting t0 from 1 signal then plus 60 to form a new signal which delays 1min (which can be seen on the graph). However, when I subtract them, the values are always 0 (I know the problem here is that the Y values of the 2 signals do not change while I set up a delay function like that but I cannot handle it).
P/s: I just start labview like the way I did in matlab simulink
11-21-2012 02:29 PM
Sorry I forgot to attach the file
11-21-2012 11:28 PM - edited 11-21-2012 11:34 PM
Hi
it is expected to see the difference as 0, since you are comparing element 'i' of channel 1 with element 'i' of channel 2.
you are not comapring them as per their time instant.
so, instead of calculating the difference of the two Y arrays like that, you should do the following:
option 1: since the dt = 1 minute, you delete the first element of channel 1 Y array and then compare it with channel 2 Y array. (do not modify channel 2 Y array). then, you would be comparing Y elements which are at the same time instant.
option 2: use a For loop, with shift registers and compare the current value of channel 2 with previous iteration value of channel 1.
edit: try the attached code
11-22-2012 04:14 AM
Thank you so much Freelance_LV. It's really helpful for me.
Also I'd like to thank all of you for spending your time on my problem.