LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

block average of 2D continuous signal

Hi Everyone

 

I need some help with block average of 2D continous signal (not the moving average). I am continously taking acquiring data from the DAQ at 100 Hz and I want to average every 10 samples and output the average to TDMS file. I was originally sending the data to TDMS file without any average. But now I want to average every 10 samples before I send it to the TDMS file. 

 

Any help would be appreciated.


Thanks

 

0 Kudos
Message 1 of 6
(3,189 Views)

Hi manny,

 

why don't you read your DAQ data with a block size of 10 and calc the average of each signal before writing the averaged data to a TDMS file?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,181 Views)

You mean using the sampling rate of 10Hz?

 

0 Kudos
Message 3 of 6
(3,172 Views)

Hi manny,

 

no, I mean reading 10 samples at a sample rate of 100Hz and averaging them before writing to a TDMS file…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(3,167 Views)

Hi GerdW,

 

I think you are referring to "number of samples per channel" in DAQmx read. I am already using 10 for that. But I still need to average more. 

I have attached the picture of what I tried, but I don't think its correct. 

Hopefully I am making myself clear.

 

Thanks

 

0 Kudos
Message 5 of 6
(3,162 Views)

Hi manny,

 

your image raises more questions than it answers!

 

But I still need to average more. 

Why?

 

Hopefully I am making myself clear.

Not at all…

 

 

- Why do you use this dreaded DDT (thick blue wires) and ExpressVIs in this VI?

- Why do you split to two signals when you seem to build up a 2D array with more than 2 columns before?

- Why do you check signal length equal to 10?

- Why do you bundle boolean wires to DDT to wire this DDT to a case selector?

- Did you recognize the coercion dot at the case selector? Do you know it's purpose (and side effects)?

- What happens in FALSE case?

- Why are there no comments in the code?

 

Please provide a description of what you try to solve with this VI!

Remove ALL "From DDT" and "Join Signal" nodes, delete ALL DDT wires in this VI.

Use simple IndexArray or BuildArray function when you want to handle array data!

Use simple boolean functions (maybe an AND or OR is needed here?) instead of f***ing up kill any algorithm with ExpressVIs!

 

All I suggested is this little snippet:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(3,128 Views)