{"id":309,"date":"2009-12-31T18:56:31","date_gmt":"2009-12-31T18:56:31","guid":{"rendered":"https:\/\/blogs.mathworks.com\/steve\/2009\/12\/31\/discrete-time-fourier-transform-dtft\/"},"modified":"2010-01-06T15:53:45","modified_gmt":"2010-01-06T15:53:45","slug":"discrete-time-fourier-transform-dtft","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/steve\/2009\/12\/31\/discrete-time-fourier-transform-dtft\/","title":{"rendered":"Discrete-time Fourier transform (DTFT)"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <p>In the last two posts in my <a href=\"https:\/\/blogs.mathworks.com\/steve\/category\/fourier-transforms\/\">Fourier transform series<\/a> I discussed the continuous-time Fourier transform. Today I want to start getting \"discrete\" by introducing the discrete-time\r\n      Fourier transform (DTFT).\r\n   <\/p>\r\n   <p>The DTFT is defined by this pair of transform equations:<\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq49753.png\"> <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq77253.png\"> <\/p>\r\n   <p>Here <i>x[n]<\/i> is a discrete sequence defined for all <i>n<\/i>:\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq46500.png\"> <\/p>\r\n   <p>I am following the notational convention (see <a href=\"http:\/\/www.amazon.com\/Discrete-Time-Signal-Processing-Prentice-Hall\/dp\/0131988425\/\">Oppenheim and Schafer, <i>Discrete-Time Signal Processing<\/i><\/a>) of using brackets to distinguish between a discrete sequence and a continuous-time function. <i>n<\/i> is unitless. The frequency-domain variable, <img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq84050.png\"> , is continuous with units of radians.\r\n   <\/p>\r\n   <p>Note that <img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq30711.png\">  is periodic with period <img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq03041.png\"> .\r\n   <\/p>\r\n   <p>Here are a few common transform pairs:<\/p>\r\n   <p><b>Unit Impulse<\/b><\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq39801.png\"> <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/delta[n].png\"> <\/p>\r\n   <p><b>DTFT of Unit Impulse<\/b><\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq14617.png\"> <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/F_delta[n].png\"> <\/p>\r\n   <p><b>Rectangular Pulse<\/b><\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq82693.png\"> <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/pulse[n].png\"> <\/p>\r\n   <p><b>DTFT of Rectangular Pulse<\/b><\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq63506.png\"> <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/F_pulse[n].png\"> <\/p>\r\n   <p>Note that the DTFT of a rectangular pulse is similar to but not exactly a sinc function.  It resembles the sinc function between\r\n      <img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq11410.png\">  and <img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq11731.png\"> , but recall that <img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq30711.png\">  is periodic, unlike the sinc function.\r\n   <\/p>\r\n   <p><b>Cosine<\/b><\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq44356.png\"> <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/cos[n].png\"> <\/p>\r\n   <p><b>DTFT of Cosine<\/b><\/p>\r\n   <p>The DTFT of a discrete cosine function is a periodic train of impulses:<\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq91371.png\"> <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/F_cos[n].png\"> <\/p>\r\n<p><em>I updated the above plot on 6-Jan-2010 to show the location of the impulses. -SE<\/em><\/p>\r\n   <p>Because of the periodicity of <img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq30711.png\">  it is very common when plotting the DTFT to plot it over the range of just one period: <img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/dtft_1_eq70601.png\"> . For example, the DTFT of the rectangular pulse will most often be shown like this:\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/steve\/2009\/F_one_period_pulse[n].png\"> <\/p>\r\n   <p>Next time I'll discuss the relationship between the continuous-time and the discrete-time Fourier transforms. Until then,\r\n      Happy New Year everyone!\r\n   <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_2f29f883dc4146afa4fcaef7076028cb() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='2f29f883dc4146afa4fcaef7076028cb ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 2f29f883dc4146afa4fcaef7076028cb';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = '';\r\n        copyright = 'Copyright 2009 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_2f29f883dc4146afa4fcaef7076028cb()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.9<br><\/p>\r\n<\/div>\r\n<!--\r\n2f29f883dc4146afa4fcaef7076028cb ##### SOURCE BEGIN #####\r\n%%\r\n% In the last two posts in my \r\n% <https:\/\/blogs.mathworks.com\/steve\/category\/fourier-transform\/ Fourier\r\n% transform series> I discussed the \r\n% continuous-time Fourier transform. Today I want to start getting \"discrete\" by\r\n% introducing the discrete-time Fourier transform (DTFT).\r\n%\r\n% The DTFT is defined by this pair of transform equations:\r\n%\r\n% $$X(\\omega) = \\sum_{n=-\\infty}^{\\infty} x[n] e^{-j\\omega n}$$\r\n%\r\n% $$x[n] = \\frac{1}{2\\pi} \\int_{-\\pi}^{\\pi} X(\\omega) e^{j\\omega n} d\\omega$$\r\n%\r\n% Here _x[n]_ is a discrete sequence defined for all _n_:\r\n%\r\n% $$x[n],\\;-\\infty < n < \\infty$$\r\n%\r\n% I am following the notational convention (see \r\n% <http:\/\/www.amazon.com\/Discrete-Time-Signal-Processing-Prentice-Hall\/dp\/0131988425\/ \r\n% Oppenheim and Schafer, _Discrete-Time Signal Processing_>) of using brackets to distinguish \r\n% between a discrete sequence and a continuous-time function. _n_ is unitless. The\r\n% frequency-domain variable, $\\omega$, is continuous with units of radians.\r\n%\r\n% Note that $X(\\omega)$ is periodic with period $2\\pi$.\r\n%\r\n% Here are a few common transform pairs:\r\n%\r\n% *Unit Impulse*\r\n%\r\n% $$x[n] = \\left\\{\\begin{array}{ll} 1, & n=0 \\\\ 0, & \\mbox{otherwise} \\end{array} \\right.$$\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2009\/delta[n].png>>\r\n%\r\n% *DTFT of Unit Impulse*\r\n%\r\n% $$X(\\omega) = 1$$\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2009\/F_delta[n].png>>\r\n%\r\n% *Rectangular Pulse*\r\n%\r\n% $$x[n] = \\left\\{\\begin{array}{ll} 1, & |n| \\leq N \\\\ 0, & \\mbox{otherwise}\r\n% \\end{array} \\right.$$\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2009\/pulse[n].png>>\r\n%\r\n% *DTFT of Rectangular Pulse*\r\n%\r\n% $$X(\\omega) = \\frac{\\sin\\left[\\omega(N +\r\n% \\frac{1}{2})\\right]}{\\sin(\\omega\/2)}$$\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2009\/F_pulse[n].png>>\r\n%\r\n% Note that the DTFT of a rectangular pulse is similar to but not exactly a sinc\r\n% function.  It resembles the sinc function between $-\\pi$ and $\\pi$, but recall\r\n% that $X(\\omega)$ is periodic, unlike the sinc function.\r\n%\r\n% *Cosine*\r\n%\r\n% $$x[n] = \\cos(\\omega_0 n)$$\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2009\/cos[n].png>>\r\n%\r\n% *DTFT of Cosine*\r\n%\r\n% The DTFT of a discrete cosine function is a periodic train of impulses:\r\n%\r\n% $$X(\\omega) = \\sum_{k=-\\infty}^{k=\\infty} \\pi [\\delta(\\omega - \\omega_0 + 2\\pi\r\n% k) + \\delta(\\omega + \\omega_0 + 2\\pi k)]$$\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2009\/F_cos[n].png>>\r\n%\r\n% Because of the periodicity of $X(\\omega)$ it is very common when plotting the\r\n% DTFT to plot it over the range of just one period: $-\\pi \\leq \\omega \\leq\r\n% \\pi$. For example, the DTFT of the rectangular pulse will most often be shown\r\n% like this:\r\n%\r\n% <<https:\/\/blogs.mathworks.com\/images\/steve\/2009\/F_one_period_pulse[n].png>>\r\n%\r\n% Next time I'll discuss the relationship between the continuous-time and the\r\n% discrete-time Fourier transforms. Until then, Happy New Year everyone!\r\n\r\n##### SOURCE END ##### 2f29f883dc4146afa4fcaef7076028cb\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   In the last two posts in my Fourier transform series I discussed the continuous-time Fourier transform. Today I want to start getting \"discrete\" by introducing the discrete-time\r\n      Fourier... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/steve\/2009\/12\/31\/discrete-time-fourier-transform-dtft\/\">read more >><\/a><\/p>","protected":false},"author":42,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[20],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/309"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/users\/42"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/comments?post=309"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/posts\/309\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/media?parent=309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/categories?post=309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/steve\/wp-json\/wp\/v2\/tags?post=309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}