Re: Re: Re: FourierTransform of Sinc Function
- To: mathgroup at smc.vnet.net
- Subject: [mg44405] Re: [mg44359] Re: [mg44311] Re: FourierTransform of Sinc Function
- From: Sseziwa Mukasa <mukasa at jeol.com>
- Date: Sat, 8 Nov 2003 04:50:49 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
On Friday, November 7, 2003, at 05:16 AM, Kieng wrote: > I am sorry my question is apparently not so clear. > I generated a list of data from a sinc function. I am not doing the > transform from the sinc function. > If I use Fourier[list of the data], and plot the result, her is where > I am > kind of not sure why I don't get a top hat function, even though I > used very > fine step for my sinc function data. First of all, how are you sampling your sinc function? Fourier assumes that the first point in a sampled f(n*tau) where tau is the sample period corresponds to n = 0. Sampling sinc(x) for values of x < 0 will result in a linear phase shift in the resulting spectrum. Secondly, are you aware that the DC component of the Fourier Transform is returned as the first element of the list not N/2 where N is the number of samples? To get a traditional plot you need to rotate the data by N/2. Here is a function to sample a sinc function at n points in the interval [a,b]. sampledsinc[n_Integer, a_Real, b_Real] := Table[With[{x = a + (b - a) i/(n - 1)}, If[x == 0, 1, Sin[x]/x]], {i, 0, n - 1}] /; a < b And here is a function to plot the Fourier Transform plotsampledsinc[n_Integer, a_Real, b_Real] := ListPlot[Re[RotateRight[ Fourier[sampledsinc[n, a, b]], Quotient[ n, 2]] Table[Exp[2 I Pi a (i( n - 1)/(n (b - a)) - (n - 1)/(2 (b - a)))], {i, 0, n - 1}]], PlotJoined -> True, PlotRange -> All] /; a < b Using a finer step, ie increasing n, only increases the bandwidth plotted, you need to increase n and the sampled region to increase resolution. Regards, Ssezi