Challenge - 5 Problems
Signal Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
๐ง Conceptual
intermediateUnderstanding the basic definition of a signal
Which of the following best describes what a signal is in signal processing?
Attempts:
2 left
๐ก Hint
Think about what carries information in communication systems.
โ Incorrect
A signal is any function that carries information. It can be electrical, sound, or other types of data that represent real-world phenomena.
โ Predict Output
intermediateOutput of a simple discrete signal array
What is the output of the following Python code that represents a discrete signal?
Signal Processing
import numpy as np signal = np.array([0, 1, 2, 3, 4]) print(signal * 2)
Attempts:
2 left
๐ก Hint
Multiplying a numpy array by 2 doubles each element.
โ Incorrect
The numpy array elements are multiplied by 2 element-wise, resulting in [0, 2, 4, 6, 8].
โ data_output
advancedResulting frequency components after Fourier Transform
Given a discrete signal sampled as [1, 0, -1, 0], what is the output of its discrete Fourier transform (DFT)?
Signal Processing
import numpy as np signal = np.array([1, 0, -1, 0]) dft = np.fft.fft(signal) print(np.round(dft, decimals=1))
Attempts:
2 left
๐ก Hint
Recall that the DFT of a real-valued signal can have complex conjugate symmetry.
โ Incorrect
The DFT of [1, 0, -1, 0] results in [0, 2, 0, -2] with zero imaginary parts, showing frequency components at indices 1 and 3.
โ visualization
advancedPlotting a continuous sine wave signal
Which option correctly plots a continuous sine wave signal using matplotlib in Python?
Signal Processing
import numpy as np import matplotlib.pyplot as plt t = np.linspace(0, 1, 500) signal = np.sin(2 * np.pi * 5 * t) plt.plot(t, signal) plt.xlabel('Time (seconds)') plt.ylabel('Amplitude') plt.title('5 Hz Sine Wave') plt.show()
Attempts:
2 left
๐ก Hint
Frequency of 5 Hz means 5 cycles per second.
โ Incorrect
The plot shows a sine wave oscillating 5 times over the 1-second interval, matching the 5 Hz frequency.
๐ง Debug
expertIdentify the error in signal normalization code
What error will the following code produce when normalizing a signal array, and why?
Signal Processing
import numpy as np signal = np.array([0, 2, 4, 6, 8]) normalized = (signal - np.min(signal)) / (np.max(signal) - np.min(signal)) print(normalized) # Now normalize again incorrectly normalized_again = (signal - np.min(signal)) / np.max(signal - np.min(signal)) print(normalized_again)
Attempts:
2 left
๐ก Hint
Check the difference between np.max(signal - np.min(signal)) and np.max(signal) - np.min(signal).
โ Incorrect
No error occurs; both normalizations produce the same correct output because np.max(signal - np.min(signal)) equals np.max(signal) - np.min(signal), which is the range of the signal.
