0
0
Signal Processingdata~20 mins

Windowing methods (Hamming, Hanning, Blackman) in Signal Processing - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Windowing Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2: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)
A[0.42 0.5 1. 0.5 0.42 ]
B[0.08 0.3979 0.9129 0.9129 0.3979]
C[0.08 0.54 1. 0.54 0.08 ]
D[0.0 0.5 1. 0.5 0.0 ]
Attempts:
2 left
💡 Hint
Recall that the Hamming window starts and ends near 0.08, not zero.
data_output
intermediate
1: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))
A5
B6
C8
D7
Attempts:
2 left
💡 Hint
The window length parameter defines the output array length exactly.
🧠 Conceptual
advanced
2:00remaining
Main difference between Hanning and Hamming windows
Which statement best describes the main difference between Hanning and Hamming windows?
AHanning window has zero values at the edges, Hamming window has non-zero edges.
BHamming window has zero values at the edges, Hanning window has non-zero edges.
CBoth windows have zero values at the edges but differ in peak amplitude.
DBoth windows have non-zero edges but differ in length.
Attempts:
2 left
💡 Hint
Think about the values at the start and end of each window.
visualization
advanced
3: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()
APlots Blackman window only with incorrect title.
BPlots all three windows with labels and title correctly.
CPlots only Hamming and Hanning windows without labels.
DPlots all three windows but missing legend and title.
Attempts:
2 left
💡 Hint
Look for code that includes all three plots, labels, legend, and title.
🔧 Debug
expert
1: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)
AValueError: window length must be non-negative
BSyntaxError: invalid syntax
CTypeError: unsupported operand type(s) for -: 'int' and 'str'
DNo error, prints an empty array
Attempts:
2 left
💡 Hint
Window length cannot be negative.