E12 Assignment 11

Description: 

Problems: 
1. Fourier Series, expression for cn

Consider the function f(t) represented by the exponential Fourier series

Show that

Hint: try multiplying f(t) by then integrating.

Solution: 

Use hint.  Multiply

then integrate over one period

 

Switch order of integration and summation (and pull cn out of summation)

The function is periodic and has an integer number of complete oscillations in one period, T, unless m=n in which case the function is constant with a value of 1.  Therefore the integral is 0 unless m=n in which case the integral is T (integrating 1 over an interval of T).  As we perform the summation we multiply each cn by zero if m≠n, and by T if m=n.  Therefore the only term that makes it out of the summation is when m=n, so

or, by changing the variable and rearranging

2. Half Wave Rectified, Fourier Series

Show that the exponential series coefficients, cn, for the function shown below (a 60 Hz, half-wave rectified sine wave) are given by

Euler's identity for sin may be useful:

Solution: 

but ω0T=2π

Make use of the facts

So

Note: in the last line we had to go back to complex exponential form because we set jsin(-πn) to zero earlier (eq. 1), but now we are taking the limit as n→1, so the whole expression in (eq. 1) is going to zero.

3. Plot FS, Half Wave

Plot the half wave rectified function from the previous problem on the same plot as the sum of the first four non-zero terms of the Fourier Series.  Plot for t=0 to 1/30 second.   Note that as we add terms, the approximation converges to the function.

Below is some code you can use as a starting point.  If you run it as is it plots Fourier sum for square wave.

% skeleton code  (use at your own peril) - as is, it plots Fourier Sum for square wave.
clear all

% Define constants
c_order='rgbcm';   %Order of colors used in plot.
N=8;                        %number of Fourier terms to plot
T=1/60;  wo=2*pi/T;         %Period and fundamental frequency
t=linspace(0,2*T,1000);     %Time vector

% % Plot a half-rectified sine wave (for E12 homework problem).
% y=sin(2*pi/T*t).*(sin(2*pi/T*t)>0);
% plot(t,y,'k:','LineWidth',2);

% Plot a square wave (as an example).
y = sin(2*pi/T*t)>0;
plot(t,y,'k:','LineWidth',2);
leg{1}='Function';      	%Create legend entry
axis([0 2*T -1.1 1.1]);
hold on

c0=0.5;                 %c0=DC component of Fourier Series
ysum=c0*ones(size(y));  %Set summation to average (or DC) value.

plot(t,ysum,'y');       %Plot ysum (the average value) in yellow
leg{2}='DC component';  %Create legend entry
axis([0 2*T -1.2 1.2]);

for n=1:N,                      %Form Fourier sum
    cn=j/n/2/pi*(cos(n*pi)-1);  %Calculat cn.
    an=2*real(cn);              %calculate an and bn from cn.
    bn=-2*imag(cn);   
    ysum=ysum + an*cos(n*wo*t) + bn*sin(n*wo*t);  %Add to Fourier sum
    plot(t,ysum,c_order(mod(n,5)+1));    %Plot - using color from c_order
    leg{end+1} =['Sum of ' num2str(n)];  %Create legend entry
end

hold off
legend(leg,'location','se');
title('Function (black) and Fourier Approximations');
xlabel('t');

 

Solution: 
% Plots Fourier Sum for half-wave rectified signal.
clear all

% Define constants
c_order='rgbcm'; %Order of colors used in plot.
N=7; %number of Fourier terms to plot
T=1/60; wo=2*pi/T; %Period and fundamental frequency
t=linspace(0,2*T,1000); %Time vector

% Plot a half-rectified sine wave
y=sin(2*pi/T*t).*(sin(2*pi/T*t)>0);
plot(t,y,'k:','LineWidth',2);
leg{1}='Original';
hold on

c0=1/pi; %c0=DC component of Fourier Series
ysum=c0*ones(size(y)); %Set summation to DC value.
plot(t,ysum,'y'); %Plot ysum in yellow
leg{2}='DC component'; %Create legend entry
axis([0 2*T -0.2 1.2]);

for n=[1 2 4 6 8], %Form Fourier sum
    nc=n+0.001; %change n slightly to avoid 0/0
    cn=-1/2/pi./(nc.^2-1).*(exp(-j*pi*nc)+1); %Calculat cn.
    an=2*real(cn); %calculate an and bn from cn.
    bn=-2*imag(cn);
    ysum=ysum + an*cos(n*wo*t) + bn*sin(n*wo*t); %Add to Fourier sum
    plot(t,ysum,c_order(mod(n,5)+1)); %Plot - using color from c_order
    leg{end+1} =['Sum of ' num2str(n)]; %Create legend entry
end
hold off

legend(leg,'location','ne');
title('Function (black) and Fourier Approximations');
xlabel('t');

4. FS of Time Delay

 Prove that if

 then  

where the cn,x terms are the Fourier series coefficients of x(t), and the cn,y terms are for y(t)

Note the similarity to the time shift property of the Laplace Transform.

Solution: 

 

5. Time Shifted Rectangular Pulse, Fourier Series

In class we showed that the Fourier Series coefficients of the function shown (call it ΠT(t/Tp) - a rectangular pulse of period T, and width Tp, centered on the origin).

are given by

Use this result, and the time delay property derived previously, to find the coefficients, cn, of the function shown below without performing any integration.

Solution: 

Time delay is Tp/2, so Fourier Series coefficients for bottom function are

6. Fourier Series, Double Pulse (1)

Find the coefficients, cn, of the function shown below without performing any integration by representing the function as the differences of two pulse functions centered at t=0.

 

Solution: 

The function is the sum of a pulse of amplitude 2 and width 6 minus a pulse of amplitude 3 and width 4.

Note that c0=0, and that the average value of the function is zero.

7. Fourier Series, Double Pulse (2)

For the function shown below

 

  1. Find the coefficients, cn, by representing the function as the sum of three pulses, two of which are shifted in time.
  2. Show that these coefficients are equivalent to those obtained by representing the function as the differences of two pulse functions centered at t=0.
Solution: 

a) The function is the sum of a pulse of amplitude 2 and width 1 shifted by -2.5 seconds, plus a pulse of amplitude -1 and width 4, pulse of amplitude 2 and width 1 shifted by +2.5 seconds

This answer is correct, but let's simplify

b) Use trig identity sin(a)cos(b)=½(sin(a+b)+sin(a-b))

which is the same as the result from the previous problem.