I would like to use Matlab to check my answers.(adsbygoogle = window.adsbygoogle || []).push({});

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:

This returns:Code (Text):

clc;

syms t;

fourier(cos(t))

I would really like to be able to do something like:Code (Text):pi*(dirac(w-1)+dirac(w+1))

and get:Code (Text):

clc;

syms t;

fourier(cos(a*t))

so I can actually check harder transforms.Code (Text):pi*(dirac(w-a)+dirac(w+a))

How would I do this?

Thanks in advance :)

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MATLAB - Fourier (how do I do this)

**Physics Forums | Science Articles, Homework Help, Discussion**