No BSD License  

Highlights from
Signals & Systems: Continuous and Discrete, 4e Companion Software

from Signals & Systems: Continuous and Discrete, 4e Companion Software by Rodger Ziemer
Companion Software for Signals & Systems: Continuous and Discrete, 4e

c4ex2.m
%	c4ex2 MATLAB application
%
syms t w f 									% Define symbolic variables
x = sym('exp(-2*t)*Heaviside(t)')	% Symbolically define signal
X = fourier(x)								% Symbolically take the Fourier transform
Xf = subs(X, 'w', sym('2*pi*f'))		% Change independent variable to f = w/(2*pi) in hertz
Xf_conj = subs(Xf, 'f' ,sym('-f'))	% Conjugate Fourier transform
Gf = symmul(Xf, Xf_conj)				% Multiply the Fourier transform and its conjugate
ezplot(Gf)									% Use the ezplot routine to plot energy spectrum
  

Contact us at files@mathworks.com