imranahmed
Advanced Member level 3
- Joined
- Dec 4, 2011
- Messages
- 822
- Helped
- 3
- Reputation
- 6
- Reaction score
- 3
- Trophy points
- 1,298
- Location
- Karachi,Pakistan
- Activity points
- 6,533
1)one way is to sample a lot of data (2^n) and perform an FFT.
2)find the fundamental frequency. calculate it´s amgnitude.
3) Then find all harmonics (overtones) to the fundamental frequency (upto the upper specified frequency), and add them up.
4)Now divide (sum of harmonics) / fundamental to get THD.
Sampling data means to covert analog values to digital values. You need a very stable sampling frequency depending on your needs (questions above). Perfom an FFT means to process the digital data with software. FFT is the short for fast fourier transform, this is a mathematical calculation to get the frequencis and their amplitudes of an input (analog) signal.Please clarify point 1 and 2?
Your questions
1)If your ucontroller has no ADC, then you need an external one.
Resolution and sampling speed depemd on your needs.
2)Harmonics up to what frequency are you interested in?
3)What precision and what resolution do you need?
4)How stable and accurate is you 50Hz? Please specify.
5)Do you need the sum of harmonics or every harmonic independently?
6)How often do you want to calculate?
7)What do you want to do with the result(s)?
8)Display as decimal number, in dB? Print out? Transmit to a PC? Graphical display?
9)Save to memory?
"Find the fundamental frequency" is -at least - partly answered by yourself.
As questioned above it is important to know its variation.
50Hz from mains is fairly stable, but from a small generator engine with varying load it is quite unstable.
50Hz from a DDS is high quality...
10)Pleas tell us more about your project.
2)50 to 60Hz.
How to measure max.frequency of harmonics?
By this, THD = No.of Harmonics/fundamental frequency.
How to measure max.frequency of harmonics?
Dear KlausST,
Can I measure harmonics by using formaulas below in microcontroller.
1) v(t)=A + 1/3Sin(3wt) + 1/5Sin(5wt) + 1/7Sin(7wt).
and
2) V = 4*(Vrms)/n*pi.
Please define more about above.
If you choose 100ms and 256 samples then you will take 25.6 sec for collecting the signal to calculate for one time.I'd choose 100ms sample time with 256 samples = 2560 Hz sample frequency.
If you choose 100ms and 256 samples then you will take 25.6 sec for collecting the signal to calculate for one time.
Can I measure harmonics by using formaulas below in microcontroller.
1) v(t)=A + 1/3Sin(3wt) + 1/5Sin(5wt) + 1/7Sin(7wt).
Can I measure harmonics by using formaulas below in microcontroller.
1) v(t)=A + 1/3Sin(3wt) + 1/5Sin(5wt) + 1/7Sin(7wt).
I don´t think it is possible this way. Your formula is the fourier series of a square wave.
If you have a sqaure wave then you don´t need to calculate THD, it is fix.
Did you mean without FFT ? It is not possible.Can I measure harmonics by using formaulas below in microcontroller.
1) v(t)=A + 1/3Sin(3wt) + 1/5Sin(5wt) + 1/7Sin(7wt).
v(t)=X + X1 Sin(wt) + X2 Sin(2wt) + X3 Sin(3wt) + . + . . .
FFT_out[0] = DC comp
FFT_out[1] = Amplitude of 25 Hz component
FFT_out[2] = Amplitude of 50 Hz component
FFT_out[3] = Amplitude of 75 Hz component
FFT_out[2] = Amplitude of 100 Hz component
That's literally wrong. FFT is fast fourier transform, a specific form of fourier analysis. To determine the harmonics of a signal, any kind of harmonic analysis can be used, not only FFT-Did you mean without FFT ? It is not possible.
That's literally wrong.
But what is the formula for sine wave?
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?