Maverickmax
Advanced Member level 1
Hi
After scaling the incoming of AC signal, I tried to implement RMS calculation and I could not get what exactly I want to. As the RMS value keep oscillating but it should be constant.
Any pseudo code for calculating RMS value?
Any more suggestion?
Maverick Max
UPDATED.......
the forumla of Vrms would be square root ( (1/N)*SUM (V^2(i))
So I understand N is the number of sample
For example I configured my microcontroller to generate interrupt at 200uS in order to produce a nice sine wave of 50Hz. So how many N i should apply?
Maverick Max
Added after 2 hours 31 minutes:
After doing a littel research on internet, I am getting the big picture a bit more clear now.
Since 50Hz of sine wave is generated from my microcontroller, so I believe that my ADC sampling rate is approximately 10uS but I am not 100 percent sure. Let assume that it is 10us,
So 20e-3 (50Hz) divide by 10e-6 (100kHz) = 2000
So that mean I would need to implement 2000 point for number of sample?
Please advise me asap
Kind regards
Maverick Max
After scaling the incoming of AC signal, I tried to implement RMS calculation and I could not get what exactly I want to. As the RMS value keep oscillating but it should be constant.
Any pseudo code for calculating RMS value?
Any more suggestion?
Maverick Max
UPDATED.......
the forumla of Vrms would be square root ( (1/N)*SUM (V^2(i))
So I understand N is the number of sample
For example I configured my microcontroller to generate interrupt at 200uS in order to produce a nice sine wave of 50Hz. So how many N i should apply?
Maverick Max
Added after 2 hours 31 minutes:
After doing a littel research on internet, I am getting the big picture a bit more clear now.
Since 50Hz of sine wave is generated from my microcontroller, so I believe that my ADC sampling rate is approximately 10uS but I am not 100 percent sure. Let assume that it is 10us,
So 20e-3 (50Hz) divide by 10e-6 (100kHz) = 2000
So that mean I would need to implement 2000 point for number of sample?
Please advise me asap
Kind regards
Maverick Max