## Transcribed Text

1. This exercise is a typical final exam question (minus the MATLAB content). Consider the
signal below, periodic with period T = 2.
f(t) = −1
2 + t
2, − 1 ≤ t ≤ 1.
(a) What is ω for this signal?
(b) Draw a picture of this signal over three whole periods. Label your axes correctly!
(You may use MATLAB. If so, include your code.)
(c) Find the complex Fourier coefficients cn from the definition (that is, integrate, either
by hand or using a table of integrals, to find the answer)
cn = 1
T
T /2
−T /2
f(t) e−jnωt dt, n = 0, ±1, ±2, ···
(d) Find the real Fourier coefficients an, bn. You may use your knowledge of cn to do
this, without integrating. Alternatively, you may choose instead to find an and bn by
integration, and use this knowledge to find cn.
(e) Find the average energy of f over one period; that is, compute
1
T
T /2
−T /2
|f(t)|
2 dt.
(f) Write down Parseval’s identity for this signal, and simplify the expression you obtained.
(g) Use Parseval’s identity to answer the following question: How many terms do we
need to add in the Fourier series in order to approximate f, with at least 95% of the
(average) energy of f being present in the approximation? Justify.
(h) Use MATLAB to plot, on the same graph, both f and the approximation obtained
in the last item.
(i) Draw an accurate picture of the (complex) amplitude spectrum of f, containing at
least the first 5 frequencies. For full marks you will need to label all axes correctly,
making clear which angular frequencies are present in this signal.
2. This is a MATLAB exercise. You are not expected to perform any computations by hand,
but you do need to deliver your own MATLAB code for this question.
The rectified sine wave is the signal
f(t) = 0, −π<t< 0;
sin t, 0 ≤ t < π.
(a) Find the average energy of f. (Use MATLAB.)
(b) Obtain complex Fourier coefficients c0, c1,. . . , c10. (Use MATLAB.)
(c) Obtain a Fourier approximation of f containing at least 90% of the energy of f.
Justify your answer using the data from the previous items.
(d) Plot f and the approximation obtained in the last item, overlayed on the same graph.
3. This is an exercise about convolution, and the use of the main property. Consider the
signals f and g below, both periodic with T = 2.
f(t) =
⎧
⎪⎨
⎪⎩
0, −1 <t< −1
2 ;
1, −1
2 <t< 1
2 ;
0, 1
2 <t< 1.
g(t) = 0, −1 <t< 0;
t, 0 ≤ t < 1.
Draw (or have MATLAB draw), as accurately as you can, the graph of f ∗ g. Justify all
your steps.
(Note: I am not asking for you to find a formula for f ∗ g!)
4. This is an exercise about the geometry of signals. All signals here are over the interval
−1 ≤ t ≤ 1. We want to obtain mutually perpendicular polynomial signals. We start
with f0(t) = 1 for all t.
(a) Find the value of the constant a1 so that the signal f1(t) = t + a1 is perpendicular to
the signal f0.
(b) Find the values of constants b1 and b2 so that the signal f2(t) = t
2 + b1t + b2 is
perpendicular to both f0 and f1.
(c) Find the values of constants c1, c2, and c3 so that the signal f3(t) = t
3+c1t
2+c2t+c3

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

function solutions()

clear all

close all

disp('--------------Problem 1-----------------')

problem1=true;

if (problem1)

N=100;T=2;

t=linspace(-3*T/2,3*T/2,3*N);

plot(t,[-1/2+(t(1:N)+T).^2,-1/2+t(N+1:2*N).^2,-1/2+(t(2*N+1:3*N)-T).^2],'b');

xlabel('t')

ylabel('y=f(t)')

hold on

coeff_for_pi4=rat(7/60/8-1/36/8)

syms x

c(1)=1/2*int(x^2-1/2,x,-1,1);

c(2)=1/2*int(exp(-i*pi*x)*(x^2-1/2),x,-1,1);

c(3)=1/2*int(exp(-i*2*pi*x)*(x^2-1/2),x,-1,1);

Nmin=ceil((5/100*7/60*3*pi^4/8)^(-1/3))

S2=c(1)+2*c(2)*cos(pi*t)+2*c(3)*cos(2*pi*t);

plot(t,S2,'r')

legend('function f','Fourier approximation with 2 terms')

hold off

error=x^2-1/2-(c(1)+2*c(2)*cos(pi*x)+2*c(3)*cos(2*pi*x));

errorenergy=int(error^2,x,-1,1);...