Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Calculating RMS value

Status
Not open for further replies.

Maverickmax

Advanced Member level 1
Joined
Dec 6, 2004
Messages
404
Helped
8
Reputation
16
Reaction score
3
Trophy points
1,298
Activity points
3,689
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
 

It could be 1000 points if you accept that the sine wave is ideal. In that case, you only need to calculate one half cycle.

Cheers,
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top