# Sum Over Multiple Acquisitions

**Sum Over Multiple Acquisitions**, a forum discussion on Cleverscope Mixed Signal USB Oscilloscopes. Join us for more discussions on

*Sum Over Multiple Acquisitions*on our Questions forum.

Back to Forum Index : Back to Questions |

**emells99**

19 Mar 2022

Posts: 2

Hello, Cleverscope rookie question:

I am trying to sum over the signal from multiple acquistions. How it works is I have a square wave on channel A and a signal on channel B made of a sequence of pulses (~10ns long) from a photon detector.

What I want to do is take the signals from Channel B during each square wave low period and sum them together, that way any pulses that occur at the same time after the square wave turns off appear as larger pulses, times when no pulses ever occur remains zero, etc. I can easily eliminate the square wave high periods with an if statement, but the summing I'm having trouble with, since I want to sum chunks of time as opposed to constantly summing as time passes. Since there are very few signals per acquisition, this requires summing over a few thousand periods to view the overall pattern.

I am sure this is possible, but I'm having trouble figuring out how. Any advice would be appreciated.

Thanks

I am trying to sum over the signal from multiple acquistions. How it works is I have a square wave on channel A and a signal on channel B made of a sequence of pulses (~10ns long) from a photon detector.

What I want to do is take the signals from Channel B during each square wave low period and sum them together, that way any pulses that occur at the same time after the square wave turns off appear as larger pulses, times when no pulses ever occur remains zero, etc. I can easily eliminate the square wave high periods with an if statement, but the summing I'm having trouble with, since I want to sum chunks of time as opposed to constantly summing as time passes. Since there are very few signals per acquisition, this requires summing over a few thousand periods to view the overall pattern.

I am sure this is possible, but I'm having trouble figuring out how. Any advice would be appreciated.

Thanks

**bartschroder**

19 Mar 2022

Posts: 471

Hello,

Yes you can do this, using Maths, and channels C and D which are maintained between captures.

The simplest maths equation I can come up with is:

gtz(a-0.5)*b+c -> c

c -> b

This will multiply b with 1 if a is >0.5V, and 0 if not, then add to the equivalent position in c and save back to c. Then send it to b for visualization (in the old app). In the new app you don't need to do this as you can display c directly.

You will need to be able to reset C back to 0. You could do this using a digital input or the external trigger, like this:

i1*c ->c

If i1 is high, then c is left as it is. If i1 is low, then c is reset.

Or just have a line you enable once:

0 -> c

I hope this helps.

Bart

Yes you can do this, using Maths, and channels C and D which are maintained between captures.

The simplest maths equation I can come up with is:

gtz(a-0.5)*b+c -> c

c -> b

This will multiply b with 1 if a is >0.5V, and 0 if not, then add to the equivalent position in c and save back to c. Then send it to b for visualization (in the old app). In the new app you don't need to do this as you can display c directly.

You will need to be able to reset C back to 0. You could do this using a digital input or the external trigger, like this:

i1*c ->c

If i1 is high, then c is left as it is. If i1 is low, then c is reset.

Or just have a line you enable once:

0 -> c

I hope this helps.

Bart

Back to Forum Index : Back to Questions |