01-16-2025 03:19 AM
@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
01-16-2025 10:19 AM - edited 01-16-2025 10:21 AM
@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.)
01-19-2025 10:43 AM
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.