Comments on: The DFT and the DTFT https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/?s_tid=feedtopost Retired from MathWorks in 2024 after 30 years of service. Can now be found at MATLAB Central, https://hornjourney.com, and https://matrixvalues.com. MathWorks career included image processing, toolbox development, MATLAB development and design, development team management, MATLAB design standards, Steve on Image Processing blog (https://blogs.mathworks.com/steve). Co-author of Digital Image Processing Using MATLAB (https://www.imageprocessingplace.com/DIPUM-3E/dipum3e_main_page.htm). French horn enthusiast, member of Concord Orchestra and Melrose Symphony, member of the board of Cormont Music and the Kendall Betts Horn Camp. Fri, 19 Mar 2010 01:01:34 +0000 hourly 1 https://wordpress.org/?v=6.2.2 By: Steve https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22878 Fri, 19 Mar 2010 01:01:34 +0000 https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22878 Fen—I think I misunderstood your comment about avoiding wrap-around error. Yes, when using the DFT to compute convolution, the inputs must be zero-padded by the proper amount. The reason is related to the condition I gave in this post on P. P must be at least as big as the nonzero domain of the output of the convolution, which is N+K-1 for convolution of an N-point sequence with a K-point sequence. Therefore the inputs must be zero-padded to at least N+K-1.

]]>
By: Steve https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22877 Thu, 18 Mar 2010 19:53:17 +0000 https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22877 Fen—I appreciate the encouragement, thanks. You are right that there is a different way to think about zero-padding when you are doing frequency-domain based filtering. I imagine I’ll get to that, but I’m not sure when. I touched briefly on windowing back in December, and I’ll come back to that topic again. I haven’t really thought much yet about how to talk about Gibbs phenomenon. Thanks for taking the time to make good suggestions.

]]>
By: Fen https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22876 Thu, 18 Mar 2010 18:49:28 +0000 https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22876 Hi Steve,

Thanks for this excellent series of blogs on the FT. I feel it’s one of those topics that cannot be revisited enough. I use the DFT in matlab a lot for image processing tasks but I can still manage to get confused about some of the concepts involved every so often.

I have a question so far- you mention here that zero-padding is effectively for increasing the sampling of the FT but isn’t it also for preventing ‘wraparound’ error when filtering too?

There’s also Gibbs phenomenon/ringing and widowwing to consider – I hope you can cover these too in the future.

This is a great resource your making. I’m looking forward to the rest.

Thanks,

Fen

]]>
By: Amit https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22870 Thu, 18 Mar 2010 14:55:25 +0000 https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22870 Thanks Steve ,i’ll try reading more on fft and using different scale factors

]]>
By: Steve https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22868 Thu, 18 Mar 2010 12:08:11 +0000 https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22868 Amit—I’m afraid I can’t help you with debugging your implementation of something you read in a research paper, but I can suggest that you go back and check all your assumptions. The MATLAB fft function computes the discrete Fourier transform (DFT). Sometimes different people use different formulas for the DFT. Most often the difference is in the scale factors used.

]]>
By: Steve https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22867 Thu, 18 Mar 2010 12:05:12 +0000 https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22867 OysterEngineer—Excellent questions and comments. I will follow up in additional blog posts.

]]>
By: Amit https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22863 Wed, 17 Mar 2010 19:00:58 +0000 https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22863 I am implementing a code from a paper and i am having trouble with the fft which is giving me very high values

[Long code fragment edited out. -SE]

The high value output from the fft is carried forward till my end result.

]]>
By: OysterEngineer https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22862 Wed, 17 Mar 2010 14:33:49 +0000 https://blogs.mathworks.com/steve/2010/03/15/the-dft-and-the-dtft/#comment-22862 I am enjoying this series of blogs & encourage you to continue. This latest entry was very helpful. I suspect that most users who use the fft function are really after a dft with good calculation performance & really don’t care how much of Cooley & Tukey’s genius is incorporated in the routine.

I think most users are happy to trust that World Class experts in signal processing have ensured that these functions in MatLab do the right thing & perform efficiently.

However, for folks like me who don’t have a graduate exposure to signal processing, I’m interested in an fft type function because I want some frequency domain insight into some real, time domain data. As such, the single detail that always trips me up is how to relate the output of the fft function to a vector of real frequencies that are meaningful to me. I’m not talking about the difference between Hertz & radians per second. I’m talking about how the frequencies are non-dimensionalized in the world of signal processing.

Both the FRP for fft & this blog entry are good examples of this issue. No where in this blog do you mention units at all. Your frequency vector w spans – / + 2pi, so most of us would assume it is radians per second. But, this isn’t specified and you don’t label the X axis of your plots. So, we are left guessing.

Lay users like me are further tripped up by this concept of negative frequencies. The FRP for fft is just as bad in that it only addresses the frequency issue by inference in the single example wherein they use the common shorthand of taking advantage of the complex-conjugate nature of the fft output, throw away last half of the fft output and generate a vector of only positive frequencies.

Certainly an fft function is more general & powerful than just for understanding frequency domain characteristics of time domain data, so it is appropriate for MatLab to provide this generality. However, since many, if not most, uses are for understanding time domain data, the FRP should address this frequency detail specifically.

Further, the FRP should include several more examples including ones that specifically demonstrate the effect of real vs complex input data.

]]>