Bird
Raised Fist0
Signal Processingdata~20 mins

Signal addition and multiplication in Signal Processing - Practice Problems & Coding Challenges

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
1:30remaining
Understanding Signal Addition

When two signals are added together point-wise, what is the resulting signal's amplitude at each point?

AThe difference of the amplitudes of the two signals at each point
BThe product of the amplitudes of the two signals at each point
CThe maximum amplitude between the two signals at each point
DThe sum of the amplitudes of the two signals at each point
Attempts:
2 left
💡 Hint

Think about how you combine two waves by adding their heights at each time.

❓ Predict Output
intermediate
1:30remaining
Output of Signal Multiplication Code

What is the output of the following Python code that multiplies two signals represented as lists?

Signal Processing
signal1 = [1, 2, 3, 4]
signal2 = [2, 0, 1, 3]
result = [a * b for a, b in zip(signal1, signal2)]
print(result)
A[2, 0, 3, 12]
B[3, 2, 4, 7]
C[1, 2, 3, 4]
D[2, 2, 4, 7]
Attempts:
2 left
💡 Hint

Multiply each pair of elements from the two lists.

❓ data_output
advanced
2:00remaining
Resulting Signal from Addition

Given two signals represented as arrays, what is the resulting array after adding them?

Signal Processing
import numpy as np
signal1 = np.array([0, 1, 2, 3, 4])
signal2 = np.array([4, 3, 2, 1, 0])
result = signal1 + signal2
print(result)
A[0 4 4 4 4]
B[4 4 4 4 4]
C[4 3 2 1 0]
D[0 1 2 3 4]
Attempts:
2 left
💡 Hint

Add each element of signal1 to the corresponding element of signal2.

❓ visualization
advanced
2:30remaining
Plotting Signal Multiplication

Which plot correctly shows the multiplication of two signals signal1 = [1, 2, 3, 4] and signal2 = [4, 3, 2, 1]?

Signal Processing
import matplotlib.pyplot as plt
signal1 = [1, 2, 3, 4]
signal2 = [4, 3, 2, 1]
result = [a*b for a,b in zip(signal1, signal2)]
plt.plot(result, marker='o')
plt.title('Signal Multiplication Result')
plt.xlabel('Index')
plt.ylabel('Amplitude')
plt.grid(True)
plt.show()
AA scatter plot with points at [1,4], [2,3], [3,2], [4,1]
BA bar chart with bars at heights [1, 2, 3, 4]
CA line plot with points [4, 6, 6, 4] connected by lines
DA line plot with points [5, 5, 5, 5] connected by lines
Attempts:
2 left
💡 Hint

Multiply each pair of elements and plot the resulting values.

🔧 Debug
expert
2:00remaining
Identify the Error in Signal Multiplication Code

What error does the following code raise when trying to multiply two signals?

signal1 = [1, 2, 3]
signal2 = [4, 5]
result = [a * b for a, b in zip(signal1, signal2)]
print(result)
ANo error; output is [4, 10]
BValueError because lists cannot be multiplied element-wise
CTypeError because zip returns an iterator
DIndexError because the lists have different lengths
Attempts:
2 left
💡 Hint

Consider how zip works when lists have different lengths.

Practice

(1/5)
1. What happens when you add two signals of the same length point by point?
easy
A. The signals are concatenated end to end.
B. You get a new signal where each value is the product of the corresponding values.
C. You get a new signal where each value is the sum of the corresponding values.
D. The signals are subtracted from each other point by point.

Solution

  1. Step 1: Understand signal addition

    Signal addition means adding each value of one signal to the corresponding value of the other signal.
  2. Step 2: Apply point-by-point addition

    For signals of the same length, each position's values are summed to form the new signal.
  3. Final Answer:

    You get a new signal where each value is the sum of the corresponding values. -> Option C
  4. Quick Check:

    Signal addition = sum of values [OK]
Hint: Addition means sum values at each point [OK]
Common Mistakes:
  • Confusing addition with multiplication
  • Thinking signals concatenate instead of adding
  • Assuming subtraction instead of addition
2. Which of the following is the correct Python syntax to multiply two signals stored as lists a and b element-wise?
easy
A. result = a + b
B. result = [a[i] * b[i] for i in range(len(a))]
C. result = multiply(a, b)
D. result = a * b

Solution

  1. Step 1: Understand element-wise multiplication

    We multiply each element of list a by the corresponding element of list b.
  2. Step 2: Use list comprehension with index

    The syntax [a[i] * b[i] for i in range(len(a))] correctly multiplies elements point by point.
  3. Final Answer:

    result = [a[i] * b[i] for i in range(len(a))] -> Option B
  4. Quick Check:

    Element-wise multiply = list comprehension [OK]
Hint: Use list comprehension with index for element-wise multiply [OK]
Common Mistakes:
  • Using a * b which repeats list instead of multiply
  • Using undefined function multiply
  • Using addition instead of multiplication
3. Given two signals a = [1, 3, 5] and b = [2, 4, 6], what is the result of their element-wise addition?
medium
A. [3, 7, 11]
B. [2, 7, 11]
C. [2, 4, 6]
D. [1, 3, 5, 2, 4, 6]

Solution

  1. Step 1: Add corresponding elements of signals

    Calculate 1+2=3, 3+4=7, 5+6=11 for each position.
  2. Step 2: Form the new signal list

    The resulting list is [3, 7, 11].
  3. Final Answer:

    [3, 7, 11] -> Option A
  4. Quick Check:

    Sum each pair = [3, 7, 11] [OK]
Hint: Add each pair of values in order [OK]
Common Mistakes:
  • Adding all values together instead of point-wise
  • Confusing addition with multiplication
  • Concatenating lists instead of adding
4. Consider the code below that tries to multiply two signals element-wise:
signal1 = [1, 2, 3]
signal2 = [4, 5]
result = [signal1[i] * signal2[i] for i in range(len(signal1))]

What is the main problem with this code?
medium
A. The signals have different lengths causing an index error.
B. The multiplication operator is incorrect.
C. The range should be based on signal2 length.
D. List comprehension syntax is invalid.

Solution

  1. Step 1: Check signal lengths

    signal1 has length 3, signal2 has length 2, so they differ.
  2. Step 2: Identify index error cause

    Loop runs 3 times, but signal2[2] does not exist, causing an error.
  3. Final Answer:

    The signals have different lengths causing an index error. -> Option A
  4. Quick Check:

    Different lengths cause index error [OK]
Hint: Check signal lengths before element-wise operations [OK]
Common Mistakes:
  • Ignoring length mismatch
  • Blaming operator instead of index range
  • Assuming list comprehension syntax is wrong
5. You have two signals representing sensor readings:
temp = [20, 22, 21, 23] and humidity = [0.5, 0.6, 0.55, 0.65].
You want to create a new signal that represents the heat index by multiplying temperature and humidity point by point.
What is the correct Python code to do this?
hard
A. heat_index = [temp[i] + humidity[i] for i in range(len(temp))]
B. heat_index = temp * humidity
C. heat_index = multiply(temp, humidity)
D. heat_index = [temp[i] * humidity[i] for i in range(len(temp))]

Solution

  1. Step 1: Confirm signals have same length

    Both temp and humidity have length 4, so element-wise operations are valid.
  2. Step 2: Use list comprehension for multiplication

    Multiply each temperature by corresponding humidity using [temp[i] * humidity[i] for i in range(len(temp))].
  3. Final Answer:

    heat_index = [temp[i] * humidity[i] for i in range(len(temp))] -> Option D
  4. Quick Check:

    Element-wise multiply with list comprehension [OK]
Hint: Multiply matching elements with list comprehension [OK]
Common Mistakes:
  • Using temp * humidity which repeats list
  • Adding instead of multiplying signals
  • Using undefined function multiply
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