EECS4214 Lab 1
EECS4214 Lab 1
This lab will refresh your knowledge on how to numerically evaluate the Fourier series for periodic
signals, perform and interpret basic frequency-domain signal analysis. The Fourier series should be a
familiar mathematical concept. It is extremely useful to break up an arbitrary periodic function into a set
of simple terms that can be solved individually, and then recombined to obtain the solution to the original
problem or an approximation to it. By the end of this lab, you will be able to do the following contents:
• Refresh your concepts related to discrete-time Fourier series (DTFS), discrete-time Fourier transform
(DTFT), Fast Fourier transform (FFT)
• Represent the magnitude and phase information of the FFT and find spectral components of a
continuous and discrete signal.
• Modelling a Communication System and calculate important performance metrics like bit error rate.
• Understand the key performance metrics considering a simple additive Gaussian noise channel and
Rayleigh fading channel
Why bother with the Fourier series at all? This mathematical representation provides a means for
determining the frequency content of periodic signals. For a given periodic signal, the gain (magnitude)
and time-shift (phase) of sinusoids at each harmonic frequency define the signal’s frequency spectrum.
Knowing the frequency content of a signal allows you to determine how a signal will or should be modified
by a physical system.
A non-periodic signal and continuous signal will see a continuous and non-periodic spectrum, respectively.
1 X
N −1
Ck = x[n]e−jkΩ0 n (6)
N k=0
A periodic signal and discrete signal will see a discrete and periodic spectrum, respectively. Fourier
coefficients provide the description of is in frequency domain. Average power can be given as
X
N −1
1 X
N −1
2
Px = |Ck | = |x[n]|2 (7)
k=0
N n=0
DTFS is also referred to as Discrete Fourier Transform. The fft and ifft functions in MATLAB allow to
compute the DFT of a signal and the inverse of this transform respectively.
A non-periodic signal and discrete signal will see a continuous and periodic spectrum, respectively.
Remark: Since it is impossible to process an infinite number of samples the DTFT is of less practical
relevance; it mainly exists for analytical purposes. The DFT with its finite input vector length, is suitable
for processing.
(a) Plot the frequency domain of both waveforms using their Fourier series coefficient.
(b) Calculate the changes in magnitude and phase for each coefficient from ideal to sampled data, and
plot these values.
(c) Create a function that synthesizes the sampled guitar sound from the FS coefficients for the ideal
waveform, given the magnitude and phase changes found above.
Question-3
(a) Obtain a noisy ideal waveform by adding Gaussian zero mean noise to the ideal waveform x ideal,
provided in the previous question, by using sqrt(sigma)*randn(1,length(signal)) where
sigma is the noise variance. Then, plot the ideal and noisy waveform in frequency domain using
FS.
(b) Reconstruct the time domain of the noisy signal using inverse DFS and plot the original ideal and
noisy signals in one figure and compare them.
(c) By varying the noise variance in the range of 0 : 0.01 : 1, plot the mean square error resulting
P from
1
the reconstructed noisy and the original ideal signal. The mean square error is N ∗ (X − Y )2 ,
where X and Y are the two vectors, and N is their length.