0
0
Signal Processingdata~10 mins

Power spectral density estimation in Signal Processing - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to compute the power spectral density (PSD) using Welch's method.

Signal Processing
from scipy.signal import welch
frequencies, psd = welch(signal, fs=[1])
Drag options to blanks, or click blank then click option'
A10
B1000
C50
D500
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong sampling frequency causes incorrect frequency axis in PSD.
2fill in blank
medium

Complete the code to plot the PSD on a logarithmic scale.

Signal Processing
import matplotlib.pyplot as plt
plt.semilogy(frequencies, [1])
plt.xlabel('Frequency (Hz)')
plt.ylabel('PSD (V**2/Hz)')
plt.show()
Drag options to blanks, or click blank then click option'
Apsd
Bsignal
Cfrequencies
Dnp.log(psd)
Attempts:
3 left
💡 Hint
Common Mistakes
Plotting the signal or frequencies instead of PSD.
3fill in blank
hard

Fix the error in the code to compute PSD with a Hamming window.

Signal Processing
from scipy.signal import welch, [1]
frequencies, psd = welch(signal, fs=500, window=[1](256))
Drag options to blanks, or click blank then click option'
Ahamming
Bhanning
Cblackman
Dbartlett
Attempts:
3 left
💡 Hint
Common Mistakes
Using a window name not imported or misspelled.
4fill in blank
hard

Fill both blanks to compute PSD with segment length 512 and overlap 256.

Signal Processing
frequencies, psd = welch(signal, fs=500, nperseg=[1], noverlap=[2])
Drag options to blanks, or click blank then click option'
A512
B256
C128
D1024
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up segment length and overlap values.
5fill in blank
hard

Fill all three blanks to create a dictionary of PSD values for frequencies above 100 Hz.

Signal Processing
psd_dict = {f: p for f, p in zip(frequencies, psd) if f [1] 100}
filtered_freqs = [f for f in frequencies if f [2] 100]
filtered_psd = [p for f, p in zip(frequencies, psd) if f [3] 100]
Drag options to blanks, or click blank then click option'
A>
B<
C>=
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' or '<=' which selects wrong frequency range.