DFT - Why are the definitions for inverse and forward commonly switched?












12












$begingroup$


Sometimes the forward DFT is defined with a negative sign in the exponent, sometimes with a positive one and occasionally with a $1/N$ coefficient. I see this all over the place online. I don’t see how the forward and the inverse are equivalent: at minimum they have opposite exponential signs and a $1/N$ factor in the inverse DFT.



What's the deal?










share|cite|improve this question











$endgroup$












  • $begingroup$
    They are never the same if the authors are not making a mistake. But you have to check their initial assumptions. Do they assume the sampling freq. in Hz or rad/s. Are they normalizing or not? These kind of nonstandard stuff cause different presentations of the material. Just derive one time and one time for all and try to obtain the rest by yourself. But you will never get the sign change in the exponential at least that part is settled as a convention.
    $endgroup$
    – user13838
    Aug 17 '11 at 21:21










  • $begingroup$
    Great response, thank you. Yes, I have derived it myself and settled on my own convention, it's simply frustrating. When you say "But you will never get the sign change in the exponential...", are you saying that DFT and DFT^-1 are both exp(+)?
    $endgroup$
    – nick_name
    Aug 17 '11 at 21:26










  • $begingroup$
    Oh no, sorry maybe I got it wrong. If you are asking why the inverse DFT has a sign change in the exponential, then the story is different. But keep in mind that it is essentially the same with the continuous version. Just plug in the forward DFT definition into the inverse DFT definition and you can see that it is clever to define that way.
    $endgroup$
    – user13838
    Aug 17 '11 at 21:35










  • $begingroup$
    Man, now I see what you mean. Excuse my stupidity. I forgot to mention that the inverse DFT can have a negative sign or positive because the signal is usually real valued. Hence the resulting DFT is symmetric with respect to zero. Therefore the sum doesn't change if you start from the left or right.
    $endgroup$
    – user13838
    Aug 17 '11 at 21:39










  • $begingroup$
    There we go! Thanks for the insightful response. :)
    $endgroup$
    – nick_name
    Aug 18 '11 at 7:55
















12












$begingroup$


Sometimes the forward DFT is defined with a negative sign in the exponent, sometimes with a positive one and occasionally with a $1/N$ coefficient. I see this all over the place online. I don’t see how the forward and the inverse are equivalent: at minimum they have opposite exponential signs and a $1/N$ factor in the inverse DFT.



What's the deal?










share|cite|improve this question











$endgroup$












  • $begingroup$
    They are never the same if the authors are not making a mistake. But you have to check their initial assumptions. Do they assume the sampling freq. in Hz or rad/s. Are they normalizing or not? These kind of nonstandard stuff cause different presentations of the material. Just derive one time and one time for all and try to obtain the rest by yourself. But you will never get the sign change in the exponential at least that part is settled as a convention.
    $endgroup$
    – user13838
    Aug 17 '11 at 21:21










  • $begingroup$
    Great response, thank you. Yes, I have derived it myself and settled on my own convention, it's simply frustrating. When you say "But you will never get the sign change in the exponential...", are you saying that DFT and DFT^-1 are both exp(+)?
    $endgroup$
    – nick_name
    Aug 17 '11 at 21:26










  • $begingroup$
    Oh no, sorry maybe I got it wrong. If you are asking why the inverse DFT has a sign change in the exponential, then the story is different. But keep in mind that it is essentially the same with the continuous version. Just plug in the forward DFT definition into the inverse DFT definition and you can see that it is clever to define that way.
    $endgroup$
    – user13838
    Aug 17 '11 at 21:35










  • $begingroup$
    Man, now I see what you mean. Excuse my stupidity. I forgot to mention that the inverse DFT can have a negative sign or positive because the signal is usually real valued. Hence the resulting DFT is symmetric with respect to zero. Therefore the sum doesn't change if you start from the left or right.
    $endgroup$
    – user13838
    Aug 17 '11 at 21:39










  • $begingroup$
    There we go! Thanks for the insightful response. :)
    $endgroup$
    – nick_name
    Aug 18 '11 at 7:55














12












12








12


5



$begingroup$


Sometimes the forward DFT is defined with a negative sign in the exponent, sometimes with a positive one and occasionally with a $1/N$ coefficient. I see this all over the place online. I don’t see how the forward and the inverse are equivalent: at minimum they have opposite exponential signs and a $1/N$ factor in the inverse DFT.



What's the deal?










share|cite|improve this question











$endgroup$




Sometimes the forward DFT is defined with a negative sign in the exponent, sometimes with a positive one and occasionally with a $1/N$ coefficient. I see this all over the place online. I don’t see how the forward and the inverse are equivalent: at minimum they have opposite exponential signs and a $1/N$ factor in the inverse DFT.



What's the deal?







fourier-analysis






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 15 '18 at 20:10









Alex Shpilkin

324315




324315










asked Aug 17 '11 at 21:06









nick_namenick_name

214311




214311












  • $begingroup$
    They are never the same if the authors are not making a mistake. But you have to check their initial assumptions. Do they assume the sampling freq. in Hz or rad/s. Are they normalizing or not? These kind of nonstandard stuff cause different presentations of the material. Just derive one time and one time for all and try to obtain the rest by yourself. But you will never get the sign change in the exponential at least that part is settled as a convention.
    $endgroup$
    – user13838
    Aug 17 '11 at 21:21










  • $begingroup$
    Great response, thank you. Yes, I have derived it myself and settled on my own convention, it's simply frustrating. When you say "But you will never get the sign change in the exponential...", are you saying that DFT and DFT^-1 are both exp(+)?
    $endgroup$
    – nick_name
    Aug 17 '11 at 21:26










  • $begingroup$
    Oh no, sorry maybe I got it wrong. If you are asking why the inverse DFT has a sign change in the exponential, then the story is different. But keep in mind that it is essentially the same with the continuous version. Just plug in the forward DFT definition into the inverse DFT definition and you can see that it is clever to define that way.
    $endgroup$
    – user13838
    Aug 17 '11 at 21:35










  • $begingroup$
    Man, now I see what you mean. Excuse my stupidity. I forgot to mention that the inverse DFT can have a negative sign or positive because the signal is usually real valued. Hence the resulting DFT is symmetric with respect to zero. Therefore the sum doesn't change if you start from the left or right.
    $endgroup$
    – user13838
    Aug 17 '11 at 21:39










  • $begingroup$
    There we go! Thanks for the insightful response. :)
    $endgroup$
    – nick_name
    Aug 18 '11 at 7:55


















  • $begingroup$
    They are never the same if the authors are not making a mistake. But you have to check their initial assumptions. Do they assume the sampling freq. in Hz or rad/s. Are they normalizing or not? These kind of nonstandard stuff cause different presentations of the material. Just derive one time and one time for all and try to obtain the rest by yourself. But you will never get the sign change in the exponential at least that part is settled as a convention.
    $endgroup$
    – user13838
    Aug 17 '11 at 21:21










  • $begingroup$
    Great response, thank you. Yes, I have derived it myself and settled on my own convention, it's simply frustrating. When you say "But you will never get the sign change in the exponential...", are you saying that DFT and DFT^-1 are both exp(+)?
    $endgroup$
    – nick_name
    Aug 17 '11 at 21:26










  • $begingroup$
    Oh no, sorry maybe I got it wrong. If you are asking why the inverse DFT has a sign change in the exponential, then the story is different. But keep in mind that it is essentially the same with the continuous version. Just plug in the forward DFT definition into the inverse DFT definition and you can see that it is clever to define that way.
    $endgroup$
    – user13838
    Aug 17 '11 at 21:35










  • $begingroup$
    Man, now I see what you mean. Excuse my stupidity. I forgot to mention that the inverse DFT can have a negative sign or positive because the signal is usually real valued. Hence the resulting DFT is symmetric with respect to zero. Therefore the sum doesn't change if you start from the left or right.
    $endgroup$
    – user13838
    Aug 17 '11 at 21:39










  • $begingroup$
    There we go! Thanks for the insightful response. :)
    $endgroup$
    – nick_name
    Aug 18 '11 at 7:55
















$begingroup$
They are never the same if the authors are not making a mistake. But you have to check their initial assumptions. Do they assume the sampling freq. in Hz or rad/s. Are they normalizing or not? These kind of nonstandard stuff cause different presentations of the material. Just derive one time and one time for all and try to obtain the rest by yourself. But you will never get the sign change in the exponential at least that part is settled as a convention.
$endgroup$
– user13838
Aug 17 '11 at 21:21




$begingroup$
They are never the same if the authors are not making a mistake. But you have to check their initial assumptions. Do they assume the sampling freq. in Hz or rad/s. Are they normalizing or not? These kind of nonstandard stuff cause different presentations of the material. Just derive one time and one time for all and try to obtain the rest by yourself. But you will never get the sign change in the exponential at least that part is settled as a convention.
$endgroup$
– user13838
Aug 17 '11 at 21:21












$begingroup$
Great response, thank you. Yes, I have derived it myself and settled on my own convention, it's simply frustrating. When you say "But you will never get the sign change in the exponential...", are you saying that DFT and DFT^-1 are both exp(+)?
$endgroup$
– nick_name
Aug 17 '11 at 21:26




$begingroup$
Great response, thank you. Yes, I have derived it myself and settled on my own convention, it's simply frustrating. When you say "But you will never get the sign change in the exponential...", are you saying that DFT and DFT^-1 are both exp(+)?
$endgroup$
– nick_name
Aug 17 '11 at 21:26












$begingroup$
Oh no, sorry maybe I got it wrong. If you are asking why the inverse DFT has a sign change in the exponential, then the story is different. But keep in mind that it is essentially the same with the continuous version. Just plug in the forward DFT definition into the inverse DFT definition and you can see that it is clever to define that way.
$endgroup$
– user13838
Aug 17 '11 at 21:35




$begingroup$
Oh no, sorry maybe I got it wrong. If you are asking why the inverse DFT has a sign change in the exponential, then the story is different. But keep in mind that it is essentially the same with the continuous version. Just plug in the forward DFT definition into the inverse DFT definition and you can see that it is clever to define that way.
$endgroup$
– user13838
Aug 17 '11 at 21:35












$begingroup$
Man, now I see what you mean. Excuse my stupidity. I forgot to mention that the inverse DFT can have a negative sign or positive because the signal is usually real valued. Hence the resulting DFT is symmetric with respect to zero. Therefore the sum doesn't change if you start from the left or right.
$endgroup$
– user13838
Aug 17 '11 at 21:39




$begingroup$
Man, now I see what you mean. Excuse my stupidity. I forgot to mention that the inverse DFT can have a negative sign or positive because the signal is usually real valued. Hence the resulting DFT is symmetric with respect to zero. Therefore the sum doesn't change if you start from the left or right.
$endgroup$
– user13838
Aug 17 '11 at 21:39












$begingroup$
There we go! Thanks for the insightful response. :)
$endgroup$
– nick_name
Aug 18 '11 at 7:55




$begingroup$
There we go! Thanks for the insightful response. :)
$endgroup$
– nick_name
Aug 18 '11 at 7:55










2 Answers
2






active

oldest

votes


















7












$begingroup$

Simply convention. The Wikipedia gets it quite right:




... the normalization factor multiplying the DFT and IDFT (here 1 and
1/N) and the signs of the exponents are merely conventions, and differ
in some treatments. The only requirements of these conventions are
that the DFT and IDFT have opposite-sign exponents and that the
product of their normalization factors be 1/N.



A normalization of $1/sqrt{N}$ for both the DFT and IDFT makes the transforms unitary,
which has some theoretical advantages, but it is often more practical in numerical
computation to perform the scaling all at once as above (and a unit
scaling can be convenient in other ways).



(The convention of a negative sign in the exponent is often convenient because it means
that X_k is the amplitude of a "positive frequency" 2πk / N.
Equivalently, the DFT is often thought of as a matched filter: when
looking for a frequency of +1, one correlates the incoming signal with
a frequency of −1.)




Regarding the last paragraph, about exponent signs: that means that the common convention of having negative exponents in the DFT (which might appear a little unnatural) looks natural when we think our signal as a juxtaposition (linear combination) of sinusoids (complex exponentials). And this corresponds to the IDFT equation (which, in this convention, will have positive exponents) :



$$x[n] = sum_k X(k) ; exp{(i 2 pi k n /N)}$$



... so that $X(k)$ is the "weight" associated with the sinusoid of frequency $k$. In other words, the convention looks natural when we think in terms of synthesis rather than analysis.



Regarding the normalization factor: The convention is less universal here, in my experience. I actually tend to divide by $N$ in the DFT, so that the Fourier transform at frequency zero gives the average value of the signal (the "DC component"). It's true that using $1/sqrt{N}$ makes everything more mathematically elegant (DFT is a unitary transform, and the inverse is just the Hermitian transpose), but this is seldom useful in numerical work.






share|cite|improve this answer











$endgroup$













  • $begingroup$
    It might prove illustrative if somebody shows an instance where the convention is to have "-" for the forward transform, and another instance where "+" is the forward transform. That being said, the convention I'm used to has "-" as the forward transform. Mathematica is the only system I've seen so far that conventionally normalizes by $frac1{sqrt N}$...
    $endgroup$
    – J. M. is not a mathematician
    Aug 29 '11 at 1:40










  • $begingroup$
    Actually, I don't recall + for the forward transform in the usual context of the transform (time <-> frecuency). In other contexts, one might argue that, in probability, the "characteristic function" is a forward Fourier transform with positive exponent, for example. en.wikipedia.org/wiki/…
    $endgroup$
    – leonbloy
    Aug 29 '11 at 1:59








  • 1




    $begingroup$
    Putting the 1/N factor on the inverse DFT is convenient for computing convolution using the frequency domain. Otherwise you'd have to track the number of 1/N terms multiplied and scale accordingly. Also, 1/N corresponds to Δf in the Riemann sum approximation of the inverse Discrete-Time Fourier Transform (DTFT).
    $endgroup$
    – eryksun
    May 11 '12 at 4:15










  • $begingroup$
    The $1/N$ factor properly belongs not with the FT as such, but with the measure you choose on your domain—the finite group $mathbf Z/nmathbf Z$: either the counting one (treating it as a discrete group, like $mathbf Z$) or the normalized one (treating it as a compact group, like $mathbf Tequivmathbf R/2pimathbf Z$). The general theory tells you the FT switches discrete and compact groups with their standard measures, but it doesn’t tell you which to choose. The $1/sqrt N$ normalization is pretty, but does not tie into this at all AFAIK.
    $endgroup$
    – Alex Shpilkin
    Dec 15 '18 at 20:27





















3












$begingroup$

Not using a negative exp in the definition of the forward DFT is a really bad idea. I know that Numerical Recipes uses a positive exp, but it's still a bad idea. I fear that most uses of the positive exp can be traced to be influenced by Numerical Recipes (*).



Whether you include the 1/N term in the forward or backward transform or not at all is really just a convention. There are at least two good reasons to not include the 1/N term:




  1. The FFTW library is a de facto reference implementation of the FFT, and it doesn't include the 1/N term.

  2. It would be unclear whether it should be included in the forward or backward transform, and hence a constant source of confusion.


Another reason in favor of not including the 1/N term is that it has become common practice (**) to define the (continuous) Fourier transform in a way that no normalization factors are needed (by using the frequency $xi$ instead of the angular frequency $omega$):



$hat{f}(xi) = int_{-infty}^{infty} f(x) e^{- 2pi i x xi},dx$



$f(x) = int_{-infty}^{infty} hat{f}(xi) e^{2 pi i x xi},dxi$



So omitting the 1/N term from the DFT makes the definition look more similar to the continuous case. However, I have to admit that I have the habit of including the 1/N factor in the forward transform, because then the DFT of a constant function is independent of N.



(*)
You probably don't believe me ("It's just a convention, why should it matter?"), but I recently googled for NFFT (nonequispaced FFT) and read some of the related papers. One of the authors used the positive exp in his thesis, but changed to the negative exp in later papers and presentations. While reading one of his later presentations, I was surprised by the amount of sign mistakes and surprising differences in sign conventions between closely related definitions.



(**) I think this change must have occurred only in the last few years. Wikipedia claims that the mathematics literature always used the "frequency convention" and only the physics literature used the "angular frequency convention", but this doesn't match with my own experience.






share|cite|improve this answer











$endgroup$













    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f58163%2fdft-why-are-the-definitions-for-inverse-and-forward-commonly-switched%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    7












    $begingroup$

    Simply convention. The Wikipedia gets it quite right:




    ... the normalization factor multiplying the DFT and IDFT (here 1 and
    1/N) and the signs of the exponents are merely conventions, and differ
    in some treatments. The only requirements of these conventions are
    that the DFT and IDFT have opposite-sign exponents and that the
    product of their normalization factors be 1/N.



    A normalization of $1/sqrt{N}$ for both the DFT and IDFT makes the transforms unitary,
    which has some theoretical advantages, but it is often more practical in numerical
    computation to perform the scaling all at once as above (and a unit
    scaling can be convenient in other ways).



    (The convention of a negative sign in the exponent is often convenient because it means
    that X_k is the amplitude of a "positive frequency" 2πk / N.
    Equivalently, the DFT is often thought of as a matched filter: when
    looking for a frequency of +1, one correlates the incoming signal with
    a frequency of −1.)




    Regarding the last paragraph, about exponent signs: that means that the common convention of having negative exponents in the DFT (which might appear a little unnatural) looks natural when we think our signal as a juxtaposition (linear combination) of sinusoids (complex exponentials). And this corresponds to the IDFT equation (which, in this convention, will have positive exponents) :



    $$x[n] = sum_k X(k) ; exp{(i 2 pi k n /N)}$$



    ... so that $X(k)$ is the "weight" associated with the sinusoid of frequency $k$. In other words, the convention looks natural when we think in terms of synthesis rather than analysis.



    Regarding the normalization factor: The convention is less universal here, in my experience. I actually tend to divide by $N$ in the DFT, so that the Fourier transform at frequency zero gives the average value of the signal (the "DC component"). It's true that using $1/sqrt{N}$ makes everything more mathematically elegant (DFT is a unitary transform, and the inverse is just the Hermitian transpose), but this is seldom useful in numerical work.






    share|cite|improve this answer











    $endgroup$













    • $begingroup$
      It might prove illustrative if somebody shows an instance where the convention is to have "-" for the forward transform, and another instance where "+" is the forward transform. That being said, the convention I'm used to has "-" as the forward transform. Mathematica is the only system I've seen so far that conventionally normalizes by $frac1{sqrt N}$...
      $endgroup$
      – J. M. is not a mathematician
      Aug 29 '11 at 1:40










    • $begingroup$
      Actually, I don't recall + for the forward transform in the usual context of the transform (time <-> frecuency). In other contexts, one might argue that, in probability, the "characteristic function" is a forward Fourier transform with positive exponent, for example. en.wikipedia.org/wiki/…
      $endgroup$
      – leonbloy
      Aug 29 '11 at 1:59








    • 1




      $begingroup$
      Putting the 1/N factor on the inverse DFT is convenient for computing convolution using the frequency domain. Otherwise you'd have to track the number of 1/N terms multiplied and scale accordingly. Also, 1/N corresponds to Δf in the Riemann sum approximation of the inverse Discrete-Time Fourier Transform (DTFT).
      $endgroup$
      – eryksun
      May 11 '12 at 4:15










    • $begingroup$
      The $1/N$ factor properly belongs not with the FT as such, but with the measure you choose on your domain—the finite group $mathbf Z/nmathbf Z$: either the counting one (treating it as a discrete group, like $mathbf Z$) or the normalized one (treating it as a compact group, like $mathbf Tequivmathbf R/2pimathbf Z$). The general theory tells you the FT switches discrete and compact groups with their standard measures, but it doesn’t tell you which to choose. The $1/sqrt N$ normalization is pretty, but does not tie into this at all AFAIK.
      $endgroup$
      – Alex Shpilkin
      Dec 15 '18 at 20:27


















    7












    $begingroup$

    Simply convention. The Wikipedia gets it quite right:




    ... the normalization factor multiplying the DFT and IDFT (here 1 and
    1/N) and the signs of the exponents are merely conventions, and differ
    in some treatments. The only requirements of these conventions are
    that the DFT and IDFT have opposite-sign exponents and that the
    product of their normalization factors be 1/N.



    A normalization of $1/sqrt{N}$ for both the DFT and IDFT makes the transforms unitary,
    which has some theoretical advantages, but it is often more practical in numerical
    computation to perform the scaling all at once as above (and a unit
    scaling can be convenient in other ways).



    (The convention of a negative sign in the exponent is often convenient because it means
    that X_k is the amplitude of a "positive frequency" 2πk / N.
    Equivalently, the DFT is often thought of as a matched filter: when
    looking for a frequency of +1, one correlates the incoming signal with
    a frequency of −1.)




    Regarding the last paragraph, about exponent signs: that means that the common convention of having negative exponents in the DFT (which might appear a little unnatural) looks natural when we think our signal as a juxtaposition (linear combination) of sinusoids (complex exponentials). And this corresponds to the IDFT equation (which, in this convention, will have positive exponents) :



    $$x[n] = sum_k X(k) ; exp{(i 2 pi k n /N)}$$



    ... so that $X(k)$ is the "weight" associated with the sinusoid of frequency $k$. In other words, the convention looks natural when we think in terms of synthesis rather than analysis.



    Regarding the normalization factor: The convention is less universal here, in my experience. I actually tend to divide by $N$ in the DFT, so that the Fourier transform at frequency zero gives the average value of the signal (the "DC component"). It's true that using $1/sqrt{N}$ makes everything more mathematically elegant (DFT is a unitary transform, and the inverse is just the Hermitian transpose), but this is seldom useful in numerical work.






    share|cite|improve this answer











    $endgroup$













    • $begingroup$
      It might prove illustrative if somebody shows an instance where the convention is to have "-" for the forward transform, and another instance where "+" is the forward transform. That being said, the convention I'm used to has "-" as the forward transform. Mathematica is the only system I've seen so far that conventionally normalizes by $frac1{sqrt N}$...
      $endgroup$
      – J. M. is not a mathematician
      Aug 29 '11 at 1:40










    • $begingroup$
      Actually, I don't recall + for the forward transform in the usual context of the transform (time <-> frecuency). In other contexts, one might argue that, in probability, the "characteristic function" is a forward Fourier transform with positive exponent, for example. en.wikipedia.org/wiki/…
      $endgroup$
      – leonbloy
      Aug 29 '11 at 1:59








    • 1




      $begingroup$
      Putting the 1/N factor on the inverse DFT is convenient for computing convolution using the frequency domain. Otherwise you'd have to track the number of 1/N terms multiplied and scale accordingly. Also, 1/N corresponds to Δf in the Riemann sum approximation of the inverse Discrete-Time Fourier Transform (DTFT).
      $endgroup$
      – eryksun
      May 11 '12 at 4:15










    • $begingroup$
      The $1/N$ factor properly belongs not with the FT as such, but with the measure you choose on your domain—the finite group $mathbf Z/nmathbf Z$: either the counting one (treating it as a discrete group, like $mathbf Z$) or the normalized one (treating it as a compact group, like $mathbf Tequivmathbf R/2pimathbf Z$). The general theory tells you the FT switches discrete and compact groups with their standard measures, but it doesn’t tell you which to choose. The $1/sqrt N$ normalization is pretty, but does not tie into this at all AFAIK.
      $endgroup$
      – Alex Shpilkin
      Dec 15 '18 at 20:27
















    7












    7








    7





    $begingroup$

    Simply convention. The Wikipedia gets it quite right:




    ... the normalization factor multiplying the DFT and IDFT (here 1 and
    1/N) and the signs of the exponents are merely conventions, and differ
    in some treatments. The only requirements of these conventions are
    that the DFT and IDFT have opposite-sign exponents and that the
    product of their normalization factors be 1/N.



    A normalization of $1/sqrt{N}$ for both the DFT and IDFT makes the transforms unitary,
    which has some theoretical advantages, but it is often more practical in numerical
    computation to perform the scaling all at once as above (and a unit
    scaling can be convenient in other ways).



    (The convention of a negative sign in the exponent is often convenient because it means
    that X_k is the amplitude of a "positive frequency" 2πk / N.
    Equivalently, the DFT is often thought of as a matched filter: when
    looking for a frequency of +1, one correlates the incoming signal with
    a frequency of −1.)




    Regarding the last paragraph, about exponent signs: that means that the common convention of having negative exponents in the DFT (which might appear a little unnatural) looks natural when we think our signal as a juxtaposition (linear combination) of sinusoids (complex exponentials). And this corresponds to the IDFT equation (which, in this convention, will have positive exponents) :



    $$x[n] = sum_k X(k) ; exp{(i 2 pi k n /N)}$$



    ... so that $X(k)$ is the "weight" associated with the sinusoid of frequency $k$. In other words, the convention looks natural when we think in terms of synthesis rather than analysis.



    Regarding the normalization factor: The convention is less universal here, in my experience. I actually tend to divide by $N$ in the DFT, so that the Fourier transform at frequency zero gives the average value of the signal (the "DC component"). It's true that using $1/sqrt{N}$ makes everything more mathematically elegant (DFT is a unitary transform, and the inverse is just the Hermitian transpose), but this is seldom useful in numerical work.






    share|cite|improve this answer











    $endgroup$



    Simply convention. The Wikipedia gets it quite right:




    ... the normalization factor multiplying the DFT and IDFT (here 1 and
    1/N) and the signs of the exponents are merely conventions, and differ
    in some treatments. The only requirements of these conventions are
    that the DFT and IDFT have opposite-sign exponents and that the
    product of their normalization factors be 1/N.



    A normalization of $1/sqrt{N}$ for both the DFT and IDFT makes the transforms unitary,
    which has some theoretical advantages, but it is often more practical in numerical
    computation to perform the scaling all at once as above (and a unit
    scaling can be convenient in other ways).



    (The convention of a negative sign in the exponent is often convenient because it means
    that X_k is the amplitude of a "positive frequency" 2πk / N.
    Equivalently, the DFT is often thought of as a matched filter: when
    looking for a frequency of +1, one correlates the incoming signal with
    a frequency of −1.)




    Regarding the last paragraph, about exponent signs: that means that the common convention of having negative exponents in the DFT (which might appear a little unnatural) looks natural when we think our signal as a juxtaposition (linear combination) of sinusoids (complex exponentials). And this corresponds to the IDFT equation (which, in this convention, will have positive exponents) :



    $$x[n] = sum_k X(k) ; exp{(i 2 pi k n /N)}$$



    ... so that $X(k)$ is the "weight" associated with the sinusoid of frequency $k$. In other words, the convention looks natural when we think in terms of synthesis rather than analysis.



    Regarding the normalization factor: The convention is less universal here, in my experience. I actually tend to divide by $N$ in the DFT, so that the Fourier transform at frequency zero gives the average value of the signal (the "DC component"). It's true that using $1/sqrt{N}$ makes everything more mathematically elegant (DFT is a unitary transform, and the inverse is just the Hermitian transpose), but this is seldom useful in numerical work.







    share|cite|improve this answer














    share|cite|improve this answer



    share|cite|improve this answer








    edited Sep 21 '18 at 1:59

























    answered Aug 28 '11 at 23:56









    leonbloyleonbloy

    41.5k647108




    41.5k647108












    • $begingroup$
      It might prove illustrative if somebody shows an instance where the convention is to have "-" for the forward transform, and another instance where "+" is the forward transform. That being said, the convention I'm used to has "-" as the forward transform. Mathematica is the only system I've seen so far that conventionally normalizes by $frac1{sqrt N}$...
      $endgroup$
      – J. M. is not a mathematician
      Aug 29 '11 at 1:40










    • $begingroup$
      Actually, I don't recall + for the forward transform in the usual context of the transform (time <-> frecuency). In other contexts, one might argue that, in probability, the "characteristic function" is a forward Fourier transform with positive exponent, for example. en.wikipedia.org/wiki/…
      $endgroup$
      – leonbloy
      Aug 29 '11 at 1:59








    • 1




      $begingroup$
      Putting the 1/N factor on the inverse DFT is convenient for computing convolution using the frequency domain. Otherwise you'd have to track the number of 1/N terms multiplied and scale accordingly. Also, 1/N corresponds to Δf in the Riemann sum approximation of the inverse Discrete-Time Fourier Transform (DTFT).
      $endgroup$
      – eryksun
      May 11 '12 at 4:15










    • $begingroup$
      The $1/N$ factor properly belongs not with the FT as such, but with the measure you choose on your domain—the finite group $mathbf Z/nmathbf Z$: either the counting one (treating it as a discrete group, like $mathbf Z$) or the normalized one (treating it as a compact group, like $mathbf Tequivmathbf R/2pimathbf Z$). The general theory tells you the FT switches discrete and compact groups with their standard measures, but it doesn’t tell you which to choose. The $1/sqrt N$ normalization is pretty, but does not tie into this at all AFAIK.
      $endgroup$
      – Alex Shpilkin
      Dec 15 '18 at 20:27




















    • $begingroup$
      It might prove illustrative if somebody shows an instance where the convention is to have "-" for the forward transform, and another instance where "+" is the forward transform. That being said, the convention I'm used to has "-" as the forward transform. Mathematica is the only system I've seen so far that conventionally normalizes by $frac1{sqrt N}$...
      $endgroup$
      – J. M. is not a mathematician
      Aug 29 '11 at 1:40










    • $begingroup$
      Actually, I don't recall + for the forward transform in the usual context of the transform (time <-> frecuency). In other contexts, one might argue that, in probability, the "characteristic function" is a forward Fourier transform with positive exponent, for example. en.wikipedia.org/wiki/…
      $endgroup$
      – leonbloy
      Aug 29 '11 at 1:59








    • 1




      $begingroup$
      Putting the 1/N factor on the inverse DFT is convenient for computing convolution using the frequency domain. Otherwise you'd have to track the number of 1/N terms multiplied and scale accordingly. Also, 1/N corresponds to Δf in the Riemann sum approximation of the inverse Discrete-Time Fourier Transform (DTFT).
      $endgroup$
      – eryksun
      May 11 '12 at 4:15










    • $begingroup$
      The $1/N$ factor properly belongs not with the FT as such, but with the measure you choose on your domain—the finite group $mathbf Z/nmathbf Z$: either the counting one (treating it as a discrete group, like $mathbf Z$) or the normalized one (treating it as a compact group, like $mathbf Tequivmathbf R/2pimathbf Z$). The general theory tells you the FT switches discrete and compact groups with their standard measures, but it doesn’t tell you which to choose. The $1/sqrt N$ normalization is pretty, but does not tie into this at all AFAIK.
      $endgroup$
      – Alex Shpilkin
      Dec 15 '18 at 20:27


















    $begingroup$
    It might prove illustrative if somebody shows an instance where the convention is to have "-" for the forward transform, and another instance where "+" is the forward transform. That being said, the convention I'm used to has "-" as the forward transform. Mathematica is the only system I've seen so far that conventionally normalizes by $frac1{sqrt N}$...
    $endgroup$
    – J. M. is not a mathematician
    Aug 29 '11 at 1:40




    $begingroup$
    It might prove illustrative if somebody shows an instance where the convention is to have "-" for the forward transform, and another instance where "+" is the forward transform. That being said, the convention I'm used to has "-" as the forward transform. Mathematica is the only system I've seen so far that conventionally normalizes by $frac1{sqrt N}$...
    $endgroup$
    – J. M. is not a mathematician
    Aug 29 '11 at 1:40












    $begingroup$
    Actually, I don't recall + for the forward transform in the usual context of the transform (time <-> frecuency). In other contexts, one might argue that, in probability, the "characteristic function" is a forward Fourier transform with positive exponent, for example. en.wikipedia.org/wiki/…
    $endgroup$
    – leonbloy
    Aug 29 '11 at 1:59






    $begingroup$
    Actually, I don't recall + for the forward transform in the usual context of the transform (time <-> frecuency). In other contexts, one might argue that, in probability, the "characteristic function" is a forward Fourier transform with positive exponent, for example. en.wikipedia.org/wiki/…
    $endgroup$
    – leonbloy
    Aug 29 '11 at 1:59






    1




    1




    $begingroup$
    Putting the 1/N factor on the inverse DFT is convenient for computing convolution using the frequency domain. Otherwise you'd have to track the number of 1/N terms multiplied and scale accordingly. Also, 1/N corresponds to Δf in the Riemann sum approximation of the inverse Discrete-Time Fourier Transform (DTFT).
    $endgroup$
    – eryksun
    May 11 '12 at 4:15




    $begingroup$
    Putting the 1/N factor on the inverse DFT is convenient for computing convolution using the frequency domain. Otherwise you'd have to track the number of 1/N terms multiplied and scale accordingly. Also, 1/N corresponds to Δf in the Riemann sum approximation of the inverse Discrete-Time Fourier Transform (DTFT).
    $endgroup$
    – eryksun
    May 11 '12 at 4:15












    $begingroup$
    The $1/N$ factor properly belongs not with the FT as such, but with the measure you choose on your domain—the finite group $mathbf Z/nmathbf Z$: either the counting one (treating it as a discrete group, like $mathbf Z$) or the normalized one (treating it as a compact group, like $mathbf Tequivmathbf R/2pimathbf Z$). The general theory tells you the FT switches discrete and compact groups with their standard measures, but it doesn’t tell you which to choose. The $1/sqrt N$ normalization is pretty, but does not tie into this at all AFAIK.
    $endgroup$
    – Alex Shpilkin
    Dec 15 '18 at 20:27






    $begingroup$
    The $1/N$ factor properly belongs not with the FT as such, but with the measure you choose on your domain—the finite group $mathbf Z/nmathbf Z$: either the counting one (treating it as a discrete group, like $mathbf Z$) or the normalized one (treating it as a compact group, like $mathbf Tequivmathbf R/2pimathbf Z$). The general theory tells you the FT switches discrete and compact groups with their standard measures, but it doesn’t tell you which to choose. The $1/sqrt N$ normalization is pretty, but does not tie into this at all AFAIK.
    $endgroup$
    – Alex Shpilkin
    Dec 15 '18 at 20:27













    3












    $begingroup$

    Not using a negative exp in the definition of the forward DFT is a really bad idea. I know that Numerical Recipes uses a positive exp, but it's still a bad idea. I fear that most uses of the positive exp can be traced to be influenced by Numerical Recipes (*).



    Whether you include the 1/N term in the forward or backward transform or not at all is really just a convention. There are at least two good reasons to not include the 1/N term:




    1. The FFTW library is a de facto reference implementation of the FFT, and it doesn't include the 1/N term.

    2. It would be unclear whether it should be included in the forward or backward transform, and hence a constant source of confusion.


    Another reason in favor of not including the 1/N term is that it has become common practice (**) to define the (continuous) Fourier transform in a way that no normalization factors are needed (by using the frequency $xi$ instead of the angular frequency $omega$):



    $hat{f}(xi) = int_{-infty}^{infty} f(x) e^{- 2pi i x xi},dx$



    $f(x) = int_{-infty}^{infty} hat{f}(xi) e^{2 pi i x xi},dxi$



    So omitting the 1/N term from the DFT makes the definition look more similar to the continuous case. However, I have to admit that I have the habit of including the 1/N factor in the forward transform, because then the DFT of a constant function is independent of N.



    (*)
    You probably don't believe me ("It's just a convention, why should it matter?"), but I recently googled for NFFT (nonequispaced FFT) and read some of the related papers. One of the authors used the positive exp in his thesis, but changed to the negative exp in later papers and presentations. While reading one of his later presentations, I was surprised by the amount of sign mistakes and surprising differences in sign conventions between closely related definitions.



    (**) I think this change must have occurred only in the last few years. Wikipedia claims that the mathematics literature always used the "frequency convention" and only the physics literature used the "angular frequency convention", but this doesn't match with my own experience.






    share|cite|improve this answer











    $endgroup$


















      3












      $begingroup$

      Not using a negative exp in the definition of the forward DFT is a really bad idea. I know that Numerical Recipes uses a positive exp, but it's still a bad idea. I fear that most uses of the positive exp can be traced to be influenced by Numerical Recipes (*).



      Whether you include the 1/N term in the forward or backward transform or not at all is really just a convention. There are at least two good reasons to not include the 1/N term:




      1. The FFTW library is a de facto reference implementation of the FFT, and it doesn't include the 1/N term.

      2. It would be unclear whether it should be included in the forward or backward transform, and hence a constant source of confusion.


      Another reason in favor of not including the 1/N term is that it has become common practice (**) to define the (continuous) Fourier transform in a way that no normalization factors are needed (by using the frequency $xi$ instead of the angular frequency $omega$):



      $hat{f}(xi) = int_{-infty}^{infty} f(x) e^{- 2pi i x xi},dx$



      $f(x) = int_{-infty}^{infty} hat{f}(xi) e^{2 pi i x xi},dxi$



      So omitting the 1/N term from the DFT makes the definition look more similar to the continuous case. However, I have to admit that I have the habit of including the 1/N factor in the forward transform, because then the DFT of a constant function is independent of N.



      (*)
      You probably don't believe me ("It's just a convention, why should it matter?"), but I recently googled for NFFT (nonequispaced FFT) and read some of the related papers. One of the authors used the positive exp in his thesis, but changed to the negative exp in later papers and presentations. While reading one of his later presentations, I was surprised by the amount of sign mistakes and surprising differences in sign conventions between closely related definitions.



      (**) I think this change must have occurred only in the last few years. Wikipedia claims that the mathematics literature always used the "frequency convention" and only the physics literature used the "angular frequency convention", but this doesn't match with my own experience.






      share|cite|improve this answer











      $endgroup$
















        3












        3








        3





        $begingroup$

        Not using a negative exp in the definition of the forward DFT is a really bad idea. I know that Numerical Recipes uses a positive exp, but it's still a bad idea. I fear that most uses of the positive exp can be traced to be influenced by Numerical Recipes (*).



        Whether you include the 1/N term in the forward or backward transform or not at all is really just a convention. There are at least two good reasons to not include the 1/N term:




        1. The FFTW library is a de facto reference implementation of the FFT, and it doesn't include the 1/N term.

        2. It would be unclear whether it should be included in the forward or backward transform, and hence a constant source of confusion.


        Another reason in favor of not including the 1/N term is that it has become common practice (**) to define the (continuous) Fourier transform in a way that no normalization factors are needed (by using the frequency $xi$ instead of the angular frequency $omega$):



        $hat{f}(xi) = int_{-infty}^{infty} f(x) e^{- 2pi i x xi},dx$



        $f(x) = int_{-infty}^{infty} hat{f}(xi) e^{2 pi i x xi},dxi$



        So omitting the 1/N term from the DFT makes the definition look more similar to the continuous case. However, I have to admit that I have the habit of including the 1/N factor in the forward transform, because then the DFT of a constant function is independent of N.



        (*)
        You probably don't believe me ("It's just a convention, why should it matter?"), but I recently googled for NFFT (nonequispaced FFT) and read some of the related papers. One of the authors used the positive exp in his thesis, but changed to the negative exp in later papers and presentations. While reading one of his later presentations, I was surprised by the amount of sign mistakes and surprising differences in sign conventions between closely related definitions.



        (**) I think this change must have occurred only in the last few years. Wikipedia claims that the mathematics literature always used the "frequency convention" and only the physics literature used the "angular frequency convention", but this doesn't match with my own experience.






        share|cite|improve this answer











        $endgroup$



        Not using a negative exp in the definition of the forward DFT is a really bad idea. I know that Numerical Recipes uses a positive exp, but it's still a bad idea. I fear that most uses of the positive exp can be traced to be influenced by Numerical Recipes (*).



        Whether you include the 1/N term in the forward or backward transform or not at all is really just a convention. There are at least two good reasons to not include the 1/N term:




        1. The FFTW library is a de facto reference implementation of the FFT, and it doesn't include the 1/N term.

        2. It would be unclear whether it should be included in the forward or backward transform, and hence a constant source of confusion.


        Another reason in favor of not including the 1/N term is that it has become common practice (**) to define the (continuous) Fourier transform in a way that no normalization factors are needed (by using the frequency $xi$ instead of the angular frequency $omega$):



        $hat{f}(xi) = int_{-infty}^{infty} f(x) e^{- 2pi i x xi},dx$



        $f(x) = int_{-infty}^{infty} hat{f}(xi) e^{2 pi i x xi},dxi$



        So omitting the 1/N term from the DFT makes the definition look more similar to the continuous case. However, I have to admit that I have the habit of including the 1/N factor in the forward transform, because then the DFT of a constant function is independent of N.



        (*)
        You probably don't believe me ("It's just a convention, why should it matter?"), but I recently googled for NFFT (nonequispaced FFT) and read some of the related papers. One of the authors used the positive exp in his thesis, but changed to the negative exp in later papers and presentations. While reading one of his later presentations, I was surprised by the amount of sign mistakes and surprising differences in sign conventions between closely related definitions.



        (**) I think this change must have occurred only in the last few years. Wikipedia claims that the mathematics literature always used the "frequency convention" and only the physics literature used the "angular frequency convention", but this doesn't match with my own experience.







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Aug 28 '11 at 23:25


























        community wiki





        2 revs
        Thomas Klimpel































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f58163%2fdft-why-are-the-definitions-for-inverse-and-forward-commonly-switched%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Bundesstraße 106

            Verónica Boquete

            Ida-Boy-Ed-Garten