Math 333 mathematics and brain

Description

Finished the questions in the file

Don't use plagiarized sources. Get Your Custom Assignment on
Math 333 mathematics and brain
From as Little as $13/Page

Unformatted Attachment Preview

HW 5: Discrete Fourier Transform
October 31, 2023
This exercise intends to show some intricacies of using DFT to analyze the spectrum of a signal.
Let s(t) denote a time dependent signal over an observation interval [0, T ]. We assume that the signal is sampled at
times tj = j∆t, j = 0, 1, 2, . . .. It is assumed that ∆t is expressed in the units of seconds, [∆t] = s. If tN denotes
the last observation, we must have
T
N ∆t = T ⇒ ∆t = .
N
The sampling frequency, denoted by fs here, expresses how many samples per second we are collecting,
fs =
N
1
=
. [fs ] = Hz.
T
∆t
As the following computation shows, ∆t determines the highest frequency that we can find, while the observation
time T determines the lowest non-zero frequency we can find. Consider the following numerical approximation of
the integrals,
sb(f ) =
=
1
T
1
N
N −1
Z T
e
0
N
−1
X
−i2πf t
1 X −i2πf tn
s(tn )∆t
s(t)dt ≈
e
T
e−i2πf tn s(tn ) =
n=0
n=0
N
−1
X
1
N
e−i2πf n∆t s(tn ).
n=0
To be able to use the DFT algorithm, we must discretize the frequency f as follows. Write
2πf n∆t = 2π
nk
k
k
⇒f =
= fs ,
N
∆tN
N
k = 0, 1, 2, . . .
Hence, the smallest positive frequency that the DFT finds is
f1 =
1
1
fs = ,
N
T
that is, T defines how low in the frequency range one can get. On the other hand, we have
fN = fs =
1
,
∆t
setting an upper bound for the available frequencies. However, according to Nayqvist’s resoult, the true upper bound
is just one half of this, that is, the highest frequency attained is (assuming that N is even),
fN/2 =
1
fs
.
2
This assignment is about verifying this in practice. Assume that you have a signal comprising only three pure frequencies at f (1) = 4 Hz, f (2) = 10.3 Hz, and f (3) = 22.5 Hz. We assume that in the phase-amplitude representation,
the signal is
s(t) = a(1) cos(2πf (1) t + φ(1) ) + a(2) cos(2πf (2) t + φ(2) ) + a(3) cos(2πf (3) t + φ(3) ),
where the amplitudes are
a(1) = 2.5,
and the phases are
φ(1) =
π
,
3
a(2) = 1.5,
φ(2) = 0,
a(3) = 2,
φ(3) =
π
.
4
1. Write a Matlab function that generates the signal, and plot a segment of the signal.
2. What is the minimum T that allows you to identify correctly the lowest frequency?
3. Ideally, when you compute the spectrum of your signal, you should have three non-zero frequencies. In practice, however, this may not be the case as the following example demonstrates. By using the FFT command
of Matlab, estimate the spectrum of your signal using the following combinations of the parameters (units in
seconds),
(T, ∆t) ∈ {(5, 0.05), (5, 0.02), (7, 0.02), (10, 0.02)}.
4. Explain the outcome in each case.
The phenomena that you should observe are aliasing (fs is too low) and leaking (the true frequencies are not multiples of 1/T ).
2

Purchase answer to see full
attachment