IHow do you loose resolution?
Since RMS is equivalent to DC average, any DC error in your measurement reduces the accuracy of the RMS result. So it is biased for symmetrical full swing and subtracted for necessity.Sir ,
I asked so ,The DC offset reduce ADC reresolution
forunderstanding my problem i am giving an example
my adc resoultion is 4096
my offset dc volt (resistor bias dividing ) is 1.25 volt
my microcontroller maximum input volt is 3.3volt
// ... (rest of the setup code)
// Calculate and remove DC offset and calculate RMS
float calculateAdjustedRMS(int* samples, int num_samples) {
float sum = 0;
float offset = 0;
// Calculate DC offset
for (int i = 0; i < num_samples; i++) {
offset += samples[i];
}
offset /= num_samples;
// Adjust samples and calculate RMS
for (int i = 0; i < num_samples; i++) {
float adjustedSample = (float)samples[i] - offset; // Adjust for DC offset
sum += adjustedSample * adjustedSample;
}
float mean = sum / num_samples;
return sqrt(mean);
}
// ... (rest of the code to get samples)
float rms_value = calculateAdjustedRMS(adc_values, NUM_SAMPLES);
The sinewave of 50Hz One Half cycle is 10 millisecond I plan to take 200 samples per Half cycle .
Before saving the 200 samples I want to know the Zerocrossing ,to understand that , the coming half cycle is positive or Negative ?
SirHi,
if your both frequencies are quite accurate, then there is no need to know zero crossing.
I usually do a full wave, so process 400 samples. (according your sampling rate)
Klaus
The RMS for any signal is always > zero.Sir did you mean the both Half cycles ,
if so , then the total output would be zero ?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?