필터 지우기
필터 지우기

fft function

조회 수: 25 (최근 30일)
a
a 2012년 3월 29일
댓글: vandana sharma 2019년 2월 27일
hi, i'm trying to figure out exactly how matlab dose fft. i understand the basic idie but i saw somwere the command y=fft(x,'symetric') if x is a vector of size 10 the resuly y is a vector of size 115. what dose the aargument 'symetric' do? any word i put insted changes the length of y vector? what is the meaning of this?
thank you,
  댓글 수: 1
a
a 2012년 3월 29일
thank you. this explanes a lot..

댓글을 달려면 로그인하십시오.

채택된 답변

Marlies
Marlies 2012년 3월 29일
The command 'fft(x)' will compute the discrete Fourier transform (DFT) of the vector x.
By default, the number of elements in the output will be the same as the the number of elements in the input. However, I can give an (optional) second argument to explicitly define how many elements I want in my output vector.
Y = fft(x) % length(Y) == length(x)
Y = fft(x,100) % length(Y) == 100
The string 'symmetric' is not recognized by MATLAB. De fft command does not take any additional flag, specifier or alternative string-input.
However, what happens is that MATLAB is interpreting your string 'symmetric' as a vector of numbers; the ASCII-code of each character. You can see the value of the characters if you use the command 'double'
double('symmetric')
if you try to use the fft-command like you do, you'll also see a warning:
Warning: FFT length must be a non-negative integer scalar.
MATLAB is trying to determine the length of the FFT by checking the value of the second input. This gives a vector (double('symmetric')), so you get the warning that the second input should be a (non-negative, integer) scalar. And MATLAB is then taking the first number as default. In this case that is 115. So different words will indeed give different outputs, because they probably start with a different letter.
Hope this helps,
Marlies
  댓글 수: 3
Marlies
Marlies 2012년 3월 29일
Wayne, I think you are absolutely right.
Thank you.
OP, you should probably look into Waynes answer as well for a proper explanation of how MATLAB does FFT if you use the ifft command.
vandana sharma
vandana sharma 2019년 2월 27일
can we apply the fft command as
fresult=fft(x,y);
Actually I am trying to convert time-amplitude signal as frequency-amplitude signal.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Jan
Jan 2012년 3월 29일
When I read http://www.mathworks.com/help/techdoc/ref/fft.html I do not find a 'symmetric' flag (double 'm'?).

Wayne King
Wayne King 2012년 3월 29일
I think the OP is really thinking of the 'symmetric' flag in ifft(), not in fft().
The purpose of that flag is that often people are trying to take the inverse Fourier transform of complex-valued data (the DFT of something) that should exhibit conjugate symmetry.
The DFT of real-valued signals is conjugate symmetric.
However, because of small numerical errors just using ifft() on this data may result in a complex-valued (time domain) signal (usually the imaginary parts are close to zero, but non-zero).
The 'symmetric' flag is a simple way of saying: "I know what I'm applying the inverse Fourier transform to should be conjugate symmetric, so give me a real-valued output."
xdft = fft(randn(1e3,1));
xrec = ifft(xdft,'symmetric');

카테고리

Help CenterFile Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by