Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MATLAB - Fourier (how do I do this)

  1. Mar 25, 2007 #1
    I would like to use Matlab to check my answers.

    For example, I want to find the Fourier transform of [tex] \cos \omega_0 t [/tex].

    I know the answer is:
    [tex] \pi ( \delta(\omega - \omega_0) + \delta(\omega + \omega_0)) [/tex].

    How do I do this in Matlab. All I can find is something like this:
    Code (Text):

    syms t;
    This returns:
    Code (Text):
    I would really like to be able to do something like:
    Code (Text):

    syms t;
    and get:
    Code (Text):
    so I can actually check harder transforms.

    How would I do this?

    Thanks in advance :)
  2. jcsd
  3. Jul 21, 2010 #2
    Just make sure that "a" is also initialized in your symbolic variables.

    >> syms a t
    >> fourier(cos(t))

    ans =

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

    >> fourier(cos(a*t))

    ans =

    pi*(dirac(a + w) + dirac(a - w))
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - MATLAB Fourier Date
Matlab Split-step Fourier method Apr 4, 2016
Matlab Matlab syntax for 2-d fourier transform Mar 21, 2016
Matlab Fourier transform of a 2D shape Mar 21, 2016
Using the Fourier Transform on Partitioned Images Dec 3, 2015
Fourier Transform and Convolution Oct 9, 2015