Harmonics in fft transformed data
Author 
Message 
DavidT #1 / 41

Harmonics in fft transformed data
Hi all, With the fft routine from motorola bbs, I'm able to generate 256 frequency domain data from 256 time domain data. My question is from the 256 transformed data, how can i know which is the fundamental frequency components, let say f and its harmonics 2*f, 3*f, 4*f and so on? Please advise me on this. Albert

Tue, 05 Apr 2005 19:29:52 GMT 


Marcel Hendri #2 / 41

Harmonics in fft transformed data
Quote:
> With the fft routine from motorola bbs, I'm able to generate 256 > frequency domain data from 256 time domain data.
David, this would be a breaktrough in physics and a revolution in telecoms :) My guess is the top 128 "harmonics" in the sequence are redundant (copies), or the 256 outputs are representing 128 frequency and phase components (maybe interleaved). The two lowest components might be something special (DC component, Nyquist comp etc.) Quote: > My question is from > the 256 transformed data, how can i know which is the fundamental > frequency components, let say f and its harmonics 2*f, 3*f, 4*f and so > on?
Read the code, or input a sampled square wave. I'm sure you know what to expect. marcel

Tue, 05 Apr 2005 20:45:37 GMT 


Jerry Avin #3 / 41

Harmonics in fft transformed data
Quote:
> Hi all, > With the fft routine from motorola bbs, I'm able to generate 256 > frequency domain data from 256 time domain data. My question is from > the 256 transformed data, how can i know which is the fundamental > frequency components, let say f and its harmonics 2*f, 3*f, 4*f and so > on? > Please advise me on this. > Albert
I answered in another newsgroup. When you post to several groups, cross post a single message. That way, 1) when one reads it in one group, it will be marked old in the others and 2) replies in any group will appear in all. Jerry  Engineering is the art of making what you want from things you can get.

Tue, 05 Apr 2005 23:35:21 GMT 


DavidT #4 / 41

Harmonics in fft transformed data
Thanks Marcel, I heard from a friend that and have a question: the 1st sample in the fft transformed data is the 'fs/256'th sample in frequency domain. The 2nd is '2fs/256'th sample and so on. Since only 256 samples will be produced with the fft routine, does it mean that i can't find the harmonics like 2nd harmonics(2*fs), 3rd harmonics(3*fs), 4th harmonics (4*fs) and so on? Also, I hope that you can clarify for me one thing. Sometimes, in fft, they refer to power spectra which involves square root of absolute values. Is this the magnitude we're interested in frequency domain? Thanks... Quote:
> > With the fft routine from motorola bbs, I'm able to generate 256 > > frequency domain data from 256 time domain data. > David, this would be a breaktrough in physics and a revolution > in telecoms :) My guess is the top 128 "harmonics" in the sequence > are redundant (copies), or the 256 outputs are representing 128 > frequency and phase components (maybe interleaved). The two lowest > components might be something special (DC component, Nyquist comp > etc.) > > My question is from > > the 256 transformed data, how can i know which is the fundamental > > frequency components, let say f and its harmonics 2*f, 3*f, 4*f and so > > on? > Read the code, or input a sampled square wave. I'm sure you know > what to expect. > marcel

Wed, 06 Apr 2005 06:25:46 GMT 


Krishna Mynen #5 / 41

Harmonics in fft transformed data
Quote:
> > With the fft routine from motorola bbs, I'm able to generate 256 > > frequency domain data from 256 time domain data. > David, this would be a breaktrough in physics and a revolution > in telecoms :) > [...]
David, You may want to look at the ordering scheme for numerical FFTs presented in the book "Numerical Recipes" by Press, et al. They state that the ordering scheme that they use is the practical standard. In their scheme, the first element in the array is the real part of the zero frequency component (f=0), the next element is the imaginary part for f=0, the next pair corresponds to the real and imaginary parts of f = 1/(2N dt) and so on until midway through the data set. Then the next point is for f= 1/(2 dt) and increases back towards zero. Also, note that your fft does not have to be symmetric if your original time domain data was complex. It's a rather special case, but I believe you can indeed have 256 distinct complex points in the fft for 256 *complex* time series data. Krishna

Wed, 06 Apr 2005 08:14:02 GMT 


Jerry Avin #6 / 41

Harmonics in fft transformed data
I hope that you know about samples signals to operate on them. Valid sampling implies that there are no significant frequency components in the sampled signal that equal or exceed half the sampling frequency. Certainly, the reconstructed signal will contain none. The sampling frequency has another significance. As your friend told you, the sampling frequency, together with the number of samples you process, determine the resolution of the result in Hz. Some numbers may make this clear. Sample at 10240 Hz, a number suitable for voice. (First filter the signal to limit its upper frequency to less than 5120 Hz.) 256 samples are 1/40 second's worth. There will be 128 sine coefficients and as many cosine coefficients produced by the FFT. Each pair is spaced 10240 Hz/256, or 40 Hz from it neighbors. The 1/40 sec. and 40 Hz. are what they seem: reciprocals. If you want 1 Hz resolution, you must use a full second's worth of data. However many samples you transform, the highest frequency that can be represented is Fs/2, in this case, 5120 Hz. If there were a 100 Hz signal, its 51st harmonic could be represented. Look in http://www.dspguru.com for links to tutorials and books that you might find useful. Jerry  Engineering is the art of making what you want from things you can get. Quote:
> Thanks Jerry, > I heard from a friend the following and i also have a question about > it: > the 1st sample in the fft transformed data is the 'fs/256'th sample in > frequency domain. The 2nd is '2fs/256'th sample and so on. Since only > 256 samples will be produced with the fft routine, does it mean that i > can't find the harmonics like 2nd harmonics(2*fs), 3rd > harmonics(3*fs), 4th harmonics (4*fs) and so on? > Also, I hope that you can clarify for me one thing. Sometimes, in fft, > they refer to power spectra which involves square root of absolute > values. Is this the magnitude we're interested in frequency domain? > Thanks...
> > > Hi all, > > > With the fft routine from motorola bbs, I'm able to generate 256 > > > frequency domain data from 256 time domain data. My question is from > > > the 256 transformed data, how can i know which is the fundamental > > > frequency components, let say f and its harmonics 2*f, 3*f, 4*f and so > > > on? > > > Please advise me on this. > > > Albert > > You can guess, but you can't know from the data alone. Suppose there are prominent peaks at 100, 150, and 200 Hz. You can guess that they are the 2nd, 3rd, and 4th harmonics of a 50 Hz fundamental which you don't see. They could also be the 4th, 6th, and 8th harmonics of > > 25 Hz, generated by a process that makes only even harmonics, such as absolute value or fullwave rectification. Suppose again that there is a weak component at 175 Hz. Does that force you to halve your estimate of the fundamental, or might it be unrelated to the other > > components? Are the other components really related? You need to know or assume something or about the signal in order to answer those questions. > > Jerry

Wed, 06 Apr 2005 09:32:41 GMT 


Gary Chanso #7 / 41

Harmonics in fft transformed data
Quote: > You may want to look at the ordering scheme for > numerical FFTs presented in the book "Numerical > Recipes" by Press, et al. They state that the > ordering scheme that they use is the practical > standard. In their scheme, the first element in > the array is the real part of the zero frequency > component (f=0), the next element is the imaginary part > for f=0, the next pair corresponds to the real > and imaginary parts of f = 1/(2N dt) and so on > until midway through the data set. Then the next > point is for f= 1/(2 dt) and increases back towards > zero.
I don't think you can make this assumption. I've seen implementations which put the real parts in the lower half and the imaginary parts in the upper half. I've seen implementations which only return the real part and the upper half is a duplicate of the lower half (or don't generate it at all). I don't think there really is a standard. Quote: > Also, note that your fft does not have to be symmetric > if your original time domain data was complex. It's a > rather special case, but I believe you can indeed have > 256 distinct complex points in the fft for 256 *complex* > time series data.
I don't think I've seen that variation.  Gary Chanson (MVP for Windows SDK) Software Consultant (Embedded systems and Real Time Controls)
War is the last resort of the incompetent.

Wed, 06 Apr 2005 13:03:16 GMT 


Marcel Hendr #8 / 41

Harmonics in fft transformed data
Newsgroups: comp.lang.forth Subject: Re: Harmonics in fft transformed data Summary: Expires:
Sender: FollowupTo: Distribution: Organization: Internet Access Eindhoven Keywords: Cc: Quote: Krishna writes: > [..] but I believe you can indeed have 256 distinct complex > points in the fft for 256 *complex*time series data.
There exists a nice packing scheme (see e.g. NRC) where you pack 512 timepoints of a real signal as 256 complex samples of an artificial complex signal. If you input these into a standard FFT and unpack the complex frequency data properly, you will get 256 frequencies of the original 512 point real sequence. This is the optimal way to do it when the input points are real (grabbed from an ADC or such). The original poster seems to be confused with respect to the concepts of "sample frequency" and the "time interval over which the signal to be sampled is repetitive." If he is trying to asynchronously sample an unknown waveform he has some more reading to do. marcel

Wed, 06 Apr 2005 14:48:34 GMT 


Krishna Mynen #9 / 41

Harmonics in fft transformed data
Quote:
> Krishna writes: > > [..] but I believe you can indeed have 256 distinct complex > > points in the fft for 256 *complex*time series data. > There exists a nice packing scheme (see e.g. NRC) where you pack 512 > timepoints of a real signal as 256 complex samples of an artificial complex > signal. If you input these into a standard FFT and unpack the complex > frequency data properly, you will get 256 frequencies of the original 512 > point real sequence. This is the optimal way to do it when the input points > are real (grabbed from an ADC or such). > [...]
Yes, you can pack two real waveforms into the real and imaginary parts of one complex waveform and get a "two for one deal" with the appropriate fft routine. However, there are also cases when you may need to take the fft of a complex "waveform". For example, the WeinerKhinchine Theorem says that the Fourier Transform of the autocorrelation function of a signal directly gives the power spectrum. If the autocorrelation function happens to be complex, then the power spectrum can be asymmetric. The emitted light from diode lasers is a good example of this case. This sort of situation will occur when there is a correlation between the phase and amplitude of the signal. Krishna

Wed, 06 Apr 2005 21:54:24 GMT 


Krishna Mynen #10 / 41

Harmonics in fft transformed data
Quote:
> > You may want to look at the ordering scheme for > > numerical FFTs presented in the book "Numerical > > Recipes" by Press, et al. They state that the > > ordering scheme that they use is the practical > > standard. In their scheme, the first element in > > the array is the real part of the zero frequency > > component (f=0), the next element is the imaginary part > > for f=0, the next pair corresponds to the real > > and imaginary parts of f = 1/(2N dt) and so on > > until midway through the data set. Then the next > > point is for f= 1/(2 dt) and increases back towards > > zero. > I don't think you can make this assumption. [...]
Yes, I agree. However, it's one possibility to check if the original poster can't figure out the ordering. Quote: > > Also, note that your fft does not have to be symmetric > > if your original time domain data was complex. It's a > > rather special case, but I believe you can indeed have > > 256 distinct complex points in the fft for 256 *complex* > > time series data. > I don't think I've seen that variation.
See my response to Marcel further down in the thread. KM

Wed, 06 Apr 2005 21:57:26 GMT 


Krishna Mynen #11 / 41

Harmonics in fft transformed data
Quote:
> [...] > However, there are also cases when you may need to take the > fft of a complex "waveform". For example, > the WeinerKhinchine Theorem says that the Fourier Transform of > the autocorrelation function of a signal directly gives the power > spectrum. If the autocorrelation function happens to be complex, > then the power spectrum can be asymmetric. > [...]
In the case of a complex autocorrelation function, the real part must have even symmetry and the imaginary part must have odd symmetry. Taking the FT of such a function will give a result which is real only (the imaginary part is zero). So even though there are N distinct input points to the FT and N distinct points in the output, half of the values in the output (the imaginary parts of the N numbers) are zero. When symmetry, complex conjugation for the case of the autocorrelation function, is not present in the input points, then we may expect that the N distinct output points will have more information than N/2 values. Krishna

Thu, 07 Apr 2005 21:33:07 GMT 


Howerd Oakfor #12 / 41

Harmonics in fft transformed data
Hi David, At risk of exposing my limited knowledge of FFTs : The fundamental frequency has the largest amplitude, and since the harmonics are positive integers, the fundamental must also have the lowest frequency value. With only 256 samples you will not be able to see many odd harmonics... Regards Howerd
Quote: > Hi all, > With the fft routine from motorola bbs, I'm able to generate 256 > frequency domain data from 256 time domain data. My question is from > the 256 transformed data, how can i know which is the fundamental > frequency components, let say f and its harmonics 2*f, 3*f, 4*f and so > on? > Please advise me on this. > Albert

Fri, 08 Apr 2005 05:59:43 GMT 


Jerry Avin #13 / 41

Harmonics in fft transformed data
Pay no attention to the man behind the curtain! (Howerd: you are exposed.) :) There is no requirement that the fundamental of a waveform be present, let alone that it have the largest amplitude. 256 real samples allow determining the amplitudes of 128 frequencies. If the fundamental is low enough, many of its harmonics can be represented, both odd and even. Jerry  Engineering is the art of making what you want from things you can get. Quote:
> Hi David, > At risk of exposing my limited knowledge of FFTs : > The fundamental frequency has the largest amplitude, and since the harmonics > are positive integers, the fundamental must also have the lowest frequency > value. > With only 256 samples you will not be able to see many odd harmonics... > Regards > Howerd
> > Hi all, > > With the fft routine from motorola bbs, I'm able to generate 256 > > frequency domain data from 256 time domain data. My question is from > > the 256 transformed data, how can i know which is the fundamental > > frequency components, let say f and its harmonics 2*f, 3*f, 4*f and so > > on? > > Please advise me on this. > > Albert

Fri, 08 Apr 2005 06:52:30 GMT 


Jerry Avin #14 / 41

Harmonics in fft transformed data
Pay no attention to the man behind the curtain! (Howerd: you are exposed.) :) There is no requirement that the fundamental be present in a waveform, let alone that it have the largest amplitude. 256 real samples allow determining the amplitudes of 128 frequencies. If the fundamental is low enough, many of its harmonics can be represented, both odd and even. Jerry  Engineering is the art of making what you want from things you can get. Quote:
> Hi David, > At risk of exposing my limited knowledge of FFTs : > The fundamental frequency has the largest amplitude, and since the harmonics > are positive integers, the fundamental must also have the lowest frequency > value. > With only 256 samples you will not be able to see many odd harmonics... > Regards > Howerd
> > Hi all, > > With the fft routine from motorola bbs, I'm able to generate 256 > > frequency domain data from 256 time domain data. My question is from > > the 256 transformed data, how can i know which is the fundamental > > frequency components, let say f and its harmonics 2*f, 3*f, 4*f and so > > on? > > Please advise me on this. > > Albert

Fri, 08 Apr 2005 07:00:56 GMT 


Gary Chanso #15 / 41

Harmonics in fft transformed data
Quote: > Hi David, > At risk of exposing my limited knowledge of FFTs : > The fundamental frequency has the largest amplitude,
I don't think this has to be true.  Gary Chanson (MVP for Windows SDK) Software Consultant (Embedded systems and Real Time Controls)
War is the last resort of the incompetent.

Fri, 08 Apr 2005 07:31:39 GMT 


Page 1 of 3

[ 41 post ] 

Go to page:
[1]
[2] [3] 
