• WARNING: Tube/Valve amplifiers use potentially LETHAL HIGH VOLTAGES.
    Building, troubleshooting and testing of these amplifiers should only be
    performed by someone who is thoroughly familiar with
    the safety precautions around high voltages.

FFT Hanning Data

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Previously known as kingden
Joined 2008
I have some data exported from one of my spectrum analyzers placed into a CSV file. It basically contains 2048 samples of an FFT placed upon a 1K sine wave through one of my amplifiers.

I do not have my textbooks in front of me now so my question is how do you compute THD based upon this information using excel?

All I need is an equation for hanning. Also it would be helpful for hamming, blackman, and the other common windowing functions.

Thanks,
kingneb
 
Previously known as kingden
Joined 2008
The spectrum analyzer performs all the computation except for THD. The wiki does not provide the information (at least that I can recognize) that takes the points from a hanning windowed plot and computes the THD from that. It does however perform all the windowing math on what is coming into the analyzer.

What I am asking is how to compute the THD based upon a hanning computed series of points.
 
The windowing is done to increase spectral resolution. The THD is calculated the same way it always is. It's the power of the harmonic content divided by the power of the fundamental.

Total harmonic distortion - Wikipedia, the free encyclopedia

I'm not aware of any way to get the original samples back once you've performed the windowing. If you don't like the windowing, use a rectangular window.

~Tom
 
Previously known as kingden
Joined 2008
All I have is a bunch of points from a *.CSV off the spectrum analyzer. I do not see how the magnitude of each harmonic can be easily deduced from that information alone.

Is there a way to determine the THD just from all the points sampled in time?
 
Last edited:
If I understand you correctly, you have the time samples - already processed by a Hanning window. You have to apply FFT to these to get frequency samples - or just code up a simpler but slower Fourier Transform. Then you determine things like harmonic levels from the FFT output. If you understand the discrete version of Fourier Transform then you can code it into a spreadsheet. If you don't understand it then you need to find someone to do it for you, or a library function in some suitable programming language. It may be (I'm not sure) that Excel or one of its extensions includes an FFT function.

Alternatively, you may already have the FFT output. Not clear from your description.
 
What's in the .CSV? Time domain data? Frequency domain data? Garbage? You're not providing many details here...

If you have the time domain samples in your .CSV file, then apply the window function and run the FFT. This is fairly straight forward in MATLAB/Octave/FreeMAT or Mathcad. Good luck doing it in Excel. Not saying it can't be done, but it wouldn't be my first choice.

~Tom
 
Fast Fourier transform - Wikipedia, the free encyclopedia

As DF96 points out, you can run a straight Fourier Transform or Discrete Fourier Transform (DFT) as well. They're slower than the FFT (Fast Fourier Transform). The Fourier transform transforms from time domain to frequency domain. From there you can get the the amplitudes of the harmonics and calculate the THD.

~Tom
 
Ex-Moderator
Joined 2011
Something to try... Assuming the windowing function has been done, then:

1) Find fundamental in the proper bin from your data points (the highest one);
2) Find harmonics in their bins;
3) Calculate THD = sum of the powers of the harmonics divided by the power of the fundamental and the harmonics.

Jaz
 
I have some data exported from one of my spectrum analyzers placed into a CSV file. It basically contains 2048 samples of an FFT placed upon a 1K sine wave through one of my amplifiers.
kingneb

OK, you have a calculated 2K FFT CSV data file from a 1K sine data stream & Hamming FFT Window applied... the used sample rate is also important while this defines the FFT Bin frequency distance (SR / FFT size).

I do not have my textbooks in front of me now so my question is how do you compute THD based upon this information using excel?
kingneb

Look at the attached picture, to have an glue :D or use an analyzer who is doing it for you :xmasman:

All I need is an equation for hanning. Also it would be helpful for hamming, blackman, and the other common windowing functions.
kingneb

Only possible if you current analyzer allows to apply your required FFT Window function PRIOR the FFT calculation. May download my SW & use a valuable sound card (Free or Evaluation) and may search within the help file.

Hp
 

Attachments

  • FFFT2D01_RBW-1.png
    FFFT2D01_RBW-1.png
    7.9 KB · Views: 55
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.