What should be FFT of a constant function?

14 次查看(过去 30 天)
As per theory,FFT of a constant fn. is a DC value. But when I take an array 'A' of ones of size 172, i.e. A[1 1 1 1 1.....172 times]
FFT(A)
gives DC as well as AC cofts. Why?
  2 个评论
Image Analyst
Image Analyst 2012-12-11
The FFT breaks up the signal into a weighted sum of sinusoidal signals. Any point in an FFT not at the center is the weight (coefficient) of one of the sinusoidal signals that goes into making up the final signal. The center frequency is flat (no sinusoid) and is often called the DC component.

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2012-12-11
Round-off error in the calculations. Look at the magnitudes: everything is down near 10E-15
  3 个评论
Muthu Annamalai
Muthu Annamalai 2012-12-11
You have the details right, Image Analyst; while the rest of the comments are only partly true.

请先登录,再进行评论。

更多回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2012-12-11
编辑:Azzi Abdelmalek 2012-12-11
If you mean by AC, sinusoidal signal, when you calculate its FFT, it's important to define the interval. To give a sens to your FFT, you have to calculate it in one period. For the sinusoidal signal, the period is 2*pi, then theoretically, the result will be one value at k=1 and not at k=0 like in a constant signal.
t=0:.1:2*pi-0.1;
g=fft(sin(t));
stem(abs(g))
For a constant the result will be a constant for k=0; and 0 elsewhere
h=ones(1,length(t))
figure;
stem(abs(fft(h)))
  1 个评论
Richa Sharma
Richa Sharma 2012-12-12
Thank You very much for your response. Actually, my inputs are digital images.I was trying to check the fft response for constant background in images. I am going for 1D FFT in matlab. Say, my image is I and I write J=FFT(I) Then,for constant background in I, first coft. in columns of J should have high coft. value, the rest should be zeros is what I was expecting.But I was getting nonzero cofts for other frequency bins also.I think it is due to Round-off error in the calculations as Roberson said.Kindly correct me if I am wrong. Regards

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Multirate Signal Processing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by