question about calculating true rms on non-linear signals - Page 1
Forum section: electronics / projects

author: Psi
author_rank: Super Contributor
timestamp: April 07, 2011, 11:32:18 am
content: I have a microcontrollers adc channel connected to a current sensor, however this sensors output voltage is not linear to current. This isn't so much of a problem as i have the formula to correct the response of the sensor and produce accurate current values.What i want to know is if i can sample and calculating the RMS value of the raw non-linear sensor output and then convert this rms value to rms current using the formula later on.Does anyone know if that will work?I know it will work if i use the formula first and then do the RMS calculations on the true current values but i want to know if it will work the other way around.

author: ziq8tsi
author_rank: Regular Contributor
timestamp: April 07, 2011, 05:31:30 pm
content: Quote from: Psi on April 07, 2011, 11:32:18 amNo, rms(f(x)) is not generally expressible as g(rms(x)) for any function g. If it was we could take f as sqrt, and then calculate rms in terms of the (absolute) mean.You might be able to save work by moving some linear parts of the function out of the rms, or by simplifying the function at the expense of some accuracy. But probably your best chance, if the function is slow, is a lookup table on the adc output values.

author: Psi
author_rank: Super Contributor
timestamp: April 08, 2011, 06:47:38 am
content: yeah, i suspected that might be the casethanks for your help

author: scrat
author_rank: Frequent Contributor
timestamp: April 11, 2011, 02:46:59 pm
content: If you know the formula, you could integrate and calculate its sqrt analytically, then apply the obtained formula on the MCU.

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 12, 2011, 12:10:23 pm
content: LMGTFY...RMS d' WIKI, check under the discrete section and formulation. its possible i think.

author: ziq8tsi
author_rank: Regular Contributor
timestamp: April 13, 2011, 09:26:29 am
content: Quote from: scrat on April 11, 2011, 02:46:59 pmI do not think that you have thought that through. You have certainly not explained how it might help.The thing you would need to integrate would be the square of the result of applying the transfer function to the discrete time series sample data. You can not helpfully analyse this before you know what the data are.The only case where the integral of the (square of the) transfer function alone could be useful is if the samples happened to form a straight line. But then they do not cover an entire period of the waveform, and the RMS value is of no significance.Quote from: Mechatrommer on April 12, 2011, 12:10:23 pmYou are just waving your arms.

author: scrat
author_rank: Frequent Contributor
timestamp: April 13, 2011, 10:11:39 am
content: Quote from: ziq8tsi on April 13, 2011, 09:26:29 amYou're right. I was thinking of finding the relationship between the two rms values in the form, but even for a simple polynomial function it isn't that simple, and involves at least the calculation of some other integrals (of the acquired values elevated to powers), which makes it, in the best case, useless.

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 13, 2011, 08:28:09 pm
content: Quote from: ziq8tsi on April 13, 2011, 09:26:29 amthat was helpfull