MATLAB - Fourier (how do I do this)

  • Context: MATLAB 
  • Thread starter Thread starter FrogPad
  • Start date Start date
  • Tags Tags
    Fourier Matlab
Click For Summary
SUMMARY

The discussion focuses on performing Fourier transforms in MATLAB, specifically using the symbolic toolbox to compute the Fourier transform of the function \cos(\omega_0 t). The user seeks to generalize the input to \cos(a t) and obtain the corresponding output. The correct MATLAB syntax involves initializing the symbolic variable 'a' alongside 't', allowing the command fourier(cos(a*t)) to yield the expected result of pi*(dirac(a + w) + dirac(a - w)).

PREREQUISITES
  • Familiarity with MATLAB symbolic toolbox
  • Understanding of Fourier transforms
  • Knowledge of symbolic variables in MATLAB
  • Basic trigonometric functions in MATLAB
NEXT STEPS
  • Explore MATLAB symbolic toolbox documentation for advanced functions
  • Learn about Fourier series and their applications in MATLAB
  • Investigate the use of the dirac function in MATLAB
  • Study the implications of Fourier transforms in signal processing
USEFUL FOR

Students, researchers, and engineers working with signal processing or mathematical modeling using MATLAB, particularly those interested in Fourier analysis.

FrogPad
Messages
801
Reaction score
0
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:
clc;
syms t;
fourier(cos(t))

This returns:
Code:
pi*(dirac(w-1)+dirac(w+1))

I would really like to be able to do something like:
Code:
clc;
syms t;
fourier(cos(a*t))

and get:
Code:
pi*(dirac(w-a)+dirac(w+a))

so I can actually check harder transforms.

How would I do this?

Thanks in advance :)
 
Physics news on Phys.org
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))
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K