05-08-2018 10:02 AM
Hello,
exists a solution to decimate an Array of waveforms with the aggregat functions MIN, MAX or Mean?
I found Decimate (continuous) VI, but this can I use only for one waveform.
And it has only the integrated aggregat functions
"Decimate (continuous) .vi" handle correct the case: Input size of Input Array < as decimation factor.
Than the output array is empty until the decimation factor is reached.
Peter
Solved! Go to Solution.
05-08-2018 10:36 AM
Hi Peter,
exists a solution to decimate an Array of waveforms with the aggregat functions MIN, MAX or Mean?
When you know the algorithm you want to implement you can easily implement it…
So the answer is: as soon as you write such a VI!
I found Decimate (continuous) VI, but this can I use only for one waveform.
Use an autoindexing loop. Basic LabVIEW stuff…
Than the output array is empty until the decimation factor is reached.
What else do you expect for this corner case?
05-08-2018 11:12 AM
Hi GerdW,
before I reinvent the wheel I ask. Possible there is a libraray.
From your comment I assume, you dont know such library..
And try:
@GerdWI found Decimate (continuous) VI, but this can I use only for one waveform.
Use an autoindexing loop. Basic LabVIEW stuff…
You will fail, because of the shift register inside Decimate (continuous) .vi. Then you will mix the history of the n channels of the waveforms. Inside of the while loop a for loop is needed similar vi.lib\measure\macond.llb\Implement IIR Cascade Filter for N Chan.vi. But I can not use DecimateContinuous_H in lvanlys.dll. It returns only the mean.
But why you write so aggressive?
If I have no answer, I don't write anything.
I have no problem, if the question did no get an answer. Then I build my solution and can post it.
Cheers,
Peter
05-08-2018 01:27 PM - edited 05-08-2018 01:35 PM
Hi Peter,
But why you write so aggressive?
Where have I been "aggressive"? I wasn't and I didn't intended to…
If I have no answer, I don't write anything.
I had an answer: Because you wanted to implement a very specific behaviour, which is not covered in the generic tools coming with LabVIEW, I suggested to implement your own VI.
Then you will mix the history of the n channels of the waveforms.
Using all inputs of the Decimate function you will not mix any waveforms:
(Just for "proof of concept", the dt of the decimated waveforms is wrong and needs to be corrected.)
05-08-2018 04:49 PM
Hi GerdW,
you can not set the reset control to true. See help:
reset? controls the initialization of the internal states. The default is FALSE. The first time this VI runs or when reset? is TRUE, LabVIEW initializes the internal states to zero. When reset? is FALSE, LabVIEW initializes the internal states to the final states from the previous call to this instance of this VI. To process a large data sequence consisting of smaller blocks, set this control to TRUE for the first block and to FALSE for continuous filtering of all remaining blocks.
And that is the reason it can handle correct the case: Input size of Input Array < decimation factor.
This vi has only one internal state. You can not use it in a loop for different channels. You will mix the internal states of the channels.
Look inside vi.lib\measure\macond.llb\Implement IIR Cascade Filter for N Chan.vi (called by "digital iir filter for n chan") how to keep states for n channels: The shift registers must hold arrays for the n channels.
Peter
05-09-2018 12:43 AM
Hi Peter,
you can not set the reset control to true. … You can not use it in a loop for different channels. You will mix the internal states of the channels..
I can and I did…
In the snippet above those three waveforms in the array are decimated without influencing each other!
Proof:
But again to summarize this thread: as you want to use some different kind of decimation (like min, max) you need to implement your own VI. As you seem to have an additional requirement to handle arrays of waveforms as well you can implement this too.
05-09-2018 04:12 AM
Hi GerdW,
Your example is only 'single shot'. Then you can also use "Decimate (single shot) VI".
It will not work correct to decimate waveform arrays in a continuous loop. One exception: The decimation factor is a integer divider of the Y-Array Size. Then no history is needed.
Best regards,
Peter
05-09-2018 04:19 AM
05-09-2018 05:48 AM
The solution is:
Sample Compression Express VI
Owning Palette: Signal Manipulation Express VIs
Acquires a large number of data points and compresses the data points into a smaller number of points.
Reduction Methods Contains the following options:
Minimum—Reduces the Signals input by using the lowest value in each segment.
Maximum—Reduces the Signals input by using the highest value in each segment.
Last—Reduces the Signals input by using the last point in each segment.
Mean—Reduces the Signals input by using the mean value of the points in each segment.
Median—Reduces the Signals input by using the median value of the points in each segment.
Only the reduction size is no frontpanel control, so the front panel of the Express vi must opened to convert it to a standard vi.
It is a little ugly that NI use different terminologies: Decimation and Sample Compression.