0
0
Signal Processingdata~10 mins

Windowing methods (Hamming, Hanning, Blackman) 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 create a Hamming window of length 64 using NumPy.

Signal Processing
import numpy as np
window = np.[1](64)
print(window)
Drag options to blanks, or click blank then click option'
Ahamming
Bbartlett
Cblackman
Dhanning
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'hanning' instead of 'hamming' for a Hamming window.
Misspelling the function name.
Using a window function not related to Hamming.
2fill in blank
medium

Complete the code to generate a Blackman window of length 128 using SciPy.

Signal Processing
from scipy import signal
window = signal.[1](128)
print(window)
Drag options to blanks, or click blank then click option'
Abartlett
Bhanning
Chamming
Dblackman
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'hamming' or 'hanning' instead of 'blackman'.
Confusing NumPy and SciPy window functions.
Incorrect function name casing.
3fill in blank
hard

Fix the error in the code to generate a Hanning window of length 50 using NumPy.

Signal Processing
import numpy as np
window = np.[1](50)
print(window)
Drag options to blanks, or click blank then click option'
Ablackman
Bhamming
Channing
Dhanning_window
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-existent function name like 'hanning_window'.
Confusing Hamming and Hanning window functions.
Incorrect capitalization.
4fill in blank
hard

Fill both blanks to create a dictionary with window names as keys and their corresponding NumPy window arrays of length 32 as values.

Signal Processing
import numpy as np
windows = {
    'Hamming': np.[1](32),
    'Blackman': np.[2](32)
}
print(windows)
Drag options to blanks, or click blank then click option'
Ahamming
Bhanning
Cblackman
Dbartlett
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up window function names.
Using SciPy functions instead of NumPy.
Using the same function for both windows.
5fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps window names to their corresponding SciPy window arrays of length 40, but only include windows with names starting with 'B'.

Signal Processing
from scipy import signal
window_names = ['Hamming', 'Blackman', 'Bartlett', 'Hanning']
windows = {name: signal.[1](40) for name in window_names if name.[2]('B')}
print(windows)
Drag options to blanks, or click blank then click option'
Ahamming
Bstartswith
Cblackman
Dhanning
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong window function for the filtered names.
Using 'startswith' incorrectly or misspelling it.
Not filtering the names properly.