Challenge - 5 Problems
Windowing Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of Hamming window array
What is the output array when applying a Hamming window of length 5 using numpy?
Signal Processing
import numpy as np np.set_printoptions(precision=4, suppress=True) window = np.hamming(5) print(window)
Attempts:
2 left
💡 Hint
Recall that the Hamming window starts and ends near 0.08, not zero.
✗ Incorrect
The Hamming window of length 5 produces values starting and ending near 0.08, with middle values higher. Option C matches the numpy output.
❓ data_output
intermediate1:30remaining
Length of Blackman window output
What is the length of the array returned by numpy.blackman when called with argument 7?
Signal Processing
import numpy as np window = np.blackman(7) print(len(window))
Attempts:
2 left
💡 Hint
The window length parameter defines the output array length exactly.
✗ Incorrect
The numpy.blackman function returns an array of the exact length specified by the input argument.
🧠 Conceptual
advanced2:00remaining
Main difference between Hanning and Hamming windows
Which statement best describes the main difference between Hanning and Hamming windows?
Attempts:
2 left
💡 Hint
Think about the values at the start and end of each window.
✗ Incorrect
The Hanning window starts and ends at zero, while the Hamming window starts and ends near 0.08, not zero.
❓ visualization
advanced3:00remaining
Plot comparison of Hamming, Hanning, and Blackman windows
Which option produces a plot showing all three windows of length 50 on the same graph with clear labels?
Signal Processing
import numpy as np import matplotlib.pyplot as plt N = 50 hamming = np.hamming(N) hanning = np.hanning(N) blackman = np.blackman(N) plt.plot(hamming, label='Hamming') plt.plot(hanning, label='Hanning') plt.plot(blackman, label='Blackman') plt.legend() plt.title('Window Functions Comparison') plt.show()
Attempts:
2 left
💡 Hint
Look for code that includes all three plots, labels, legend, and title.
✗ Incorrect
Option B includes plotting all three windows with labels, legend, and title, making the visualization clear and complete.
🔧 Debug
expert1:30remaining
Identify error in window function usage
What error will this code raise?
import numpy as np
w = np.hamming(-10)
print(w)
Signal Processing
import numpy as np w = np.hamming(-10) print(w)
Attempts:
2 left
💡 Hint
Window length cannot be negative.
✗ Incorrect
Numpy raises a ValueError if the window length is negative.