-
FlexPro
- Zoom sur FlexPro
- Fonctionnalités & Options
- Domaines d’application
- Tous les avantages
- Nouveau dans FlexPro 2021
- Testez FlexPro gratuitement
- FlexPro View OEM Freeware
- Conseils d’achat
- Login
- Langue
- +49 6894 929600
- infoweisang.com
- Google Maps
- Produits
- News
- Support
- Société
- Emplois
- Contact
- Login
- Langue
- +49 6894 929600
- infoweisang.com
- Google Maps
calculate the true RMS value
- This topic has 4 replies, 3 voices, and was last updated 5 years, 7 months ago by Bernhard Kantz.
-
AuthorPosts
-
February 20, 2013 at 3:27 pm #12801MAZOYER ThomasParticipant
Hello,
how can I calculate the “true” RMS value of a signal whose frequency varies ?
I try with the formula of the RMS “Mean(MySignal, MEAN_SQUARE + CALC_BLOCK, xx)”, but as the frequency varies, the CALC_BLOCK “xx” varies to !My problem is with the Block-by-block calculation, where One value is calculated per interval, which interval is not constant due to frequency.
In the example join, the interval lengh is more than 1000 points at the beginning, and around 50 points at the end so I can not calculate the RMS value by block.
February 20, 2013 at 3:27 pm #8459MAZOYER ThomasParticipantHello,
how can I calculate the “true” RMS value of a signal whose frequency varies ?
I try with the formula of the RMS “Mean(MySignal, MEAN_SQUARE + CALC_BLOCK, xx)”, but as the frequency varies, the CALC_BLOCK “xx” varies to !My problem is with the Block-by-block calculation, where One value is calculated per interval, which interval is not constant due to frequency.
In the example join, the interval lengh is more than 1000 points at the beginning, and around 50 points at the end so I can not calculate the RMS value by block.
February 21, 2013 at 9:13 am #9273Bernhard KantzParticipantThe RMS value is a mean value, for a good estimation it is sufficient to average over enough full periods of the signal.
To compute the RMS over single periods, one can use the FPScript function LevelCrossings() to determine the indices of upward zero crossings as boundaries in the signal to compute one RMS value per period.// indices of upward zero crossings (with 5 % hysteresis) Dim idx = LevelCrossings(IA, 0, 0.05 * Range(IA), EVENT_POSITIVE, EVENT_INDEX) // prepare output datasets in the desired length Dim rms_y = IA.Y[0L] # Shape(idx[1L,-1L]) Dim rms_x = IA.X[0L] # Shape(idx[1L,-1L]) Dim i_begin, i_end For Each Row i In idx[1L,-1L] Do // extract a full period i_begin = idx i_end = idx - 1L // use x (time) of the interval center rms_x = IA.X[(i_begin + i_end) / 2L] rms_y = Mean(IA[i_begin, i_end], MEAN_SQUARE) End Signal(rms_y, rms_x)
March 21, 2019 at 2:31 pm #21270Tho MAZParticipantHello,
does not work know with version 10.0.16. I have the following error :
“Wrong data structure in index operation.
When using an index with a range specification ‘[<from>,<to>]’ both arguments must be scalar values. ”
Could you please help me ?
April 9, 2019 at 1:42 pm #21272Bernhard KantzParticipantThe code seems above seems to be mangled, maybe in the transition to the new web site. The FPScript formula below should do the job.
//Recherche des index où le signal d'entrée passe à zéro (orientation positive) afin d'isoler les périodes du signal Dim PMax = Maximum(Acceleration) Dim Idx = LevelCrossings(Acceleration, 0.0, 0.05 * PMax, EVENT_POSITIVE, EVENT_INDEX) //Calcul des valeurs RMS //Code optimisé pour un calcul plus rapide //Ici on n'étend pas les variables time et rms dans la boucle for avec l'opérateur := //On définit au préalable la taille de time et rms et on les remplies dans la boucle For Dim N = NumberOfRows(idx) Dim rms = AdjustUnit(? # N-1, Acceleration) For k = 0 To N - 2 Do rms[k] = Mean(Acceleration[Idx[k], Idx[k+1]], MEAN_SQUARE) End Return Signal(rms, Acceleration.X[Idx])
-
AuthorPosts
- You must be logged in to reply to this topic.