An octave/MATLAB script to show the Fourier series of a string of impulse functions: Difference between revisions

From Class Wiki
Jump to navigation Jump to search
(Created page with " <nowiki> % This is a script to see if the Fourier series with unity coefficients is % really a series of impulse functions. M=100; % Number of terms T=1e-3; % the period of...")
(No difference)

Revision as of 16:20, 2 November 2016

% This is a script to see if the Fourier series with unity coefficients is
% really a series of impulse functions.
M=100; % Number of terms 
T=1e-3;  % the period of the sampling function is 1 mS.
t=0:T/1000:10*T;

f=zeros(size(t));
for k=-M:M
  v = 1;
  f = f+v*exp(-j*2*pi*k*t/T);
end
plot(t,f)