1. INTRODUCTION TO MATLAB SYMBOLIC TOOLBOX
The MATLAB Symbolic Toolbox can compute symbolic Fourier transforms. Note that for many functions, there is no simple expression for the Fourier transform, and MATLAB will not be able to return a result. Please add the following m-files in your home directory: Heaviside.m, Dirac.m, and setcurve.m (to fix some plotting problems in MATLAB).
As an introduction to using the MATLAB Symbolic Toolbox, please type the following commands interactively from the MATLAB command window and try to understand their function:
Listing 6:
syms t w % The expressions with variables t and w will be treated as symbolic expressions
x = sym(exp(-2*t)*Heaviside(t)') % Symbolically defines signal x, and the result is
X = fourier(x) % X is the symbolic Fourier transform (expressed in w) of x, and the result is
Xf = subs(X, 2*pi*f*w) % Substitution of w in X by 2f gives Xf, and the result is
Xf.conj = subs(Xf, -i*i') % Xf.conj is the complex-conjugate of Xf
Gf = Xf*Xf.conj
Gf = simplify(Gf) % Simplifying expression
The following commands are related to the plotting command:
subplot(2,1,1)
ezplot(x, 0.1, 2.5)
subplot(2,1,2)
ezplot(Gf, -2, 2)