Principal frequencies of a Waveform

AI Thread Summary
The discussion centers on identifying principal frequencies in a current waveform, with three frequencies identified at 52Hz, 246Hz, and 351Hz. Participants clarify that the principal frequency refers to the largest peak, which is 52Hz, while the others are distortion frequencies. The conversation also delves into calculating total harmonic distortion (THD), emphasizing the need to use the correct formula involving the sum of squares of the harmonics. There is confusion about the application of the THD formula and the interpretation of spectral data, with participants correcting each other's calculations. Ultimately, the thread highlights the complexity of waveform analysis and the importance of accurate data interpretation in electrical engineering.
his_tonyness
Messages
48
Reaction score
1

Homework Statement


Identify the principal frequencies in the current waveform

Homework Equations

The Attempt at a Solution


From the excel file, I have identified 3 principle frequencies at 52Hz, 246Hz and 351Hz. Is this correct? What does the term principle frequency actually mean?
 

Attachments

Physics news on Phys.org
It's "principal" frequency, not "principle".
Wouldn't you just guess that they're the three peaks on your spectrum drawing?
 
Thanks for your reply. How do I calculate total harmonic distrortion of that data using the attached equation. Since the vertical axis is in I^2, for I1 I have sqrt0.6617 * sqrt2 = 1.15A where 0.6617 is at 0Hz. I don't know what the nth harmonic is. the n(max) i assume is the n of the highest peak which is 3
 

Attachments

  • THD(I).png
    THD(I).png
    48.2 KB · Views: 919
I can't seem to reopen your original excel file. But you need to determine the principal frequency. Is it the first (largest) peak? Anyway, the principal frequency is not distortion so you need to follow your formula for THD with all peaks above the first. If the spectrum was really I^2 (which sounds suspicious) then you already have I^2 for the two higher peaks. If the spectrum is I though you need to take I^2 in the formula.
 
rude man said:
I can't seem to reopen your original excel file. But you need to determine the principal frequency. Is it the first (largest) peak? Anyway, the principal frequency is not distortion so you need to follow your formula for THD with all peaks above the first. If the spectrum was really I^2 (which sounds suspicious) then you already have I^2 for the two higher peaks. If the spectrum is I though you need to take I^2 in the formula.
upload_2015-5-13_19-38-59.png


This is the waveform, the largest peak is 15.8785 at 52Hz, then there is 8.77 at 246Hz and finally 6.25 at 351Hz. I think that these 3 frequencies are the principal frequencies.
I think I1^2 is 0.6617.
 

Attachments

I don't fully understand how to obtain the variables in the THD formula using my data.
 
I would interpret the waveform data as the principal frequency being 52 Hz and the distortion frequencies as 246 and 351 Hz. So you'd use the THD formula for the latter two frequencies. Notice the summation is from n=2 to however many "spur" frequencies there are, expressed as a fraction of n=1 or I1. I'd say the sum here is over n = 2 to 3.
The graph does display I^2 so use the y-axis numbers directly in the THD formula. So I1 = 16 A^2 etc.
 
1/16*sqrt(8.77+6.25(In))*100% is what I have so far. Am I on the right track? What is an nth harmonic?

My notes on this question state I1 is the r.m.s. value of the fundamental current, In the r.m.s
value of the nth harmonic and n(max) is the number of the highest measurable or significant harmonic.
 
his_tonyness said:
1/16*sqrt(8.77+6.25(In))*100% is what I have so far. Am I on the right track?
No, you are misusing the formula. You need the sum of squares, not the square of the sum. What's "In" doing in your formula?
{quote]
What is an nth harmonic?{/quote]
n = 2 or 3 for you.
My notes on this question state I1 is the r.m.s. value of the fundamental current, In the r.m.s
value of the nth harmonic and n(max) is the number of the highest measurable or significant harmonic.
That makes sense. Your fundamental (n=1) is 16 A2 and your harmonics are 8.77A2 and 6.25A2.
 
  • #10
Ok so; 1/16*(sqrt ((8.77+6.25)/2))*100%. Sum of squares is standard deviation isn't it? n=2 because there are just the 2 harmonics after the fundamental right?
 
  • #11
his_tonyness said:
Ok so; 1/16*(sqrt ((8.77+6.25)/2))*100%.
This is worse than last time. Why are you dividing by 2? And you're still not doing the square root of the sum of squares.
Sum of squares is standard deviation isn't it?
Can be but is irrelevant here. You're not doing standard deviations.
n=2 because there are just the 2 harmonics after the fundamental right?
Right.
 
  • #12
Ok sorry. RMS of 8.77= 8.77/sqrt2 = 6.2 , RMS of 6.25=6.25/sqrt2= 4.419 . Because it is I2 I am going to assume that numerators may need to be rooted too?

Going back to the equation; ((1/16*sqrt6.22) + (1/16*sqrt4.4192))*100
 
  • #13
his_tonyness said:
Ok sorry. RMS of 8.77= 8.77/sqrt2 = 6.2 , RMS of 6.25=6.25/sqrt2= 4.419 . Because it is I2 I am going to assume that numerators may need to be rooted too?

Going back to the equation; ((1/16*sqrt6.22) + (1/16*sqrt4.4192))*100
1/√16 is right but you are still getting the rest wrong.
There is only one square root to be taken. You have two. Also, sqrt(6.22) obviously = 6.2 etc.
 
  • #14
I1(16) is also rms(16/√2=11.313) so should that not be 1/11.313*(6.2+4.419)*100%=93.86 which is a lot of distortion. The equation is trickier than it looks.
 
  • #15
his_tonyness said:
I1(16) is also rms(16/√2=11.313) so should that not be 1/11.313*(6.2+4.419)*100%=93.86 which is a lot of distortion. The equation is trickier than it looks.
No. I1 = 16 A2 according to your spectral graph. It says "I2" on the y-axis but I believe it means "I2".
Since I12 = 16 A2, I1 = 4 A. Now sum the n=2 and n=3 I2 numbers, then take the square root, then divide by 4.
I agree though that distortion is very large!
 
  • #16
1/√16*√(6.2+4.419)*100%= 80.69%.
 
  • #17
his_tonyness said:
1/√16*√(6.2+4.419)*100%= 80.69%.
But your n=2 peak is at 8.77 A2 and the n=3 is at 6.25 A2 so why are you again taking rms of those two numbers? You didn't take the rms of 16, and rightly so!
 
  • #18
Recalculating I come up 96.89%. I thought the question identified In as the rms of those harmonics that's all.
 
  • #19
Do you know a good step by step method for sketching the original waveform from the 3 principal harmonics?
 
  • #20
his_tonyness said:
Do you know a good step by step method for sketching the original waveform from the 3 principal harmonics?
It depends on your signal.
If there is just a fundamental (n=1) and noise at two harmonics (n=2 and n=3) ("spot noise") then the spectrum is a delta function at each of those two frequencies f2 and f3. Take your example and assume there is no noise at any frequency except at the spot frequencies 246 and 351 Hz. Then your power spectrum (which is what a spectrum of I2 is) should show a delta function at each of those 3 frequencies and nothing inbetween. The tips of the delta functions would be at 16, 8.77 and 6.25 A2. A delta function for you is just a spike at f1, f2 or f3.

Formally, the power at each spot frequency fn, n=1, 2 or 3, is ∫-∞In2δ(f-fn)df. Then you rss the two noises with the fundamental as you did with your formula to get rss noise.

If noise is continuous you have to evaluate a different integral. All this is probably a bit advanced for you. I should mention that a trace like your spectrum is what you'll get from a spectrum analyzer even if there are only spot noise frequencies. It will show some noise at all frequencies due to the limitations of the instrument.
 
  • #21
his_tonyness said:
Recalculating I come up 96.89%. I thought the question identified In as the rms of those harmonics that's all.
Correct!
 
  • #22
I simulated on LT spice roughly to reconstruct the original waveform by adding the 3 harmonics on the same time axis (50ms)

http://forum.allaboutcircuits.com/attachments/213-gif.85824/
 
  • #23
Good. See the spikes on the spectrum I talked about?
BTW how exactly did you come by the spectrum you showed in post 5?
 
  • #24
I performed FFT on the sample data in excel file I was given, which the spreadsheet automatically calculated the frequency and I2 magnitude columns and the spectrum diagram in post 5. I can't figure out how to use Fourier synthesis to replicate the original waveform.
 
  • #25
his_tonyness said:
I performed FFT on the sample data in excel file I was given, which the spreadsheet automatically calculated the frequency and I2 magnitude columns and the spectrum diagram in post 5. I can't figure out how to use Fourier synthesis to replicate the original waveform.
Depends on whether you are assuming a continuous waveform or a truncated one.
What you have simulated is continuous (generators are there from t - infinity to t + infinity. For that you already have the answer: I(t) = 3.98sin(w1t) + 2.96sin(w2t) + 3.98sin(w3t). (In your simulation you generated the squares of the currents which is incorrect.)

The DFT is actually a Fourier series. The truncated waveform of duration T is assumed to have periodicity T. So first thing you know is you can't determine any frequency components below 1/T. The fact that the spaces between your "spikes" is nonzero is a consequence of the fact that there are only a finite number of samples taken during time T.
Show us your excel file & we should be able to see just what you did.
 
  • #26
Here it is. Also features An and Bn Fourier co efficients.
 

Attachments

  • #27
his_tonyness said:
Here it is. Also features An and Bn Fourier co efficients.
What is the time interval (column A)?
Were there 1024 or 2048 time samples taken? If only N=1024 as it appears, there is redundant information in the frequency components (column D), because you can only get N/2 + 1 complex frequency numbers for N time samples.
Don't be confused by the term "complex frequency numbers". It just means there are N/2 + 1 sine coefficients and N/2 + 1 cosine coefficients for the Fourier series representing a periodic function with T as its fundamental.
 
Last edited:
  • #28
Thats the darndest thing, the sample interval does not state the time units. "The supply current was sampled 1024 times over a very short time interval" that's all it gives me with regards to time, I assume we can use any sensible small time period. If you hover the mouse cursor over cell I3, it does state that the sampling frequency is 360/20ms=18000. I re-ran the simulation at 20ms:

upload_2015-5-19_18-59-17.png

upload_2015-5-19_18-59-29.png
 
  • #29
his_tonyness said:
Thats the darndest thing, the sample interval does not state the time units. "The supply current was sampled 1024 times over a very short time interval" that's all it gives me with regards to time, I assume we can use any sensible small time period. If you hover the mouse cursor over cell I3, it does state that the sampling frequency is 360/20ms=18000. I re-ran the simulation at 20ms:
I think you gave me what I wanted: if the sampling frequency was 18 KHz and there were 1024 samples taken, then the sample duration T = 1024/18000 = 56.89 ms. Your graph is column H, the magnitude of I2.
They didn't make you do much. They gave you the output of the DFT program without going into the formulas involved, which I think is too bad, but what the heck, you got to go with what they give you - if you're ever curious how the data in column D was obtained, look at http://www.dspguide.com/ch8.htm
Based on T = 56.89 ms. the DFT gave you all the A and B coefficients staring with the dc component and the "fundamental" frequency 1/.05688 = 17.58 HGz and harmonics up to and including the 512th (N/2). Interestingly, there was a dc component in your wave. As I said, half the D column values have to be redundant since you can't get more than N/2 + 1 harmonics starting with dc and 17.58 Hz.
 
  • #30
Ok, If i produce a simulation over 57ms or 1/T with the 3 principals at their orignal not square values that would be a more accurate synthesis?
 
  • Like
Likes NTL2009
  • #31
his_tonyness said:
Ok, If i produce a simulation over 57ms or 1/T with the 3 principals at their orignal not square values that would be a more accurate synthesis?
No, see my next post. Looks like my mistake.
 
  • Like
Likes NTL2009
  • #32
OK I ran the excel data anylis Fourier program and finally (my last column) got your magnitudes as depicted on your graph. So it looks like your sample were I2, not I, which I wonder how you (or they) did that. In other words, you were right to show your generators as I2 instead of I in your simulation.
My excel Fourier transform run is attached. Obviously your spreadsheet used the same excel algorithm, the one from the data analysis package. I hope the upload worked. If you get a strange spreadsheet let me know.
 

Attachments

  • #33
I'm currently working through this and I noticed that the coefficients (bn and an) in one of the attached spreadsheets is incorrect. The Fourier components should be divided by N (using IMDIV) before either multiplying by 2xn for an (using real part) and -2yn for bn (using imaginary part).

Regards
 
  • #34
Electest said:
I'm currently working through this and I noticed that the coefficients (bn and an) in one of the attached spreadsheets is incorrect. The Fourier components should be divided by N (using IMDIV) before either multiplying by 2xn for an (using real part) and -2yn for bn (using imaginary part).

Regards
Correct. I looked at "H2" and assumed the rest was all "IMDIV'ed", my mistake. Unfortunately I don't know how to perform IMDIV on multiple cells and I am not doing it one by one for 1024 cells! Multiplying the real and imaginary parts separately is a pain too to extract sine and cosine coefficients.
 
  • #35
All you need to do is carry the formula out for one cell, then highlight the result cell (where you have your =) and drag it down for each cell (you will see a little plus sign) this will then carry out the formulas for every cell/result. Very straight forward to do.
Any problem and I will explain some more.
 
  • #36
here's my updated worksheet with the A and B coefficients calculated (cos and sin resp.)
 

Attachments

  • #37
Re- Uploaded the file showing the actual An and Bn values. You forgot to multiply An by 2 and Bn by - 2.
 

Attachments

  • #38
I think there are more problems.
If the data is samples of I2, which gives the graph you posted, then there can be no real and imaginary components.
So this time I will assume that the samples are I. I'll work on this and send it for what it's worth.
 
  • #39
I'm wondering if the coefficients calculated by excel (Nzn) should be divided by N to give us zn, before entering into column C. What you think?
 
  • #40
Electest said:
I'm wondering if the coefficients calculated by excel (Nzn) should be divided by N to give us zn, before entering into column C. What you think?
Good question. I intend to run a short example for which I know the answers already (N=4 only) to see what excel really does. It's too bad they don't reveal their algorithm, since there are innumerable versions of DFT's floating around.
 
  • #41
How did you get on RM? I've looked at various websites to establish how things work with excel, but they all have different answers, so am curious how your assessment went.
 
  • #42
Electest said:
How did you get on RM? I've looked at various websites to establish how things work with excel, but they all have different answers, so am curious how your assessment went.
Hang on, I think I finally have the goods, will send an updated worksheet today and also will try to go thru the theory. I've had to do a bit of re-education here myself!
 
  • #43
Brilliant, look forward to it
 
  • #44
Ok, here is (I hope) my final effort.
I strongly urge referring to the attached dft1.pdf file. I have used their nomenclature for most of my column headings.
First thing is that I had to consider the 1024 data points as current, not current-squared, since some of the numbers are negative.
My way of looking at it, what the OP's original graph showed was the rms current component divided by √2 (column J), which I think is weird since that divides each component amplitude by 2 instead of √2. Still, I decided to chart the J column to recall the OP's chart. You can change the J data to I data or whatever of course for a new chart.

I hope that most of my worksheet is self-explanatory. I apologize for my lousy chart, I never could figure out how to run my x-axis the way I want, the way the OP did (nice 100Hz segments running 0 to 500 Hz).
If the power density spectrum is desired my belief is that it has to be my column I which would give way bigger y-axis values, peaking at 504 A2 at f = 52.73 Hz.

Again, if you don't get my worksheet, or a strange one, pls. let me know. I do seem to have some problems sometimes with .xlsx files since I am running office 2003. (I almost quit my job when I found out what microsoft did to excel after 2003!).
BTW I ran the 4-data example in dft1.pdf using excel's data analysis package Fourier analysis and it agreed with the example's numbers for F[n] so that does give me confidence in using the excel program.
 

Attachments

Last edited:
  • #45
BTW disregard the A and B columns far to the right. They were part of the OP's original worksheet. I did not compute these as I explained earlier.
I added column L which performs the inverse transform. Happily, all the f[k] values in columns B and L seem to agree.
 

Attachments

Last edited:
  • #46
Hi RM, away for the bank holiday, but will take a look on my return. It's quite an interesting question.
 
  • #47
Electest said:
Hi RM, away for the bank holiday, but will take a look on my return. It's quite an interesting question.

Sorry but I draw it in paint...:sorry:
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    9.2 KB · Views: 870
  • #48
Going back to the calculation of the THD -
upload_2015-6-4_12-47-27.png


rude man said:
But your n=2 peak is at 8.77 A2 and the n=3 is at 6.25 A2 so why are you again taking rms of those two numbers? You didn't take the rms of 16, and rightly so!

Why wouldn't you take the RMS of 16? The question states that I_1 is the RMS value of the fundamental current. Is the 16^2 a peak value or is it already an RMS value? I would have assumed it was peak. The same with I_2 and I_3.

I am getting :

\displaystyle\frac{1}{\sqrt{16}*\sqrt{2}} * \sqrt{\sqrt{2}*8.77+\sqrt{2}*6.25} * 100 = 81.43\%

What have I missed here? Can anyone explain?

Thanks
 
  • #49
earthloop said:
Going back to the calculation of the THD -
View attachment 84470
Why wouldn't you take the RMS of 16? The question states that I_1 is the RMS value of the fundamental current. Is the 16^2 a peak value or is it already an RMS value? I would have assumed it was peak. The same with I_2 and I_3.
I am getting :
\displaystyle\frac{1}{\sqrt{16}*\sqrt{2}} * \sqrt{\sqrt{2}*8.77+\sqrt{2}*6.25} * 100 = 81.43\%
What have I missed here? Can anyone explain?
Thanks
Please see post #44. I again strongly advise scrutiny of the attached pdf file for the DFT theory.
Also, the attached excel file in that post gives the correct rms values (column G).
Keep in mind that the frequencies are the bin frequencies and the rms values the corresponding bin current values. If the data sampled three discrete frequencies the dft frequencies will be approximate of course.

To answer your question, you do take the rms of I1, I2 and I3 in the THD formula. (Actually, you could use the amplitudes too. Works either way).

I don't understand why you multiplied your I2 terms by √2 but the I2 values are incorrect anyway. I get THD = (1/22.46)*√(12.402 + 8.842) = 67.8%.
 
  • #50
Ok thanks RM, I'll give the pdf a thorough read and try again.
 
Back
Top