Bird
Raised Fist0
Signal Processingdata~20 mins

What is a signal in Signal Processing - Practice Questions & Exercises

Choose your learning style10 modes available
Challenge - 5 Problems
๐ŸŽ–๏ธ
Signal Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
๐Ÿง  Conceptual
intermediate
2:00remaining
Understanding the basic definition of a signal
Which of the following best describes what a signal is in signal processing?
AA signal is a function that conveys information about the behavior or attributes of some phenomenon.
BA signal is a random noise that cannot be analyzed or processed.
CA signal is a programming language used for data analysis.
DA signal is a type of database used to store large amounts of data.
Attempts:
2 left
๐Ÿ’ก Hint
Think about what carries information in communication systems.
โ“ Predict Output
intermediate
2:00remaining
Output 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)
ATypeError: unsupported operand type(s) for *: 'list' and 'int'
B[0 2 4 6 8]
C[0 4 8 12 16]
D[0 1 2 3 4]
Attempts:
2 left
๐Ÿ’ก Hint
Multiplying a numpy array by 2 doubles each element.
โ“ data_output
advanced
3:00remaining
Resulting 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))
A[0.+0.j 2.+0.j 0.+0.j 2.+0.j]
B[0.+0.j 0.+0.j 0.+0.j 0.+0.j]
C[0.+0.j 1.+0.j 0.+0.j 1.+0.j]
D[0.+0.j 2.+0.j 0.+0.j -2.+0.j]
Attempts:
2 left
๐Ÿ’ก Hint
Recall that the DFT of a real-valued signal can have complex conjugate symmetry.
โ“ visualization
advanced
3:00remaining
Plotting 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()
AA smooth sine wave oscillating 5 times between 0 and 1 second.
BA sine wave with random noise added.
CA flat line at zero amplitude.
DA sine wave oscillating only once between 0 and 1 second.
Attempts:
2 left
๐Ÿ’ก Hint
Frequency of 5 Hz means 5 cycles per second.
๐Ÿ”ง Debug
expert
3:00remaining
Identify 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)
ATypeError because np.max(signal - np.min(signal)) is invalid operation.
BWrong normalization result because np.max(signal - np.min(signal)) computes max of array minus scalar, not the range.
CNo error; both normalizations produce the same correct output.
DValueError due to division by zero in normalization.
Attempts:
2 left
๐Ÿ’ก Hint
Check the difference between np.max(signal - np.min(signal)) and np.max(signal) - np.min(signal).

Practice

(1/5)
1. What is a signal in simple terms?
easy
A. A fixed number that never changes
B. A type of computer program
C. A way to carry information about changes over time or space
D. A random noise with no meaning

Solution

  1. Step 1: Understand the definition of a signal

    A signal is something that carries information about changes, like sound or temperature over time.
  2. Step 2: Compare options to the definition

    Only A way to carry information about changes over time or space describes a signal as carrying information about changes over time or space.
  3. Final Answer:

    A way to carry information about changes over time or space -> Option C
  4. Quick Check:

    Signal = Information carrier [OK]
Hint: Signals carry info about change, not fixed values [OK]
Common Mistakes:
  • Thinking a signal is a fixed number
  • Confusing signal with software
  • Assuming signals have no meaning
2. Which of the following is the correct way to represent a simple signal in code?
easy
A. signal = [1, 2, 3, 4, 5]
B. signal = 'hello world'
C. signal = 42
D. signal = True

Solution

  1. Step 1: Identify what a signal looks like in code

    A signal is often a list or array of numbers representing values over time or space.
  2. Step 2: Check each option

    signal = [1, 2, 3, 4, 5] is a list of numbers, which fits the signal concept. Others are a string, a single number, or a boolean, which do not represent signals well.
  3. Final Answer:

    signal = [1, 2, 3, 4, 5] -> Option A
  4. Quick Check:

    Signal = list of numbers [OK]
Hint: Signals are lists or arrays of numbers [OK]
Common Mistakes:
  • Using strings or single values as signals
  • Confusing booleans with signals
  • Not using a sequence for signal data
3. Given the code below, what is the output?
signal = [10, 20, 30, 40]
average = sum(signal) / len(signal)
print(average)
medium
A. 40
B. 20
C. 30
D. 25.0

Solution

  1. Step 1: Calculate the sum of the signal values

    Sum = 10 + 20 + 30 + 40 = 100
  2. Step 2: Calculate the average by dividing sum by number of elements

    Average = 100 / 4 = 25.0
  3. Final Answer:

    25.0 -> Option D
  4. Quick Check:

    Average = 25.0 [OK]
Hint: Average = sum of values รท count [OK]
Common Mistakes:
  • Forgetting to divide by length
  • Using sum without parentheses
  • Mixing sum and max functions
4. Find the error in the code below that tries to calculate the average of a signal:
signal = [5, 15, 25]
average = sum(signal) / signal.length
print(average)
medium
A. signal should be a string, not a list
B. Using signal.length instead of len(signal)
C. Missing parentheses in print statement
D. Using sum() instead of average()

Solution

  1. Step 1: Identify how to get list length in Python

    Python uses len(list) to get length, not list.length.
  2. Step 2: Check the code for length usage

    The code uses signal.length which is invalid in Python and causes an error.
  3. Final Answer:

    Using signal.length instead of len(signal) -> Option B
  4. Quick Check:

    List length = len(list) [OK]
Hint: Use len() for list length in Python [OK]
Common Mistakes:
  • Using .length like in other languages
  • Confusing sum() with average()
  • Forgetting parentheses in print
5. You have a signal representing temperature readings every hour: temps = [22, 21, 23, 22, 24, 23]. How would you create a new signal that shows the change in temperature between each hour?
hard
A. changes = [temps[i+1] - temps[i] for i in range(len(temps)-1)]
B. changes = [temps[i] + temps[i+1] for i in range(len(temps))]
C. changes = [temps[i] * 2 for i in range(len(temps))]
D. changes = [temps[i] / temps[i+1] for i in range(len(temps)-1)]

Solution

  1. Step 1: Understand the goal to find temperature changes between hours

    We want the difference between each consecutive temperature reading.
  2. Step 2: Check each option for correct difference calculation

    changes = [temps[i+1] - temps[i] for i in range(len(temps)-1)] correctly subtracts temps[i] from temps[i+1] for all valid indices.
  3. Final Answer:

    changes = [temps[i+1] - temps[i] for i in range(len(temps)-1)] -> Option A
  4. Quick Check:

    Difference = next - current [OK]
Hint: Subtract consecutive values to find changes [OK]
Common Mistakes:
  • Adding instead of subtracting
  • Using wrong range causing index error
  • Multiplying or dividing instead of subtracting
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard