Any Faster RMS Value Calculation in C?
问题 I am writing a software for a small 8-bit microcontroller in C. Part of the code is to read the ADC value of a current transformer (ZCT), and then calculate the RMS value. The current flowing through the ZCT is sinusoidal but it can be distorted. My code as follow: float adc_value, inst_current; float acc_load_current; // accumulator = (I1*I1 + I2*I2 + ... + In*In) double rms_current; // Calculate the real instantanous value from the ADC reading inst_current = (adc_value/1024)*2.5; // 10bit