Open dimk1 opened 4 years ago
Am 16.05.2020 um 13:31 schrieb dimk1:
> [13:07:10:190] Major Peak: 183.070256
Since this is a DC current sensor (so mostly a steady signal with a few fluctuations), it's logical that the algorithm calculates the biggest magnitudes at 0Hz and 31.25Hz.
The 0Hz Amplitude is not related to a frequency, it's the signal offset. For a DC current signal this is the mean current, with the other amplitudes based on that offset.
However, what is the meaning of the Major Peak in that case? I would expect it would print the frequency where the biggest magnitude exists, that is 0Hz. Instead it prints "183.07" which seems to be close to the frequency of 187.5Hz, which corresponds to the biggest magnitude excluding 0Hz and 31.5Hz. So what is the meaning of this value?
The real major peak exists near 31.25Hz, it's a bug in the library that the first (non-zero) frequency amplitude is always ignored in the major peak determination.
The analog peak value is not normally represented in a single digital peak value. A frequency between the discrete frequency values is distributed to their neighbour values. Paint a smooth curve over the values and you'll find a peak higher than the listed digital values. So the real frequency and amplitude is computed from an interpolation around the most outstanding amplitudes. Again the library is not perfect in the interpolation of the true peak frequency and value.
DoDi
So, is it correct to ignore the first calculation @0Hz for the analysis and only keep the rest of the values? And how do you mean that the 0Hz amplitude is the mean current? It's value in the example above is 3331 and the current fluctuates around 92mA.
Am 16.05.2020 um 23:32 schrieb dimk1:
So, is it correct to ignore the first calculation @0Hz for the analysis and only keep the rest of the values?
Right, the first peak occurs around 31.25 Hz. This special case, with no valid value to the left, is not covered by the peak detection function.
And how do you mean that the 0Hz amplitude is the mean current? It's value in the example above is 3331 and the current fluctuates around 92mA.
You should know yourself how the measured values are related to the DC current - shunt resistance, amplification...
DoDi
Hi there,
I'm trying to use the library to sample real-time measurements from a DC current sensor. The piece of code responsible for that is the following:
samples are set to 64 and sampling frequency to 2000. Q1: is sampling frequency measured in Hz in this code? So in my example is it 2kHz? Q2: is my code correct for sampling the data from the in219 sensor? Q3: when I print out the results I get the following measurements:
> [13:07:10:063] Computed magnitudes:
> [13:07:10:190] Major Peak: 183.070256
Since this is a DC current sensor (so mostly a steady signal with a few fluctuations), it's logical that the algorithm calculates the biggest magnitudes at 0Hz and 31.25Hz. However, what is the meaning of the Major Peak in that case? I would expect it would print the frequency where the biggest magnitude exists, that is 0Hz. Instead it prints "183.07" which seems to be close to the frequency of 187.5Hz, which corresponds to the biggest magnitude excluding 0Hz and 31.5Hz. So what is the meaning of this value?