Reply by sulphox December 18, 20052005-12-18
I see.

Thanks for your help Bob.

By the way, Merry Christmas to all :D 

Sulphox

Reply by BobM December 15, 20052005-12-15
sulphox wrote:
> Hi all, I'm sorry to bother you guys again. > > Is the formula, f(i) = i*(sampling_rate / FFTsize) > applicable to all the different type of input signal? > > or it only applicable when rect(t) is the input signal?
That formula is applicable to an FFT (or DFT) of any input signal. It's just for labeling the x-axis (frequency axis).
> I tried to apply the formula on another mathematical function.i.e. > sinc(x) > after that, i plotted f(i) vs ABS of Y(f) using the same method. > > The shape graph is like an inverted rect(t). > Is this the correct graph's that i should get? > i have a feeling i got the wrong graph.
You got the right graph. The FFT of a sinc() function is a rect() function. It looks like an inverted rect() when you plot the FFT from Y[i]...Y[FFTsize-1]. But the items above FFTsize/2 are the negative frequencies, so try rearranging to plot it like this: Y[FFTsize/2+1] ... Y[FFTsize-1] Y[0] ... Y[FFTsize/2] For example, if your FFTsize was 8, it would be re-arranged like this: Y[5] Y[6] Y[7] Y[0]: DC Y[1] Y[2] Y[3] Y[4]: Nyquist Note that it now looks like a normal (non-inverted) rect() function. For a real input (one with 0 for the imaginary part, such as a sinc() function), you only need to look at the positive frequencies. Try plotting it like this: Y[0]: DC Y[...] Y[FFTsize/2]: Nyquist Now you can see that it's a lowpass filter. This is likely the purpose of the exercise - to demonstrate that a sinc() function in the time domain is an ideal lowpass filter in the frequency domain. However, it takes an infinitely long sinc() function to make an ideal lowpass filter. Read up on the windowed sinc FIR filter to learn about a method used to overcome this limitation in practical applications. Bob
Reply by sulphox December 14, 20052005-12-14
Hi Fred,


I tried to work out the Frequency and plotted out the FFT graph.
The graph seems correct.
Thanks for your help.

Thanks to the others as well :D 

Sulphox

Reply by sulphox December 14, 20052005-12-14
Hi all, I'm sorry to bother you guys again.

Is the formula, f(i) = i*(sampling_rate / FFTsize)
applicable to all the different type of input signal?

or it only applicable when rect(t) is the input signal?

I tried to apply the formula on another mathematical function.i.e.
sinc(x)
after that, i plotted f(i) vs ABS of Y(f) using the same method.

The shape graph is like an inverted rect(t).
Is this the correct graph's that i should get?
i have a feeling i got the wrong graph.

Please advise me.
Thank you.


Sulphox

Reply by Fred Marshall December 11, 20052005-12-11
"sulphox" <sulphox77@hotmail-dot-com.no-spam.invalid> wrote in message 
news:XfidnXmsTpdcwwHeRVn_vQ@giganews.com...
> Hi all, > > I'm really sorry i still do not get what you guys mean? > > > t y(t)=rect(t) > -1 [b:ea1a4b00e0]0[/b:ea1a4b00e0] > -0.9 [b:ea1a4b00e0]0[/b:ea1a4b00e0] > -0.8 [b:ea1a4b00e0]0[/b:ea1a4b00e0] > -0.7 [b:ea1a4b00e0]0[/b:ea1a4b00e0] > -0.6 [b:ea1a4b00e0]0[/b:ea1a4b00e0] > -0.5 [b:ea1a4b00e0]1[/b:ea1a4b00e0] > -0.4 [b:ea1a4b00e0]1[/b:ea1a4b00e0] > -0.3 [b:ea1a4b00e0]1[/b:ea1a4b00e0] > -0.2 [b:ea1a4b00e0]1[/b:ea1a4b00e0] > -0.1 [b:ea1a4b00e0]1[/b:ea1a4b00e0] > 0 [b:ea1a4b00e0]1[/b:ea1a4b00e0] > 0.1 [b:ea1a4b00e0]1[/b:ea1a4b00e0] > 0.2 [b:ea1a4b00e0]1[/b:ea1a4b00e0] > 0.3 [b:ea1a4b00e0]1[/b:ea1a4b00e0] > 0.4 [b:ea1a4b00e0]1[/b:ea1a4b00e0] > 0.5 [b:ea1a4b00e0]1[/b:ea1a4b00e0] > 0.6 [b:ea1a4b00e0]0[/b:ea1a4b00e0] > 0.7 [b:ea1a4b00e0]0[/b:ea1a4b00e0] > 0.8 [b:ea1a4b00e0]0[/b:ea1a4b00e0] > 0.9 [b:ea1a4b00e0]0[/b:ea1a4b00e0] > 1 [b:ea1a4b00e0]0[/b:ea1a4b00e0] > > I'm sorry the data look messy, > Those in bold are y(t) and its values.
***Well, that's interesting but what the heck is the notation you're using? "b:"? ; "]0["? etc. It looks like hexadecimal but the brackets, intervening 1's and 0's and /'s are confusing. Since you said "bold" I assume that this is some markup language with the b: and /b:, etc....... But, I can't decipher it. Post in plain text please.
> The other one not in bold is 't' and its values. > > I've computed the FFT of y(t) as well as its ABS and ARG. > In this case, my sampling period is 0.1 and the sampling rate is > 1/0.1 > How about the FFT size? is it 21? > Is the 'i' is the integer values from 0 to 20? > If the FFT size is 21, then i have to Plot the Frequency data from 0 > to 10.5? > > Sorry for my poor understanding of the concept. > Please be patience with me.
See the comment inserted above.... Well, a lot of what you're asking is dependent on what tools you're using. So, *in general*: The sequence or array or vector size or length is obviously 21. You need a special FFT to transform an array that's not of length 2^N. That's not to say that many of the programs won't do a Discrete Fourier Transform on a length 21 sequence but it may or may not be "fast" as in FastFourierTransform=FFT. The resulting transform will be the same length as the input. The result will be complex. You ask what is "i" but give no reference or example... except you ask about "integer". Do you mean the index of the values? Generally, yes, if the samples are assumed to be spaced at intervals of 1 second, then the sample rate is 1Hz or 2*pi radians per second. Since there are 21 data points, then the frequency resolution in the transform is fs/N or 1/21Hz. In your case, fs=10Hz and the spacing of the frequency samples is 10/21 Hz. The output of the transform starts at 0 and ends at fs-fs/N = fs(1-1/N) Hz The transform repeats at fs so the value at fs (which is not in the transformed sequence) will be the same as the value at 0. What do you need to plot? If I interpret your question a bit, often what one is interested in is the data from 0 to fs/2. In your case, fs/2 = 5 There are 21 samples (not including fs) and 21 intervals between 0 and fs. Since N is odd, fs/2 falls in the middle of the middle (the 1+N/2) interval. Thus, there is no sample at fs/2. f = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 all times 10/21 sample = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 (22) The frequency at the 11th sample is 10*10/21 which is just below fs/2=5. So, you need 11 of the 21 samples to almost reach fs/2 .. that is: (N+1)/2 samples. If the number of samples were even, then you need 1 + N/2 samples which will include fs/2. The magnitude of the 12th sample will be the same as the 11th. The magnitude of the 13th sample will be the same as the 10th ... and so forth. That's why you may not be interested in the magnitude data above fs/2 - it's just a mirror image of the data below fs/2. I hope this helps. Fred
Reply by sulphox December 11, 20052005-12-11
Hi all,

I'm really sorry i still do not get what you guys mean?


t	       y(t)=rect(t)
-1	       [b:ea1a4b00e0]0[/b:ea1a4b00e0]
-0.9	       [b:ea1a4b00e0]0[/b:ea1a4b00e0]
-0.8	       [b:ea1a4b00e0]0[/b:ea1a4b00e0]
-0.7	       [b:ea1a4b00e0]0[/b:ea1a4b00e0]
-0.6	       [b:ea1a4b00e0]0[/b:ea1a4b00e0]
-0.5	       [b:ea1a4b00e0]1[/b:ea1a4b00e0]
-0.4	       [b:ea1a4b00e0]1[/b:ea1a4b00e0]
-0.3	       [b:ea1a4b00e0]1[/b:ea1a4b00e0]
-0.2	       [b:ea1a4b00e0]1[/b:ea1a4b00e0]
-0.1	       [b:ea1a4b00e0]1[/b:ea1a4b00e0]
0	       [b:ea1a4b00e0]1[/b:ea1a4b00e0]
0.1	       [b:ea1a4b00e0]1[/b:ea1a4b00e0]
0.2	       [b:ea1a4b00e0]1[/b:ea1a4b00e0]
0.3	       [b:ea1a4b00e0]1[/b:ea1a4b00e0]
0.4	       [b:ea1a4b00e0]1[/b:ea1a4b00e0]
0.5	       [b:ea1a4b00e0]1[/b:ea1a4b00e0]
0.6	       [b:ea1a4b00e0]0[/b:ea1a4b00e0]
0.7	       [b:ea1a4b00e0]0[/b:ea1a4b00e0]
0.8	       [b:ea1a4b00e0]0[/b:ea1a4b00e0]
0.9	       [b:ea1a4b00e0]0[/b:ea1a4b00e0]
1	       [b:ea1a4b00e0]0[/b:ea1a4b00e0]

I'm sorry the data look messy, 
Those in bold are y(t) and its values.
The other one not in bold is 't' and its values.

I've computed the FFT of y(t) as well as its ABS and ARG. 
In this case, my sampling period is 0.1 and the sampling rate is
1/0.1
How about the FFT size? is it 21?
Is the 'i' is the integer values from 0 to 20?
If the FFT size is 21, then i have to Plot the Frequency data from 0
to 10.5?

Sorry for my poor understanding of the concept.
Please be patience with me.

Reply by Glennaebad December 8, 20052005-12-08
"sulphox" <sulphox77@hotmail-dot-com.no-spam.invalid> wrote in message
news:7tqdnWsu2fDKNQveRVn_vA@giganews.com...
> Hi all, > > I wanna plot a FFT graph. > Let's say i have > variable, t > y(t)=rect(t) > Y(f)=FFT of rect(t) > > If i wanna plot the FFT graph. > What should be the x and the y axis? > is it 't' and 'absolute of Y(f)' respectively? > > Please correct me if i'm wrong. > > Thanks for any help in advance. >
Does anybody use spread sheets except accountants and the like? I neevr used them and hate the bloody things. Glen
Reply by BobM December 8, 20052005-12-08
sulphox wrote:
> If i have variable t=-1. -0.9, -08,...., 1 (64 sets of data in total) > I have computed: > The signal, y(t)=rect(t) > The Fourier analysis of y(t), Y(f) > The IMABS of Y(f) > > How do I create the new column for the frequency from the data that i > have?
The frequency axis will be dependent on the sampling rate, so you need to determine that first. In general, the frequency column items can be found with this formula: F(i) = i*(sampling_rate / FFTsize) where: FFTsize = 64 i = each FFT array index (0 ... 63) sampling_rate = (need to find, in Hz) Remember, sampling rate is the inverse of the sampling period: sampling_rate = 1/sampling_period Find the sampling period (in seconds) and then you can determine the sampling rate (in Hz). The sampling period can be determined from your time axis data. That is, subtract one time axis item from the previous one. For example, if t = {-1, -.9, -.8, ...} seconds then your sampling period is [(-.9) - (-1)] = .1 seconds. Like others said, you only need to plot frequency data from 0 (DC) to FFTsize/2 (Nyquist). That is, from 0 to 32. Bob
Reply by sulphox December 8, 20052005-12-08
Hi,

First of all, thanks for all the help given.

I would like to ask guest regarding the
point no. 3.
I do not understand about the new frequency part.

If i have variable t=-1. -0.9, -08,...., 1 (64 sets of data in total)
I have computed:
The signal, y(t)=rect(t)
The Fourier analysis of y(t), Y(f)
The IMABS of Y(f)

How do I create the new column for the frequency from the data that i
have?   

Sulphox

Reply by Fred Marshall December 7, 20052005-12-07
"sulphox" <sulphox77@hotmail-dot-com.no-spam.invalid> wrote in message 
news:7tqdnWsu2fDKNQveRVn_vA@giganews.com...
> Hi all, > > I wanna plot a FFT graph. > Let's say i have > variable, t > y(t)=rect(t) > Y(f)=FFT of rect(t) > > If i wanna plot the FFT graph. > What should be the x and the y axis? > is it 't' and 'absolute of Y(f)' respectively? > > Please correct me if i'm wrong. > > Thanks for any help in advance.
There are various FFT outputs that are possible. The most common goes from radian frequency=0 to radian frequency=2*pi or frequency=1Hz for an assumed or normalized sample interval of "1" or 1 second. For real functions being transformed, the magnitude repeats / mirrors at pi radians/sec or 0.5Hz, so you may not want to plot the result beyond this. x would be frequency in radians per second or Hz from 0>pi or 0>0.5 ... half of the output points plus one. y would be absY(f) where Y(f) is a complex sequence. Since you're wanting to use Excel, check out: http://www.fysik.uu.se/kurser/fy660/compendium/Signal/ Fred