0% found this document useful (0 votes)
42 views

EECS4214 Lab 1

Uploaded by

Vũ Long
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

EECS4214 Lab 1

Uploaded by

Vũ Long
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

1

EECS 4214 - Digital Communications (Fall 2022)


Lab-1

Due Date and Time: 16th Sept 2022, 8:00 pm


Maximum Points: 3 Points
Instructor: Hina Tabassum

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

I. S IGNIFICANCE OF F REQUENCY A NALYSIS


A. Background
Much of signal processing, communication and control systems analysis rely upon frequency analysis
of relevant signals and systems. A signal comprises of sinusoidal components at different frequencies.
Traditional frequency analysis uses two basic transforms: the Fourier series, for periodic waveforms, and
the Fourier transform, for aperiodic waveforms. In both cases the information from a signal is converted
to a frequency-domain representation; instead of representing the information in the signal as a function
of time, it is represented as a function of frequency.
What does the signal content as a function of frequency tell us? In a broad sense, it tells us at what
frequencies the signal has energy, just as a prism visually shows the colors - frequencies—present in
a light source, or a stereo spectrum analyzer shows the relative loudness of tones in a musical piece.
Frequency analysis helps to understand other technologies as well. For example, the electric power in
a standard wall outlet contains energy predominately at 60 Hz - AC power. A radio station broadcasts
energy around its transmission frequency, which is indicated on your radio station dial. By transforming
signal data in the frequency domain, we can find out what frequencies are significant in a given signal.
The behavior of systems also can be described using frequency-domain concepts. Systems are charac-
terized by their frequency response, i.e., how they affect the frequency content of an input signal. For
example, the tone control on a stereo (bass and treble knobs) has two effects: the bass knob controls the
gain (relative loudness) on low frequency signal components, whereas the treble knob controls the gain
on high frequency signal components. Examining the frequency content of a stereo signal before and after
tone control can tell what the two knobs are doing. In a more general sense, the frequency response of
any unknown system can be determined from the relative frequency content of signals at its input and
output.
2

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.

B. Continuous Time Fourier Series


An arbitrary signal x(t) can be written as a linear combination of harmonic complex sinusoids, i.e.,
the synthesis equation of a CT signal can be given as:
X

x(t) = Ck ejkω0 t (1)
k=−∞

where Ck represents the Fourier coefficients, ω0 = 2π


T0
is the fundamental angular frequency, and T0 denotes
the fundamental period of the signal x(t). The analysis equation of a CT signal can be given as:
Z
1
Ck = x(t)e−jkω0 t dt (2)
T0 T0
A periodic signal and continuous signal will see a discrete and non-periodic spectrum, respectively. The
average power of a periodic CT signal can be given as follows:
Z
1
Px = |x(t)|2 dt (3)
T0 T0

C. Continuous Time Fourier Transform


Frequency-domain analysis is a tool of utmost importance in signal processing applications. Frequency-
domain analysis is widely used in such areas as communications, geology, remote sensing, and image
processing. While time-domain analysis shows how a signal changes over time, frequency-domain analysis
shows how the signal’s energy is distributed over a range of frequencies. A frequency-domain represen-
tation also includes information on the phase shift that must be applied to each frequency component in
order to recover the original time signal with a combination of all the individual frequency components.
A signal can be converted between the time and frequency domains with a pair of mathematical operators
called a transform. An example is the Fourier transform, which decomposes a function into the sum of a
(potentially infinite) number of sine wave frequency components. The ’spectrum’ of frequency components
is the frequency domain representation of the signal. The inverse Fourier transform converts the frequency
domain function back to a time function.
If x(t) is absolutely integrable, that is, then its Fourier transform is given by
Z ∞
X(ω) = x(t)e−jω0 t dt (4)
t=−∞

A non-periodic signal and continuous signal will see a continuous and non-periodic spectrum, respectively.

D. Discrete Time Fourier Series


The Fourier series representation of a discrete signal x(n) can be given as:
X
N −1
x[n] = Ck ejkΩ0 n (5)
k=0
3

where Ck represents the Fourier coefficients and Ω0 = 2πn


N
is the fundamental angular frequency, and N
denotes the fundamental period of the signal x[n]. The analysis equation of a DT signal can be given as:

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.

E. Discrete Time Fourier Transform


If x[n] is absolutely summable, that is, then its discrete-time Fourier transform is given by
X

X(Ω) = x[n]e−jΩ0 n (8)
n=−∞

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.

F. Fast Fourier Transform (FFT)


The FFT function in Matlab is an algorithm to efficiently calculate the DFT by exploiting the special
structure of DFT when the signal length is a power of 2. As a result, it manages to reduce the complexity of
computing the DFT from O (N 2 ), which arises if one simply applies the definition of DFT, to O(N log N ),
where N is the data size.

G. Magnitude and Phase Information of the FFT:


The frequency-domain representation of a signal carries information about the signal’s magnitude and
phase at each frequency. Therefore, the output of the FFT computation is complex. MATLAB functions
abs and angle can be used to respectively get the magnitude and phase of any complex number.

II. MATLAB EXERCISES


Part-1 [Fourier Analysis and Signal Processing]
Question-1 In the file P 1 1.mat, there are two periodic waveforms, x and y; x has been filtered with
an ideal lowpass filter to generate y.
(a) By looking at the Fourier Series coefficients, using provided dfs.m function, determine the cutoff
frequency, in radians per second, and gain of the lowpass filter.
(b) If you assume a sampling rate of 44.1 kHz, what harmonic frequencies are present? What is the
filter cutoff frequency as a function of f0 ? How exact is your estimate of the cutoff frequency (i.e.,
in what range of values could it be)?
Question-2 In the file P 1 2.mat, a waveform corresponding to an ideal plucked guitar string is stored
in vector x ideal. The signal resulting from sampling the sound of an acoustic guitar in response to a
plucked string is stored in x sampled.
4

(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.

Part-2 [Digital Communication System and Performance Analysis]


1) Signal Modelling: Let us generate a random stream of ’1’s and ’0’s which can be considered as
the data that need to be sent. We choose the probability of 1 occurring is 0.8. Generate a random
uniform random vector.
2) Modulation: We can modulate the binary stream using any modulation scheme. Here, we will
modulate using a simple scheme which can be described as -1 denotes 0 bit and +1 denotes 1
bit. Let us change all the 0s to -1 and 1s to +1. This type of modulation is also called baseband
modulation or line coding. It is important to note that each -1 and 1 denotes a sin pulse in practice
with phase -180 and +180 with time length equal to bit duration . However, in this problem, we will
not consider the analog signal which is in form concatenated sin signals.
3) Channel: A channel is the medium between the transmitter that emits electromagnetic waves and
receiver. The signals propagate through different materials in the medium (air, water, buildings, dust
or static charges around) it may increase the signal strength or decrease it by some random factor.
This is called fading and this factor is called fading variable. It can also add some random component
to the transmitted signal. We can see this as additive noise. When this component follows a Gaussian
distribution we call it additive Gaussian Noise.
Additive Gaussian Noise Channel: First, consider the simple channel which just adds the Gaussian
noise. We will see one noise value for each bit duration and each noise value is independent of previous
bit duration. We choose the noise variance as 0.01 and mean as 0. So the output signal which is received
at receiver is y = x + n.
Fading Channel: Now let us consider the fading which multiplies to the transmitted signal. As previous,
here also each value is independent for each bit (or symbol) duration. We consider Rayleigh fading which
means each symbol is Rayleigh distributed. So the output signal which is received at receiver is y = hx+n,
where h is the Rayleigh fading channel. Here you should explore two different ways of generating the
Rayleigh fading channel, i.e., using raylrnd() command and using randn() MATLAB commands.
(a) Receiver Model: Consider a simple decoder which computes the phase of signal and decide upon
this. The rule is as follows if y > 0, then received bit is taken as ’1’, otherwise ’0’.
(b) Bit Error Rate (BER) Calculation: Now compute the bit error rate which is defined as the ratio of
bits in error to the total bits transmitted. Compare the BER obtained with noise and in the presence
of noise and channel fading. What happens to BER if we increase the mean and variance of noise.
Plot your BER as a function of the variance of additive White Gaussian Noise.

You might also like