Author Topic: Smooth measurement value  (Read 960 times)

0 Members and 1 Guest are viewing this topic.

Offline 97hilfel

  • Regular Contributor
  • *
  • Posts: 60
  • Country: it
Smooth measurement value
« on: December 26, 2016, 06:02:46 pm »
Hello everybody,
I try to measure the speed of a 4-Pin PWM fan with a arduino, so far my values are correct and have a precision from about .3-.5Hz compared with my Tektronix TDS2014 (probably no the dugs guts). Now the problem: my values are kind a jumpy and I already tried a few things but I always cant finish the taught and end up with a "meh"-solution which does not what she should do. Does somebody of you have a little idea in his box how I can smooth the calue? I get an update of the last value about every 100ms-500ms a little depending on my settings of the system.
Have a nice evening Felix
EDIT: Complete rewriting
« Last Edit: December 26, 2016, 06:55:16 pm by 97hilfel »

Offline tautech

  • Super Contributor
  • ***
  • Posts: 16012
  • Country: nz
  • Taupaki Technologies Ltd. NZ Siglent Distributor
    • Taupaki Technologies Ltd.
Re: Smooth measurement value
« Reply #1 on: December 26, 2016, 08:03:22 pm »
At slow timebase settings your Tek is probably in "Roll" mode, hence the periodic screen updates.

If you want to have a stationary waveform you're probably better to set up for a "Single shot" event and/or use a Trigger setting for say a pulse period. Hunt through the Trigger menu to see what options you have.
Avid Rabid Hobbyist

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 1614
  • Country: au
Re: Smooth measurement value
« Reply #2 on: December 26, 2016, 09:27:37 pm »
(probably no the dugs guts)
You mean "the duck's guts".
This is a technical forum.
We are engineers.
Our statements must be correct.
The following users thanked this post: 97hilfel

Offline evb149

  • Super Contributor
  • ***
  • Posts: 1666
  • Country: us
Re: Smooth measurement value
« Reply #3 on: December 26, 2016, 09:40:15 pm »
What you're looking for is an averaging or low pass filtering solution or the means of calculating statistics of a signal.

In statistics you commonly have noisy data and you want to find out what the meaningful tendencies and patterns are in the data regardless of the noise.
The statistical mean or average is : mean = (value1 + value2 + value3 + ... valueN) / N
where N is the total number of samples collected in a particular measurement set.  The mean (or common "average") shows a result that is meaningful when the data points tend to cluster noisily around some central value.

The statistical median is the middle value among a discrete set of values when those values are sorted.

The statistical mode is the most common value among the values

Signal filtering applies a mathematical convolution of a filter transfer function with the signal samples to accentuate some of the frequency components in the original signal and to attenuate others.  So a low pass filter passes mostly lower frequencies while cutting mostly higher frequencies.  Low pass filters are good for noise reduction.  Inversely, high pass filters pass high frequencies with little attenuation but block low frequencies.  Band pass filters pass a certain range frequencies about a center frequency  while rejecting others, you could imagine a filter that passed only a certain musical note frequency but blocked others.
In technical terms two common types of signal filters are called FIR (finite impulse response) and IIR (infilite impulse response).

Here is information about FIR filters:

Here is an example of using IIR filters:

A simple FIR filter is the moving average FIR filter that calculates the arithmetic average of the last N data points to yield the result at a given point.  It is probably a good thing to consider for your needs with N being perhaps from 4 or more of the last samples.
The following users thanked this post: 97hilfel

Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo