























Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!
























Let’s see how the spectrum of a signal can be obtained. Suppose to have the following signal 𝑦:
𝑦 = 3 cos ( 6 𝜋𝑡 +
The objective is to plot the spectrum of this signal. This implies two graphs: module vs frequency and phase
vs frequency
Let’s start from the module. There are two lines: one at positive and one at negative frequencies. The
frequency is given by:
So, the two lines are at − 3 𝐻𝑧 and + 3 𝐻𝑧. The height of this line is the 𝑚𝑜𝑑𝑢𝑙𝑒/ 2 , i.e. 1 , 5.
Let’s now draw the phase. The phase of the cosine function is
𝜋
3
. But what is the phase for positive frequency
and the one for negative frequency? To understand this fact, consider a cosine with null shift. On the Re-Im
plane it is represented by two vectors rotating in opposite directions:
But here the phase is not null, it is equal to
𝜋
3
So, what is the layout of the two vectors? The only chance is that one vector is rotated of
𝜋
3
and the other of
𝜋
3
, otherwise their sum does not lie on the real axis:
But which vector is rotating with positive speed and which one with negative speed? Let’s see what happens
in time: in the first part of the time plot, as 𝑡 increases the cosine tends to 0. So, the sum of the two vectors
initially decreases as 𝑡 increases. Thus, the vectors rotate in the following way:
This means that the vector rotating with positive angular speed (i.e. positive frequency) has a phase equal
to
𝜋
3
, while the vector rotating with negative angular speed (i.e. negative frequency) has a phase equal to
𝜋
3
Then, finally, the phase-frequency diagram is:
So, the two vectors must be rotated of
𝜋
6
. There are two possible situations:
The correct one can be recognised considering that, starting from 𝑡 = 0 , the sine function increases as 𝑡
increases. In the first cases, the sum of the two vectors tends to decrease (it becomes smaller and smaller),
while in the second case it tends to increase. Moreover, at 𝑡 = 0 the sum of the two vectors must be positive:
in the first case it is negative, whereas in the second case it is positive. For these reasons, the correct one is
the second representation.
In addition, since the sine function is tending towards a maximum, these vectors are rotating in the following
way:
In fact, if they were rotating in the opposite direction, their sum would tend to zero as the vectors tend to
become parallel along the imaginary axis. The phase is the inner angle.
Lastly, the cosine, which is shifted of −
𝜋
4
. Let’s draw the cosine with null phase:
Shifting it of −
𝜋
4
, as seen before:
Since the cosine function is tending to a maximum, the direction of rotation is:
Thus, for the negative frequency (i.e. vector rotating at −𝜔) the phase is +
𝜋
4
, while for the other component
(i.e. vector rotating at 𝜔) the phase is −
𝜋
4
.Finally:
This spectrum is represented for both positive and negative frequencies. However, it is usually represented
just for positive frequencies. How to pass from one representation to the other? In terms of energy, the
spectrum is symmetric (the energy at negative frequencies is equal to the energy at positive frequencies).
So, the lines at negative frequencies can be neglected multiplying by 2 the lines at positive frequencies:
Note that the amplitude of the line at 𝑓 = 0 𝐻𝑧 remains the same.
This is also in agreement with the approach seen at lesson. In fact, the harmonic component can be seen also
as the projection on the real axis of a single rotating vector.
What about the phase? it is enough to maintain the phases at null and positive frequencies, neglecting the
lines at negative frequencies:
Now the windowing has to be applied. The spectrum of the rectangular window is:
Convolving with the previous spectrum (considering only the lines at ±𝑓 𝑝
since there is not aliasing):
Finally, the spectrum must be sampled in 0 , Δ𝑓 and its integer multiples:
It’s interesting to notice that the exercise can be solved without substituting 𝑖 with a number. In fact, what
matters is the relation between 𝑓 𝑝
and Δ𝑓, which does not depend on 𝑖. If a number is substituted to 𝑖 a
rational number can be obtained, for example when considering 11 𝑖/ 5. Thus, never substitute numbers in
this kind of exercises.
Consider the following signal:
𝑦 = 1 + cos ( 20 𝜋 𝑖 𝑡)
With:
𝑠𝑎𝑚𝑝
𝑤
First of all, since 𝜔 𝑝
= 20 𝜋 𝑖, then:
𝑝
𝑝
From this:
𝑤
Knowing that 𝑓 𝑝
𝑝
𝑝
As in the previous case, let’s start from the spectrum of the original signal:
The spectrum of the sampling function (sequence of impulses) is:
Since 𝑓 𝑠𝑎𝑚𝑝
𝑝
, there is no aliasing.
Convolving the two spectra:
Note the presence of lines in 0 and ±𝑓 𝑠
, due to the presence of a mean component in the signal.
Convolving with the spectrum of the rectangular window:
Suppose to have the following sampled signal:
t 0s 0,1s 0,2s 0,3s
x 2 4 - 1 - 2
The sampling frequency is:
𝑠𝑎𝑚𝑝
The unbiased version of the auto-correlation function is:
𝑥𝑥
𝑇−𝜏
0
Since the signal is sampled, the integral becomes a sum. Moreover:
So:
𝑥𝑥
𝑁−𝑘
𝑡= 0
Where 𝑁 is the number of points and 𝑘 the delay. The Δ𝑡 outside can be simplified with the one inside the
sum. Then:
𝑥𝑥
𝑁−𝑘
𝑡= 0
Where 𝜏 = 𝑘Δ𝑡
Let’s calculate the autocorrelation function for all the possible 𝑘 values.
𝑥𝑥
𝑥𝑥
𝑥𝑥
𝑥𝑥
The autocorrelation function should be calculated also for negative values of 𝜏. But remember that it is an
even function:
𝑥𝑥
𝑥𝑥
The same holds for the other values of 𝜏.
Be careful: 𝑅 𝑥𝑥
cannot be calculated for 𝜏 > 0 , 3 𝑠 otherwise the second term of the multiplication does not
exist.
Consider the following two signals:
t 0s 0,01s 0,02s
x 2 3 1
y - 3 4 2
Then:
𝑠𝑎𝑚𝑝
𝑠𝑎𝑚𝑝
The normalized cross-correlation function is defined as:
𝑥𝑦
𝑥𝑦
𝑥𝑥
𝑦𝑦
Let’s start considering the denominator:
𝑥𝑥
𝑦𝑦
Instead, for what concerns the numerator:
𝑥𝑦
𝑥𝑦
𝑥𝑦
But in this case also negative values of 𝜏 have to be considered:
𝑥𝑦
𝑥𝑦
Eventually, 𝜌 can be obtained.
In theory, 𝜌 cannot be higher than 1 or lower than − 1. However, in this kind of exercises these thresholds
may be overcame since a limited amount of point is used.
𝑥(𝑡) remains the original signal, while 𝑦 is defined in −𝑡 and not in 𝑡. This new signal can be represented as
the original 𝑦, but turned around the vertical axis:
t - 0,3 - 0,2 - 0,1 0
Now −𝑦 must be shifted because of the +𝜏 in the definition. In general, shifting the signal of +𝜏 means
moving it towards the left. However, now the signal is defined in −𝑡. So, a positive 𝜏 means that the signal is
shifted towards the right.
In addition, since the signals are sampled, the integral of the definition becomes a sum. The convolution can
be obtained multiplying the signals point by point, summing the results and multiplying this number for Δ𝑡.
t - 0,3 - 0,2 - 0,1 0 0,1 0,
Multiplication - - - 6 - -
Then, the convolution is:
𝑦(−𝑡) must be moved of 0 , 1 towards the right:
t - 0,3 - 0,2 - 0,1 0 0,1 0,
Multiplication - - - 9 4 -
The convolution is:
𝑦(−𝑡) must be moved of 0 , 2 towards the right:
t - 0,3 - 0,2 - 0,1 0 0,1 0,
Multiplication - - - 15 6 8
The convolution is:
𝑦(−𝑡) must be moved of 0 , 3 towards the right:
t - 0,1 0 0,1 0,2 0,
Multiplication - 3 10 12 -
The convolution is:
t - 0,1 0 0,1 0,2 0,3 0,
Multiplication - - 2 20 - -
The convolution is:
t 0 0,1 0,2 0,3 0,4 0,
Multiplication - - 4 - - -
The convolution is:
These results are exactly the same of the ones obtained using the first method. Notice that the sum that gives
the generic 𝑧(𝑋𝑠) is one of the column of the previous approach.
The convolution is 0 up to 𝑡 = 10 𝑠, then it starts to increase. In 𝑡 = 11 𝑠, i.e. 𝑥 = 1 , the result of the
convolution is 8.
Beyond the point 𝑥 = 1 , the area below the new signal is no more 8 𝑥 but the law changes. In fact, the type
of superimposition between the signals changes:
Notice that also the other portion of the first signal has to be considered.
The situation after 12 𝑠 is:
Carrying out the multiplication:
The area below this curve is 18.
So, the trend of the convolution is:
Notice that the law is always linear, but its expression changes every time there is a discontinuity. So, the
convolution has to be calculated every time that there is a change in the superposition. Basically, it is enough
to recognize for which values of the delay there is a discontinuity and then evaluate the convolution in this
time instants.
After a delay of 12 𝑠 the situation changes, since the dashed signal translates towards the right and so the
superposition with the first part of the continuous signal decreases. For a delay of 13 𝑠 the dashed signal is
completely superimposed to the second portion of the continuous signal:
The multiplication is a rectangle between 1 and 3 with a height of 10. So, the area is: ( 2 ∙ 5 ) ∙ ( 3 − 1 ).
The trend of the convolution is:
As before, the trend is linear.
For 𝑡 greater than 13 𝑠, the dashed signal moves outside the solid signal. For a delay of 15 𝑠, the two curves
are completely not-superimposed, so the convolution goes to zero. So, the final result is:
If one of the two signals is negative, a negative area is obtained (the curve is in the negative part of the plane).
Notice that if the signal has curves (i.e. it is not a sequence of flat portions) the trend of the convolution
between one point and the other is not linear.
For the convolution of continuous signals this graphical approach is always used.
𝑥𝑥
𝑟
2
𝑇→∞
2
𝑟
2
2
The MSQ of a signal can be expressed also as:
𝑟
2
𝑟
2
𝑟
2
2
Where 𝜇
𝑟
is the mean value of the signal 𝑟 and 𝜎 its standard deviation (which is equal to the
standard deviation of 𝑥). By definition, 𝜇 𝑟
= 0. Then:
𝑟
2
2
Finally:
𝑥𝑥
2
2
2
2
Eventually, the autocorrelation can be plot, remembering that it is an even function:
Consider the following signal:
𝑦 = 1 + cos( 8 𝜋𝑖 𝑡)
Where 𝑖 is the last number of the ID.
Moreover:
𝑠
𝑤
The frequency of the signal can be calculated as:
𝑝
Since 𝑓
𝑠
𝑝
, there is not aliasing.
The spectrum of the original signal is made of two lines (at ±𝑓 𝑝
) and line at 𝑓 = 0 , due to the mean value:
The product between the signal and the sampling function in time domain corresponds to the convolution
between the signal’s spectrum and the spectrum of the sampling function, which is:
Then, the result of the convolution is:
This spectrum has to be convolved with the one of the window. Assuming to use the Hanning window, its
spectrum is:
The relation between 𝑓
𝑝
and Δ𝑓 is given by: