1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Domain of a discrete fourier transform

  1. Sep 19, 2016 #1
    1. The problem statement, all variables and given/known data

    The (computing) task at hand is to take a function [itex]f(x)[/itex] defined at [itex]2N[/itex] discrete points, and use the Discrete Fourier Transform (DFT) to produce [itex]F(u)[/itex], a plot of the amplitudes of the frequencies required to produce [itex]f(x)[/itex]. I have an array for each function holding the value of each function at each value of [itex]x[/itex].

    I have 2 questions:
    1) Does it make sense to talk of a continuous frequency space when we start with a discrete real space? i.e. Can I let [itex]u[/itex] take any value or should it only take values corresponding to functions with integral periods?
    2) What should the domain of [itex]F(u)[/itex] be?

    2. Relevant equations

    The 1D Fourier transform of a function [itex]f(x)[/itex] can be approximated as a sum over discrete values:
    F(u) = \frac{1}{2N} \sum_{x=-N}^{N-1} f(x) e ^{\frac{\pi i x u}{N}}

    3. The attempt at a solution

    Allow me to explain my intuition on what's going on, and please put me right on it if I'm wrong!

    If we choose to plot [itex]f(x)[/itex] on a continuous [itex]x[/itex] axis, then due to the discrete, array, representation of it, we will see vertical discontinuities, or steps, between each successive value of the function. Each step will be an arbitrary constant width [itex]\delta[/itex] which would be decided at the plotting stage.

    As such, when we use the Fourier transform, we find the amplitudes of the square waves of each frequency which make up the original function [itex]f(x)[/itex]. Because [itex]f(x)[/itex] is only defined over a space of [itex]2N[/itex] points, we can say that the maximum period of any function is [itex]2N\delta[/itex] in the continuous space, or [itex]2N[/itex] in the discrete space. To say that a wave has a frequency [itex]\nu[/itex] is to say it has a period [itex]\frac{2N\delta}{\nu}[/itex] in the continuous space, or [itex]\frac{2N}{\nu}[/itex] in the discrete space.

    Now my attempts at answers:

    1) Upon plotting [itex]F(u)[/itex] with a continuous [itex]u[/itex] I see no discontinuities, so I suppose then it does make sense, but then I'm really not sure. My hesitation is because an arbitrary real-valued [itex]u[/itex] would not generally be exactly representable in the discrete space, and would have to represented by the nearest one that is.

    2) I have a few thoughts on this:

    a) The maximum frequency representable in the discrete space is N. My logic is that the maximum frequency square wave on a discrete space is of the following form:
    {..., a, 0, a, 0, a, 0, a, 0, ...}
    where a is the wave's amplitude. A higher frequency would have to have adjacent 'a's and '0's, and would therefore be indistinguishable from a lower frequency in the discrete space. The conclusion is that the domain should be [0:N]

    b) I have tried a few plots of [itex]F(u)[/itex]. I've tried with [itex]f(x) = 1[/itex] for [itex]-6<x<5[/itex] and 0 otherwise. I see that the plot is periodic with period [itex]2N[/itex] and with vertical axes of symmetry at integer multiples of [itex]N[/itex]. This seems to support my conclusion in (a). I attach one of my plots of [itex]|F(u)|[/itex] for this [itex]f(x)[/itex]. This was plotted with [itex]N=250[/itex] with (effectively) continuous [itex]u[/itex].

    c) If the inclusion of non-integral frequencies that are not representable on the discrete space is allowed, then this renders my argument in (a) irrelevant, because we're not worrying about whether the frequency can be represented on the discrete space.

    Thank you to anyone who takes the time to read this. I hope I've made my thoughts clear and explained what I mean well enough!
  2. jcsd
  3. Sep 19, 2016 #2


    User Avatar
    Science Advisor

    Your intuition with the minimum "gaps" between function values is sort of along the right track...

    However, keep in mind that the "step" width [itex]\delta[/itex] is, as you said, an arbitrary feature of your plotting convention. The function is only defined at exact points; there are no steps or sums of square waves. In fact, you can see from the (discrete) Fourier transform formula that ##F(u)## finds the weights of sinusoidal functions whose sum can be used to reconstruct ##f(x)## on the ##2N## points on which it is defined.
  4. Sep 20, 2016 #3

    Thank you for this. I was very tired when I wrote the post, and sleeping on it I also realised this myself!

    I suppose then, we don't need to worry about representing a given frequency on the discrete grid, and so any frequency can sensibly be plotted. The question of a suitable domain still remains. The periodic nature of [itex]F(u)[/itex] surely means that no particular section of it is more important than another, but then I obviously can't plot an infinite domain. The fact that [itex]F(u)[/itex] doesn't decrease in magnitude with increasing [itex]u[/itex] as a general trend is making me think I've made a mistake.
  5. Sep 20, 2016 #4


    User Avatar
    Science Advisor

    That's no mistake. Periodic sampling of [itex]f(x)[/itex] has made [itex]F(u)[/itex] periodic as you've discovered!
  6. Sep 20, 2016 #5
    Thank you! So finally, should I be considering a continuous u, or a discrete u? If discrete then what should the step size be?

    My thoughts are that it should be discrete, and the step size should be 1/2, this being because the so-called fundamental period of the system is 2*2N; twice the length of the discrete space. Since the sum has a factor of 1/(2N) in the exponential to account for the size of the space, and the fundamental frequency would be 1/(4N), we're left with the factor 1/2. Discrete, because typically a fourier transform plots only integer multiples of the fundamental frequency.
  7. Sep 20, 2016 #6


    User Avatar
    Science Advisor

    Right, the "discrete Fourier transform" is defined for discrete ##u## (the frequency is defined at samples of the continuous function which you plotted ).

    Note however that your function ##F(u)## in the frequency domain looks to be periodic with fundamental period 2N (not 2*2N).

    So what are you defining as the step size? Do you mean the difference between adjacent ##u##'s or between the actual frequencies (are they cyclic or radian?) that appear in the exponential, or what?
  8. Sep 21, 2016 #7
    After a bit more research, I've found that the DFT should be thought of as a unitary matrix that maps a vector from the real basis to the sine basis. This makes sense to me I think. From this I conclude that [itex]u\in\mathbb{Z}\in[0:2N[[/itex].
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted