Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to do a continuous time fourier transform in MATLAB

Subject: How to do a continuous time fourier transform in MATLAB

From: VijaKhara@gmail.com

Date: 13 Aug, 2005 09:04:08

Message: 1 of 5

Dear all


I need to plot Fourier transform of a continuos function x(t). How to
do it in matlab? Is there a function available in matlab or we have to
do it using the mathematical fomular?

By the way, do you know what function in matlab to integral a function
x(t)? Thanks

Subject: How to do a continuous time fourier transform in MATLAB

From: Becker Cruz

Date: 13 Aug, 2005 17:45:14

Message: 2 of 5

You can use fft. There's a tutorial for this in the file exchange
section of matlab central (http://www.mathworks.com/matlabcentral/fileexchange/)

VijaKhara wrote:
>
>
> Dear all
>
>
> I need to plot Fourier transform of a continuos function x(t). How
> to
> do it in matlab? Is there a function available in matlab or we
> have to
> do it using the mathematical fomular?
>
> By the way, do you know what function in matlab to integral a
> function
> x(t)? Thanks
>
>

Subject: How to do a continuous time fourier transform in MATLAB

From: VijaKhara@gmail.com

Date: 13 Aug, 2005 22:11:46

Message: 3 of 5

thank you very much.

Subject: How to do a continuous time fourier transform in MATLAB

From: Nasser Abbasi

Date: 14 Aug, 2005 06:29:06

Message: 4 of 5

 
 

<VijaKhara@gmail.com> wrote in message
news:1123949048.826203.303600@g44g2000cwa.googlegroups.com...
> Dear all
>
>
> I need to plot Fourier transform of a continuos function x(t). How
> to
> do it in matlab? Is there a function available in matlab or we have
> to
> do it using the mathematical fomular?
>

You can use fourier() function to obtain the F(w), the fourier
transform of x(t).

However plotting it can be tricky as some functions, such as trig
functions, generate the dirac delta function as a result. For example

>> syms x; fourier(sin(x))

ans =

i*pi*(-dirac(w-1)+dirac(w+1))

To plot this F(w), one usually want to represent the dirac function as
a 'spike' where it is infinity (which ofcourse occures when its
arguments evaluates to zero). So, the above F(w) is 2 spikes, one at
w=-1, and another negative spike at w=1, with a hight of Pi.

ie. the plot of F(w) is

               ^ Pi
               |
               | +w
          -----+--------0--------+---------- frequency w
              -w |
                                 |
                                 V Pi


and so, ezplot() does not handle such functions. One possible way to
do this is to the subs() command to evaluate F(w) for number of w
values, and then replace everywhere where it has +Infi or -Infi by 1
or -1 with the appropriate scaling thrown in. Then plot the generate
list of numbers using matlab plot command.

> By the way, do you know what function in matlab to integral a
> function
> x(t)? Thanks
>
>

help int


Nasser

Subject: How to do a continuous time fourier transform in MATLAB

From: Nasser Abbasi

Date: 14 Aug, 2005 08:47:06

Message: 5 of 5

 
 

<VijaKhara@gmail.com> wrote in message
news:1123949048.826203.303600@g44g2000cwa.googlegroups.com...
> Dear all
>
>
> I need to plot Fourier transform of a continuos function x(t). How
> to
> do it in matlab? Is there a function available in matlab or we have
> to
> do it using the mathematical fomular?
>

I've put an example on this page

http://12000.org/my_notes/mma_matlab_control/e60/HTML/e60.htm

The above is a plot of |F(w)| for f(t)=3 sin(t), just to show an
example. Plotting the phase diagram of F(w) is a little harder. This
gets much harder to do if f(t) was more complicated analytical
function, that is why people use fft (i.e. discrete) based solutions
instead.

Nasser

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us