LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sychronize time in the waveform graph based on variable time interval DT in 1D array

Solved!
Go to solution

@GerdW wrote:

Hi Hk,

 


@Hk637 wrote:

However, the Original Current Waveform should end at 3200 sec where it is showing 350000.


Your "original current waveform" contains ~3.4M samples, this gives a time of ~341k seconds with a dt of 0.1. Simple math, right?

 

The "filtered current waveform" has 389 samples, they give a total of



1945s with a dt of 5 - as shown in the graph…

 

Your FOR loop to create an array of time values is pure Rube-Goldberg (and uses wrong math). See this suggestion:

Why do you subtract 1 from the loop iterator value?

Why do you need to apply the Abs() function? (Oh, I see: there is a large negative value at the end of the dt array! Where does that value come from? Is the calculation of that array wrong, too?)

 


-1 was to eliminate the negative value. This portion might be wrong. But it actually shows the result in correct position in y Axis. 

 

If I use your solution then the data series reverses 1 2 3 -- 3 2 1. 

 

At the beginning of the waveform, I have high sample rate and it decreases gradually. 

 

Although, the time in X- axis is not correct 

0 Kudos
Message 11 of 13
(95 Views)

@Hk637 wrote:

All the resampled data has same t0. 


I was talking about the datapoint in the original datasets before resampling. (each with its own t0,dt)

(are they aligned? consecutive? overlapping? etc.)

0 Kudos
Message 12 of 13
(79 Views)
Solution
Accepted by topic author Hk637

I already solved the problem by passing the original time and filtered time from the resampled data set. 

After doing resampling, the timing did not change. It just removed some data according to the filtering criteria. Hence, both the original and resampled time remained the same and they are shown in the X-Y graph. 

Thanks anyway. 

0 Kudos
Message 13 of 13
(18 Views)