Addition to GA 2.3#
Task 11#
In task 3 you used three different measurement durations (T_{\text{meas}}) of 1, 5 and 20 seconds, and analysed the DFT-result for a (f_c = 1\ \text{Hz}) sine signal.
Now, repeat task 3, but for a (f_c = 2.5\ \text{Hz}).
Before you plot, figure out what the frequency step size (\Delta f) in the DFT-result will be for these three measurement durations — report these.
Then compute and plot the DFT for these three cases, include them in your report, and comment on these results. Any “weird” results?
Task 12#
In tasks 4 and 5 you worked with a (f_c = 1\ \text{Hz}) sine, with added to that an 80 Hz sinusoid.
The sampling frequency is (f_s = 100\ \text{Hz}).
Instead of the 80 Hz sinusoid, we now add a 60 Hz sinusoid.
In task 5 four different sampling frequencies were used: 110 Hz, 150 Hz, 160 Hz and 200 Hz.
Report, for these four sampling frequencies, the positive frequency at which the first alias of the 60 Hz sinusoid appears.
Task 13#
In task 8 you constructed and plotted the periodogram (by coding it yourself).
Python offers a built-in function. Use that function, and include:
your periodogram from task 8, and
the new one produced with
periodogram
both in your report.
Comment on the differences.
To use periodogram, import:
from scipy.signal import periodogram
The call to the built-in periodogram looks like:
freqs, Sxx = periodogram(
YOUR_SIGNAL,
fs=YOUR_SAMPLING_FREQUENCY,
window='boxcar',
nfft=N,
return_onesided=False,
scaling='density'
)
RUBRIC#
Tasks 11, 12, and 13 are worth 3 points each, making a total of 9 points.
A score of 9 points yields a grade of 10 for this GA.
Task 11 — Rubric#
Report the frequency step sizes (\Delta f) for the three measurement durations. [1 point]
Compute and plot the DFTs for the three cases. [1 point]
Comment on the results (including any “weird” behaviour). [1 point]
Task 12 — Rubric#
For each of the four sampling frequencies, report the positive alias frequency of the 60 Hz sinusoid.
Each correct alias frequency is worth 1 point, up to 3 points total.
Task 13 — Rubric#
Include the original periodogram from task 8. [1 point]
Include the new periodogram using the built-in function. [1 point]
Comment on the differences. [1 point]
Solutions#
Task 11 — Solution#
The frequency step size is:
(T_{\text{meas}} = 1\ \text{s} \Rightarrow \Delta f = 1.0\ \text{Hz})
(T_{\text{meas}} = 5\ \text{s} \Rightarrow \Delta f = 0.2\ \text{Hz})
(T_{\text{meas}} = 20\ \text{s} \Rightarrow \Delta f = 0.05\ \text{Hz})
For (T = 1\ \text{s}) and (T = 5\ \text{s}), the frequency resolution is insufficient:
(f_c = 2.5\ \text{Hz}) is not an integer multiple of (\Delta f), so no single DFT bin aligns with the signal frequency.
This causes spectral leakage — the peak spreads across multiple bins.
For (T = 20\ \text{s}), (f_c = 2.5\ \text{Hz}) aligns nicely with a DFT bin, producing a clear peak.
Task 12 — Solution#
Aliasing occurs only for (f_s = 110\ \text{Hz}):
For (f_s = 110\ \text{Hz}):
(f_{\text{alias}} = f_s - 60 = 50\ \text{Hz})
For the other sampling frequencies, no aliasing occurs and the 60 Hz sinusoid appears at 60 Hz.
However, if you plot over ([0, f_s)), the next spectral copies would place the second sinusoid at:
(f_s = 150\ \text{Hz} \Rightarrow 150 - 60 = 90\ \text{Hz})
(f_s = 160\ \text{Hz} \Rightarrow 160 - 60 = 100\ \text{Hz})
(f_s = 200\ \text{Hz} \Rightarrow 200 - 60 = 140\ \text{Hz})
Task 13 — Solution#
The periodograms from task 8 and from the built-in periodogram function are identical, with peaks at the correct frequencies.
Differences only occur if you choose different frequency ranges:
Task 8 used ([-f_s/2, f_s/2)).
If instead you use ([0, f_s)), the negative frequencies appear on the right half.
If you restrict to ([0, f_s/2)), you keep only the positive half of the spectrum.
Amplitude values on the vertical axis should remain consistent.