Author Topic: Why is the average trace (math) of my signal different to the actual signal?  (Read 1061 times)

0 Members and 1 Guest are viewing this topic.

Offline eTobeyTopic starter

  • Super Contributor
  • ***
  • Posts: 1152
  • Country: de
  • Virtual Features for the SDS800XHD -> My website
    • Virtual feature script
Hi,

i played around with my scope and i found something that looks rather strange to me:
I would have expected, that the average of the signal would perfectly fit into the actual signal, but it doesnt. I used persistence in combination with dot mode display.

What am i missing?

Red trace: trigger signal
Yellow trace: actual Signal
Orange trace: math average of yellow signal

Its a SDS800X HD.
« Last Edit: December 29, 2024, 05:10:31 pm by eTobey »
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
My current top list of issues on the SDS800X HD:
https://www.eevblog.com/forum/testgear/sds800x-hd-bug-reports-firmware/msg5766323/#msg5766323
 

Offline inse

  • Frequent Contributor
  • **
  • Posts: 981
  • Country: de
What is the average function doing exactly on you scope?
The average I know from e.g. Lecroy and Rigol is doing an average of selectable subsequent trigger events thus reducing random noise.
If the signal is not stable, it gives an erroneous waveform.
Then there is a filter function which is in principle a configurable low pass (introducing a phase shift like a real filter).
Tektronix has a high-res mode that averages between the individual samples.
Edit: damn, missed the 10pts resolution…
Does this only apply to the math function?
The yellow trace seems to consist of a lot more samples
« Last Edit: December 29, 2024, 04:46:09 pm by inse »
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2138
Your timebase claims to be 200ns - 5 MSamples/s - that's one sample point per division. Clearly there is some interpolation happening - probably a sinc function on channel 1.

 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1410
  • Country: de
i played around with my scope and i found something that looks rather strange to me:
I would have expected, that the average of the signal would perfectly fit into the actual signal, but it doesnt. I used perstistence in combination with dot mode display.

At only 5MSa/s, the displayed shape relies heavily on trigger point interpolation.
Try the same with a significantly higher sample rate, say 50MSa/s or more.

EDIT:

Your timebase claims to be 200ns - 5 MSamples/s - that's one sample point per division. Clearly there is some interpolation happening - probably a sinc function on channel 1.

Seems you were faster  ;)

EDIT:

In dots mode, only the horizontal trigger point position is interpolated between adjacent samples, and the dots of the traces are plotted at their interpolated horizontal positions (i.e. each plotted trace has an individual horizontal offset in the range -100...+100ns from the 200ns grid). Due to persistence, the dots of subsequent traces accumulate on the screen, similar to ETS sampling.

I wonder, however, how trigger point interpolation and averaging work together, since averaging requires that the dots of the averaged traces lie on a common horizontal grid. If the fractional sample positions are simply ignored in the averaging, then statistically the averaging does indeed have a low-pass effect, which could explain the orange vs. yellow curve.
« Last Edit: December 29, 2024, 05:18:42 pm by gf »
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 2160
  • Country: is
The more rounded shape indicates bandwidth limiting or most likely rounded interpolation of fewer sample points.
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Offline eTobeyTopic starter

  • Super Contributor
  • ***
  • Posts: 1152
  • Country: de
  • Virtual Features for the SDS800XHD -> My website
    • Virtual feature script
What is the average function doing exactly on you scope?
It creates an average of multiple captures.
Manual says:
Quote
Average -- By averaging the channel waveforms sampled multiple times, random noise on the input
signal is reduced. The higher the average number, the smaller the random noise

If the signal is not stable, it gives an erroneous waveform.
Signal is stable, as can be seen on the picture. (persistence mode)

Does this only apply to the math function?
What exactly?

The yellow trace seems to consist of a lot more samples
Its persistence mode.
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
My current top list of issues on the SDS800X HD:
https://www.eevblog.com/forum/testgear/sds800x-hd-bug-reports-firmware/msg5766323/#msg5766323
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 2160
  • Country: is
That yellow trace looks FAR to clean for persistance mode! Look at where you are triggering from. There should be enough 'bobble' around that trigger point to cause the yellow trace to become 'fat', almost like a C.R.T. scope looking slightly out of focus. I don't really know your scope but in almost every instance of using persistance mode on our lab scopes the trace tends to 'grow'. On that slopie sloopy trigger point it will never trigger at exactly the same point on the waveform therefore in persistance mode the trace will bloom. Are you in the constant run mode or was that scope shot from a 'single sweep' event? I have simply never seen traces that narrow and clean with persistance turned on.
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1410
  • Country: de
It's persistance in conjunction with "dots" mode. For each trace, only 10 sparse points are plotted, and persistance accumulates the points of many traces, similar to ETS.
« Last Edit: December 29, 2024, 05:41:23 pm by gf »
 

Offline eTobeyTopic starter

  • Super Contributor
  • ***
  • Posts: 1152
  • Country: de
  • Virtual Features for the SDS800XHD -> My website
    • Virtual feature script
I looked at the average trace, it is indeed a interpolated trace (removed persistence and looked at the math trace). This really surprises me, as i have not set interpolation for THIS VERY reason.  :palm:

BUT, even with dot-mode it looks wrong, but i think, i have the explanation:
The sample points (of the average memory) are moving horizontically, with the old value from the former position. Thus taking values of the signal that are 1 sample points apart.

I should stop playing around at edge cases.  ::) Its interesting though.  ;D

I hope i did not fool/annoy you guys to much with this edge case.
« Last Edit: December 29, 2024, 06:00:13 pm by eTobey »
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
My current top list of issues on the SDS800X HD:
https://www.eevblog.com/forum/testgear/sds800x-hd-bug-reports-firmware/msg5766323/#msg5766323
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1410
  • Country: de
I looked at the average trace, it is indeed a interpolated trace (removed persistence and looked at the math trace). This really surprises me, as i have not set interpolation for THIS VERY reason.  :palm:

BUT, even with dot-mode it looks wrong, but i think, i have the explanation:
The sample points (of the average memory) are moving horizontically, with the old value from the former position. Thus taking values of the signal that are 1 sample points apart.

Let's assume that Average(C1) calculates Average(Interpolate(C1)) under the hood, which is indeed a possible solution to the problem of averaging traces with individual horizontal offsets. Then you still have the problem that the signal shown by the yellow trace is IMO undersampled and therefore not eligible for interpolation. You still need a higher sampling rate.
« Last Edit: December 29, 2024, 07:23:50 pm by gf »
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 4120
  • Country: 00
I would have expected, that the average of the signal would perfectly fit into the actual signal, but it doesnt.

Could you explain, how average signal can perfectly fit with actual signal?


Average function is a kind of low pass filter, the output of low pass filter is not the same as input.

« Last Edit: December 30, 2024, 03:45:20 pm by radiolistener »
 

Offline eTobeyTopic starter

  • Super Contributor
  • ***
  • Posts: 1152
  • Country: de
  • Virtual Features for the SDS800XHD -> My website
    • Virtual feature script
Could you explain, how average signal can perfectly fit with actual signal?

It is that very function of the scope to remove noise / fluctuations. It theoretically would work with just one sample point. Cant explain it really...
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
My current top list of issues on the SDS800X HD:
https://www.eevblog.com/forum/testgear/sds800x-hd-bug-reports-firmware/msg5766323/#msg5766323
 

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1658
Hi,

i played around with my scope and i found something that looks rather strange to me:
I would have expected, that the average of the signal would perfectly fit into the actual signal, but it doesnt. I used persistence in combination with dot mode display.

What am i missing?

Red trace: trigger signal
Yellow trace: actual Signal
Orange trace: math average of yellow signal

Its a SDS800X HD.

Hello,

Averaging requires a time period or number of samples that forms the "window".  If the window is wide you get a smoother trace, if the window is narrow you get a rougher trace.  If the window was 5 samples, then every 5 samples would be averaged and that would be the value there, and that would be similar to a low pass filter function.  If the window was only 1 sample wide (never happens though) the average would be the very same waveform as the signal itself.

The math behind it is: The integral of the time function with time 't' over a time period 'Tp' (then divided by Tp).  The period Tp defines the time the average would be accumulated.
Going by samples if we had sample values 2,2,2,6 and the window was 3 samples, the first average point would be (2+2+2)/3=2, and the second average point would be (2+2+6)/3=3.33, and since we don't have any more samples yet that's as far as we can go unless we average the last two.

Your orange trace indicates that the window is wide enough to 'see' the rising part of the signal long before it even happens, so we see the orange trace rise before the yellow trace.  When we get nearer to the higher values of the signal, the lower parts of the signal are still being averaged into the mix so we see a lower trace there.  On the right side of the signal bump we see the signal go lower than the average, and that is because the higher parts of the signal are still in the sum so the average can not go low right away.

So there's a sort of delay and some smoothing.  That's almost always the case.  In fact, you can create a digital low pass filter in the same way: by creating a moving average routine in code:
sum=0
START REPEAT:
v=signal
sum=(sum*2+v)/3
END REPEAT
In the above 'v' measures the signal at one point, then the sum sums the weighted sum plus the new sample 'v'.  The code then repeats indefinitely or until the wave stops.  The weight in the above is '2' and that means the previous sum is doubled and when 'v' is added to it, we have a total of 3 samples so we divide by 3.  That's a running average, but it's also a digital low pass filter.
The larger we make the weight (that '2') the smoother the average wave becomes.  If we made it 19 for example, then we would divide by 20, and that would produce a much smoother wave than using the weight of '2':
sum=(sum*19+v)/20
That's the simplest form of an actual first order digital low pass filter.
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1707
  • Country: ua
Could you explain, how average signal can perfectly fit with actual signal?
This will happen when the input (and digitized) signal is ideal: no jitter and every sampled point after the trigger event is exactly the same every time it triggers. Then the average value of every sample accumulated over a certain time will be equal to the respective sampled value of the live signal.

In real periodic signals sampled values will fluctuate due to noise, and using the average function allows to cancel out this (random, non-periodic) noise and see the perodic content. Sometimes this averaging is the only way to dig out very low-level signals from would otherwise look like only noise.

Average function is a kind of low pass filter, the output of low pass filter is not the same as input.
Not in this situation. We're talking about averaging values across the Y axis (voltage), not X (timebase).
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1410
  • Country: de
Could you explain, how average signal can perfectly fit with actual signal?

[img]

Average function is a kind of low pass filter, the output of low pass filter is not the same as input.

What you describe is usually called HiRes or ERES functionality of a scope. It's either offered as a math function, or as an acquisition mode. Under the hood it's a lowpass filter which is applied to a single trace.

Trace averaging is different. It averages multiple traces (from multiple successive acquisitions) after aligning them horizontally at the trigger point. Ideally, in the absence of trigger jitter (i.e. when the traces are perfectly aligned), this is not expected to do any lowpass filtering. In the presence of trigger jitter, the traces are not perfectly aligned horizontally, and averaging the imperfectly aligned traces does have a lowpass effect, too.
 

Offline eTobeyTopic starter

  • Super Contributor
  • ***
  • Posts: 1152
  • Country: de
  • Virtual Features for the SDS800XHD -> My website
    • Virtual feature script
Trace averaging is different. It averages multiple traces (from multiple successive acquisitions) after aligning them horizontally at the trigger point. Ideally, in the absence of trigger jitter (i.e. when the traces are perfectly aligned), this is not expected to do any lowpass filtering. In the presence of trigger jitter, the traces are not perfectly aligned horizontally, and averaging the imperfectly aligned traces does have a lowpass effect, too.

Altouth i am a kind of scope noob, i have some pretty good understanding of ADC, so this is how i see it working:
The ADC and trigger system run in paralell. The ADC is in "free running mode", so sample points will never align at all. Exception: The signal has the right frequency.

I would like to mention again:
I looked at the average trace [in stop mode], it is indeed a interpolated trace (removed persistence and looked at the math trace). This really surprises me, as i have not set interpolation for THIS VERY reason.  :palm:

Its in fact two seperate things, that have the same result: Points having been connected by interpolation, and points that resample averaged values beeing drawn (persistence).

So i just did with persistence, what the scope would do anyway with just one capture, alltough i set it up, to not do it. Naughty little scope.  :rant:
« Last Edit: December 30, 2024, 09:02:00 pm by eTobey »
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
My current top list of issues on the SDS800X HD:
https://www.eevblog.com/forum/testgear/sds800x-hd-bug-reports-firmware/msg5766323/#msg5766323
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1410
  • Country: de
Did you try to do the same at a (say) 10x higher sample rate and check if the deviation between C1 and Average(C1) becomes smaller?
« Last Edit: December 30, 2024, 09:11:04 pm by gf »
 

Offline eTobeyTopic starter

  • Super Contributor
  • ***
  • Posts: 1152
  • Country: de
  • Virtual Features for the SDS800XHD -> My website
    • Virtual feature script
Did you try to do the same at a (say) 10x higher sample rate and check if the deviation between C1 and Average(C1) becomes smaller?
Yes, it became much smaller at 2x higher sample rate already .
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
My current top list of issues on the SDS800X HD:
https://www.eevblog.com/forum/testgear/sds800x-hd-bug-reports-firmware/msg5766323/#msg5766323
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1410
  • Country: de
The ADC and trigger system run in paralell.

You can think of them as if they would. But they are not really independent, because it is a "digital trigger" which is also calculated from ADC samples.
Many (most?) modern scopes no longer have dedicated trigger hardware (except for the external trigger input).

Nevertheless, the horizontal position of the trigger point is determined with higher resolution than one sampling interval of the acquisition sample rate:

a) via interpolation between samples
b) because the ADC always runs at full speed (1GSa/s or 2GSa/s), and so does the digital trigger engine
    [ any lower acquisition sample rate is down-sampled from the full ADC sample rate by the FPGA ]

This allows the dots mode, in conjunction with persistence, to successively build up the correct shape of periodic signals with sparse, unconnected dots, even if the signal was undersampled. That's similar to LeCroy's Random Interleaved Sampling (but without hardware TDC, just based on the digital trigger).
 
The following users thanked this post: eTobey

Offline BillyO

  • Super Contributor
  • ***
  • Posts: 1823
  • Country: ca
It's an average over a moving window.  It looks perfectly fine to me.
« Last Edit: December 31, 2024, 01:11:25 am by BillyO »
Bill  (Currently a Siglent fanboy)
--------------------------------------------------
 

Offline eTobeyTopic starter

  • Super Contributor
  • ***
  • Posts: 1152
  • Country: de
  • Virtual Features for the SDS800XHD -> My website
    • Virtual feature script
It's an average over a moving window.  It looks perfectly fine to me.

Why would it then not average, if i increase the sample rate? And where could i set up the width of the window?
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
My current top list of issues on the SDS800X HD:
https://www.eevblog.com/forum/testgear/sds800x-hd-bug-reports-firmware/msg5766323/#msg5766323
 

Offline eTobeyTopic starter

  • Super Contributor
  • ***
  • Posts: 1152
  • Country: de
  • Virtual Features for the SDS800XHD -> My website
    • Virtual feature script
The ADC and trigger system run in paralell.

You can think of them as if they would. But they are not really independent, because it is a "digital trigger" which is also calculated from ADC samples.
Many (most?) modern scopes no longer have dedicated trigger hardware (except for the external trigger input).

Nevertheless, the horizontal position of the trigger point is determined with higher resolution than one sampling interval of the acquisition sample rate:

a) via interpolation between samples
b) because the ADC always runs at full speed (1GSa/s or 2GSa/s), and so does the digital trigger engine
    [ any lower acquisition sample rate is down-sampled from the full ADC sample rate by the FPGA ]

This allows the dots mode, in conjunction with persistence, to successively build up the correct shape of periodic signals with sparse, unconnected dots, even if the signal was undersampled. That's similar to LeCroy's Random Interleaved Sampling (but without hardware TDC, just based on the digital trigger).

Some good information, that i just confirmed (by testing) to not have any flaws. My information is from a video 7 years old.  ;D

Interpolation is a great tool, that is also something that will come into play in my BLDC controller.
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
My current top list of issues on the SDS800X HD:
https://www.eevblog.com/forum/testgear/sds800x-hd-bug-reports-firmware/msg5766323/#msg5766323
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1410
  • Country: de
It's an average over a moving window.  It looks perfectly fine to me.

Trace averaging does not explicitly apply a moving average filter.
Still, a convolution can happen as (unwanted) side effect.
 

Offline gf

  • Super Contributor
  • ***
  • Posts: 1410
  • Country: de
...

Some good information, that i just confirmed (by testing) to not have any flaws.

Btw, this applies to Siglent scopes like yours (which you obviously consider so buggy that they are almost unusable). Don't expect that any other scope does the same.
« Last Edit: December 31, 2024, 07:45:43 am by gf »
 

Offline eTobeyTopic starter

  • Super Contributor
  • ***
  • Posts: 1152
  • Country: de
  • Virtual Features for the SDS800XHD -> My website
    • Virtual feature script
It's an average over a moving window.  It looks perfectly fine to me.

Trace averaging does not explicitly apply a moving average filter.
Still, a convolution can happen as (unwanted) side effect.
Isnt a moving window averaging all the values that were before a point? I believe in my case, its like the ERES defintion where adjacent points are averaged.
"Sometimes, after talking with a person, you want to pet a dog, wave at a monkey, and take off your hat to an elephant." (Maxim Gorki)
My current top list of issues on the SDS800X HD:
https://www.eevblog.com/forum/testgear/sds800x-hd-bug-reports-firmware/msg5766323/#msg5766323
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf