I've been struggling for some time now with implementing the Kiss FFT library in a project I'm working on. I just don't seem to be getting the values I expected out of the fft routine. Let me try to explain what I've been doing: I am trying to compute an FFT with a size of 6500 using the real fft transform. I'm sampling a 60 Hz waveform at 390kHz and attempting to calculate the total harmonic distortion of the signal. Due to memory constraints, I'm only sampling over one period of the signal, which may give me problems, I realize. I'm expecting (and please tell me if I'm wrong) that the output of the fft transform will contain the DC component, the first will contain the 60 Hz fundamental and the harmonics in the upper bins. However, when I do the transform, I get a larger numbers in the DC offset (much greater than it should be), 0's for both the real and complex elements of the 60Hz fundamental and large numbers for all the harmonics that I've looked at. So, when I calculate the total harmonic distortion, it's pretty much 100% because the fundamental is not contributing anything to it by my calculations. I can't find much in the way of documentation for this library. Does anyone have any ideas? Brad
Help with the KISS FFT library
Started by ●December 4, 2004
Reply by ●December 5, 20042004-12-05
BradK wrote:> I've been struggling for some time now with implementing the Kiss FFT > library in a project I'm working on. I just don't seem to be getting > the values I expected out of the fft routine.The most common cause for this is using real vs. complex samples in the input buffer. If you want the FFT of a real signal you have two choices: 1) insert a zero into the input buffer after each real sample 2) use the real-only fft under tools/ (it will return a half-spectrum) Option 2 is probably preferrable as it is ~2x faster.> I can't find much in the way of documentation for this library. Does > anyone have any ideas?Perhaps I am too close to the problem, but how much documentation is really needed? The formats of the input and output buffers are documented in both the README and the header files.