No BSD License  

Highlights from
Alternative Mathematics using MATLAB 7

image thumbnail

Alternative Mathematics using MATLAB 7



13 Mar 2003 (Updated )

Self-instructive text on undergraduate algebra, statistics, differential and integral calculus.

% ex251.m:  Simple Fourier Transform of a Gaussian  		                      
clear all
ns=101;                      			% Number of samples 
A=1;	 a=50;				% Constants for input function	
tlim=10*a; 					% Time range
dt= 2*tlim/(ns-1); 				% Time increment   
T=-tlim: dt: tlim ;         			% Sample points, input variable
F=A*exp(-T.^2/ a^2);			% Input function 
figure(1),  plot(T,F),  grid on		% Show input function
   xlabel('time t'),  ylabel('function f(t)'),  axis([-tlim tlim get(gca,'Ylim')])
Nu=linspace(0, 2/a, 50);		% Frequency vector
G=sft(T, F, Nu);   			% Simple Fourier transform
W=2*pi*Nu;				% Angular frequency
Gex=A*sqrt(pi)*a*exp(-W.^2/4*a^2);		% Exact transform
figure(2),  plot( Nu,real(G),'o', Nu,imag(G),'*', Nu,Gex ),  grid on
   xlabel('frequency'),  ylabel('Fourier transform: real(g)=o, imag(g)=*')
   axis([min(Nu) max(Nu) get(gca,'Ylim')])  

Contact us