0
0
Signal Processingdata~10 mins

Why windowing is needed in Signal Processing - Test Your Understanding

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

Complete the code to apply a window function to a signal array.

Signal Processing
import numpy as np
signal = np.array([1, 2, 3, 4, 5])
window = np.[1](len(signal))
windowed_signal = signal * window
Drag options to blanks, or click blank then click option'
Ahanning
Brandom
Czeros
Dones
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ones' window does not reduce edge effects.
Using 'zeros' window will zero out the signal.
Using 'random' window adds noise.
2fill in blank
medium

Complete the code to compute the Fourier Transform of a windowed signal.

Signal Processing
import numpy as np
signal = np.array([1, 2, 3, 4, 5])
window = np.hanning(len(signal))
windowed_signal = signal * window
spectrum = np.fft.[1](windowed_signal)
Drag options to blanks, or click blank then click option'
Aifft
Brfft
Cfft
Dfftshift
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ifft' computes inverse transform, not spectrum.
Using 'fftshift' rearranges spectrum but does not compute it.
Using 'rfft' is for real inputs but less general.
3fill in blank
hard

Fix the error in the code to avoid spectral leakage by applying windowing before FFT.

Signal Processing
import numpy as np
signal = np.array([1, 2, 3, 4, 5])
windowed_signal = signal * [1]
spectrum = np.fft.fft(windowed_signal)
Drag options to blanks, or click blank then click option'
Anp.hanning(len(signal))
Bnp.random.rand(len(signal))
Cnp.zeros(len(signal))
Dnp.ones(len(signal))
Attempts:
3 left
💡 Hint
Common Mistakes
Using ones does not reduce leakage.
Using zeros removes the signal.
Using random adds noise.
4fill in blank
hard

Fill both blanks to create a windowed signal and compute its magnitude spectrum.

Signal Processing
import numpy as np
signal = np.array([1, 2, 3, 4, 5])
window = np.[1](len(signal))
windowed_signal = signal * window
magnitude = np.abs(np.fft.[2](windowed_signal))
Drag options to blanks, or click blank then click option'
Ahamming
Bfft
Cifft
Dblackman
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ifft' instead of 'fft' for spectrum.
Using 'blackman' window is valid but not the expected answer here.
Mixing window and transform functions.
5fill in blank
hard

Fill all three blanks to create a windowed signal, compute its FFT, and normalize the magnitude.

Signal Processing
import numpy as np
signal = np.array([1, 2, 3, 4, 5])
window = np.[1](len(signal))
windowed_signal = signal * window
spectrum = np.fft.[2](windowed_signal)
magnitude = np.abs(spectrum) / [3](window)
Drag options to blanks, or click blank then click option'
Ablackman
Bfft
Csum
Dhanning
Attempts:
3 left
💡 Hint
Common Mistakes
Using blackman window is valid but not the expected here.
Not normalizing magnitude leads to incorrect scale.
Using ifft instead of fft.