The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 A problem about using orgin to do FFT

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
hm87a Posted - 08/31/2005 : 10:15:44 PM
Origin Version (Select Help-->About Origin): 7.0
Operating System: WinXp

I have a question about performing FFT using Origin's data analysis. My input data is symmetry and only have the real part. With such data, one expect that FFT results should only have the real part, or at leat the imaginary part should be very small. But the result is totally beyond my expectation, it contains both real and imaginary parts, and in some physical region, their size is comparable; moreover, the data points in the real and imaginary part are alternating negative and positive, which is totally unphysical. I have tried different kind of windows, and they all work out the similar results. Could anybody give me a hint what might be wrong and what should I do?

Thanks in advance.

Jimmy

9   L A T E S T    R E P L I E S    (Newest First)
cosy Posted - 06/26/2006 : 06:01:21 AM
Thanks Easwar for the clarifications.
fzimnoch, Sorry for mentioning a straight line to be a even function. What I thought of was, Y=f(t)= A+ dy/dt* t
so f(-t) = A+ -dy/dt*-t = f(t). This made me post it that way. Please correct me if I am wrong.
Regards,
COSY.
easwar Posted - 06/22/2006 : 5:18:25 PM
Hi COSY,

FFT does not work with the mathematical expression corresponding to your signal, but rather the data points you provide - it is a numerical algorithm and no symbolic math is involved.

FFT assumes that the bunch of data points you provide is repeatable in time going backward as well as forward. Thus for example, if you start with a dataset that "represents" say a straight line y=x with 1024 points, FFT does not extend that straight line mathematically in time, but takes those 1024 points and repeats them in time. So the repeated picture will look like pasted below.

Note that in this case even though the function I used to create the dataset is y=x which is mathematically an odd function, the repeated signal in effect is neither even nor odd. f(-x) is neither f(x) nor is it f(-x) at every x, as can be seen with the red vertical lines at same absolute value of time in positive and negative direction. Thus this signal is neither even nor odd and so will have a mixture of real and imaginary components in the result.

In the previous discussion of pure sine and cosine, repeating those in time backward and forward creates perfectly odd and even functions respectively and so the real and imaginary components correspond to being even or odd.

Hope this explanation helps.

As for the results we produce: Our FFT algorithm is standard and has been tested with other products etc. You could yourself test with other products or even compare with results from NAG library included in Origin - currently the FFT routine does not interally call NAG, but NAG can be accessed from Origin C.

Easwar
OriginLab




fzimnoch Posted - 06/22/2006 : 4:29:43 PM
Hi Cosy:

You write in part:

quote:

In my case the data is a straight line with a slope (which is a real even function).



I have difficulty picturing how your straight line is a even function. The rule for continuous functions is that an even function satisfies the condition f(x)= f(-x) and the odd function satisfies f(x)=-f(-x). Does your function satisfy conditions for even function?

You can also verify your results by checking a table of Fourier Transform pairs.
cosy Posted - 06/22/2006 : 09:25:00 AM
Hi, I too have a similar question. In my case the data is a straight line with a slope (which is a real even function).I took exactly 1024 points and so padding is out of question. The result of the FFT has imaginary components sometimes significantly larger than the real part.
In response to Easwars previous comment that:

quote:
The fourier transform essentially represents the signal as a sum of cosines (real) and sines(imaginary) and therefore depending on the signal shape, even if no padding is done, the imaginary component could be significantly larger, and there is nothing incorrect about that.


In his example he has taken a sin wave which is a real odd function so the FFT has to have only imaginary components.

I am searching for 1/f noise in my data. I dont know if the FFT is done correctly else I would be reporting wrong facts. I would be grateful for any clarifications on this issue.

Regards,
COSY.
easwar Posted - 09/02/2005 : 3:34:19 PM
Hi,

Padding can affect the strength of the imaginary component as Mike illustrated here.

However that is not the only reason for the imaginary component being significantly different from zero. The fourier transform essentially represents the signal as a sum of cosines (real) and sines(imaginary) and therefore depending on the signal shape, even if no padding is done, the imaginary component could be significantly larger, and there is nothing incorrect about that.

For example see the picture below where the signals, a pure cosine wave and a pure sine way, are both 2048 points and therefore no padding is done during the fft computation. Note that in the cosine case the strength is all in the real component of the FFT whereas in the sine case the opposite is true.

Easwar
OriginLab



Mike Buess Posted - 09/02/2005 : 08:03:20 AM
Hi Jimmy,

If you need the sign use only the right or left half of your data. If your signal is truly symmetric then both halves are not needed. Eliminating one half should eliminate the oscillations but reintroduce a substantial imaginary component.

...This is better illustrated with a simpler example. The spectrum in Graph1 was obtained from the back-to-back exponentials shown in the inset. The pronounced oscillations of the real values are eliminated in Graph2 by left shifting the signal to get rid of the rising exponential. This produces a sizeable imaginary component which might be a problem with a more complicated signal. (Missing the exact center of your signal can introduce phase errors.)





...Finally remembered the hand-waiving explanation for the oscillations. The value of the initial (t=0) data point in the signal is equal to the integral of the spectrum. In the inset of Graph1 the value at t=0 is zero so it's spectrum must integrate to zero. The only way for that to happen without making all FFT points zero is to oscillate between + and - as shown in Graph1. The t=0 point in the inset of Graph2 is positive so it's spectrum has a positive area resulting in a normal peak.

...I did say hand-waiving didn't I? It turns out that +/- oscillations are not the only way zero the integral. For example, if you FT the rising exponential as shown in Graph3 you also get a normal peak. This time the area is zeroed by dropping the entire spectrum. (Note the slightly negative baseline.)



Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 09/02/2005 12:35:00 PM

Edited by - Mike Buess on 09/02/2005 1:39:00 PM

Edited by - Mike Buess on 09/02/2005 2:44:09 PM
hm87a Posted - 09/02/2005 : 01:48:16 AM
Thank you very much.

The imaginary part does have something to do with the padding, I tried to interpolate the input data so it has with 2**N point, and the imaginary part now is significantly reduced.

But the sign problem is still there. I can not just use the amplitude, because the sign of the real part from FFT means something.

Jimmy
Mike Buess Posted - 09/01/2005 : 5:29:57 PM
Hi Jimmy,

Just to add to Greg's comment, the size of the imaginary fft component is probably due to padding. If the number of data points in the signal is not a power of two the FFT tool either pads or truncates to the nearest power of two. How it decides whether to pad or truncate is explained here...

http://www.originlab.com/www/support/resultstech.aspx?ID=570&language=English

The first figure below is a sine wave multiplied by the Welch window. Like yours, it is a symmetric signal with only a real part. The trace consists of 600 points but the FFT tool will pad
to 1024 points prior to transforming. The peak in the resulting spectrum is shown in the second figure. The red curve is real, green is imaginary and blue is amplitude. As you observed, the imaginary curve is nearly the same size as the real curve near the peak.

The third figure shows the peak when padding was not performed. In that case the imaginary curve is always much smaller than the real. To find out how to FFT without padding or truncating look at this article...

http://www.originlab.com/www/support/resultstech.aspx?language=English&ID=1086

Note that oscillations such as those you mentioned occur even in the unpadded spectrum. (Real points on either side of the peak are negative.) I don't remember where they come from but in echo FFT (NMR) we usually find that the amplitude (blue curve) is a good representation of the physical peak as long as the entire echo is encompassed by the acquisition window.

Time domain signal: 600 real points...


FFT after padding to 1024 points...


FFT with no padding...


Mike Buess
Origin WebRing Member
greg Posted - 09/01/2005 : 09:58:28 AM
The complete solution of the FFT always contains real and imaginary parts whether the source is just real or real and imaginary. The sign contains the phase information. You could not do an inverse FFT without both the real and imaginary results of the FFT.


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000