fourier transform problem

조회 수: 1 (최근 30일)
Alok Verma
Alok Verma 2011년 9월 8일
댓글: Leyla Ibrahimli 2020년 11월 21일
Hi, i am trying make my own matlab program for fourier transform, whose result should be same as inbuilt library function fourier(f).
my program is:
function [fw]=myfourier(fx) syms x w; w=1; fw=int(fx*exp(-i*w*x),x,-pi,pi); and answer came are:
-pi*i for the myfourier(sin(x))
but by the library function:fourier(sin(x)) i got:
-pi*i(dirac(w - 1) - dirac(w + 1))*
and other answers are also different for different functions.
please help me for this program.
thanxs
  댓글 수: 2
Alok Verma
Alok Verma 2011년 9월 9일
Hi walter,
I have sending my function again:
function [fw]=myfourier(fx)
syms x w;
w=1;
fw=int(fx*exp(-i*w*x),x,-pi,pi);
in this function i got the answer '-pi*i'
but the answer of inbuit function is:
-pi*i(dirac(w - 1) - dirac(w + 1))
if possible help me.
i m not able to get the correct answer as given by library function. may be the problem of 'w'(omega) or aomthing problem of discontinuity of function.
i hope u now understand the problem.
Leyla Ibrahimli
Leyla Ibrahimli 2020년 11월 21일
I also experience the same problem. The inverse fourier works with formula, because you dont have diracs there. I also tried (rewrite, f, dirac) but dirac is not a valid command in rewrite. So, if anyone solved the issue, it would be very nice to see the code thanks!

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

답변 (1개)

Walter Roberson
Walter Roberson 2011년 9월 8일
function [F(v)]=myfourier3(f(u))
is not legal syntax in MATLAB.
Please post your actual code.
  댓글 수: 2
Alok Verma
Alok Verma 2011년 9월 9일
Hi walter,
I have sending my function again:
function [fw]=myfourier(fx)
syms x w;
w=1;
fw=int(fx*exp(-i*w*x),x,-pi,pi);
in this function i got the answer '-pi*i'
but the answer of inbuit function is:
-pi*i(dirac(w - 1) - dirac(w + 1))
if possible help me.
i m not able to get the correct answer as given by library function. may be the problem of 'w'(omega) or aomthing problem of discontinuity of function.
i hope u now understand the problem.
Walter Roberson
Walter Roberson 2011년 9월 9일
fourier involves integration from -infinity to +infinity, not -pi to +pi

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

Community Treasure Hunt

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

Start Hunting!

Translated by