MATLAB-function that calculates discrete Fourier transform

1 次查看(过去 30 天)
Hello,
I have to write a MATLAB-function that calculates the discrete Fourier transform and the inverse Fourier transform of a vector.
The input consists of a vector of length 2^N, where N is a natural number, so the length of the vector is a power of 2. I am not allowed to use functions like fft and ifft.
I have no idea how to start.
Thanks in advance!
  2 个评论
John D'Errico
John D'Errico 2015-3-30
Well, if you have absolutely no idea, then you are probably in the wrong class. Did you take notes in class? Do you have a text for the class? Lacking all of that, you might just use Google. It is your friend. "fft formula" might be a place to start. I'll bet there is a formula for this, IF you looked in those places. It need not be superbly efficient. Make an effort. Unless of course, you just forgot to show up the first few months for class.
You start by creating a function in the MATLAB editor. Then looking at the formula that you found, you type it in.
Image Analyst
Image Analyst 2015-3-30
Do you have to write the fft function yourself (basically creating your own version of the built-in fft() function), OR can you write a function that calls the built-in fft() function, and then perhaps does some other stuff, like asking for an input data file, or plotting, or whatever? Which is it?

请先登录,再进行评论。

回答(1 个)

Mahdiyar
Mahdiyar 2015-3-30
Hi Tom
The best way to write any matlab code is that:
First, you have to know what you want to do, in technical point of view. For example, in this case you have to perfectly know how to calculate the discrete FFt.
Second, you have to make a flowchart or write a pseudo code.
Finally you may write each step very easily.
regards,

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by