Bird
Raised Fist0
Signal Processingdata~20 mins

Echo and reverb effects in Signal Processing - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Echo and Reverb Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Echo Delay Time

In audio signal processing, an echo effect is created by adding a delayed version of the original sound to itself. If the delay time is too short, the echo blends with the original sound and is perceived as a reverb instead. What is the typical minimum delay time (in milliseconds) for a distinct echo to be heard by the human ear?

AMore than 200 ms
BAround 50 ms
CLess than 10 ms
DAround 100 ms
Attempts:
2 left
💡 Hint

Think about how quickly the ear can distinguish two separate sounds.

❓ Predict Output
intermediate
2:00remaining
Output of Simple Echo Effect Code

Consider the following Python code that applies a simple echo effect to a 1D audio signal represented as a list of samples. What is the output list after running this code?

Signal Processing
original = [1, 2, 3, 4, 5]
delay = 2
attenuation = 0.5
output = original.copy()
for i in range(delay, len(original)):
    output[i] += attenuation * original[i - delay]
print([round(x, 2) for x in output])
A[1, 2, 3, 4, 5]
B[1, 2, 3, 5.5, 7.0]
C[1, 2, 3.5, 5.0, 6.5]
D[1, 2, 3, 4.5, 6.5]
Attempts:
2 left
💡 Hint

Check how the delayed samples are added with attenuation starting from index equal to delay.

❓ data_output
advanced
1:30remaining
Reverb Effect Impulse Response Length

You apply a reverb effect by convolving an audio signal with an impulse response (IR) that simulates room reflections. If the original audio signal has 1000 samples and the IR has 300 samples, how many samples will the convolved output have?

A1000 samples
B1299 samples
C700 samples
D300 samples
Attempts:
2 left
💡 Hint

Recall the length formula for convolution of two discrete signals.

🔧 Debug
advanced
2:00remaining
Identify the Error in Echo Code

Here is a Python function to add an echo effect to a list of audio samples. It is supposed to add a delayed and attenuated version of the signal to itself. What error will this code raise when called?

Signal Processing
def add_echo(signal, delay, attenuation):
    output = signal
    for i in range(delay, len(signal)):
        output[i] += attenuation * signal[i - delay]
    return output

samples = [1, 2, 3, 4, 5]
result = add_echo(samples, 2, 0.5)
print(result)
AModifies original list unintentionally
BTypeError due to adding float to int in list
CIndexError due to out-of-range access
DNo error, outputs [1, 2, 3.5, 5.0, 6.5]
Attempts:
2 left
💡 Hint

Consider what happens when you assign one list to another variable without copying.

🚀 Application
expert
2:30remaining
Visualizing Echo and Reverb Effects

You have two audio signals: one with a single echo and one with a reverb effect applied. You plot their waveforms over time. Which of the following descriptions best matches the visual difference between the echo and reverb waveforms?

AEcho waveform shows a distinct repeated peak after the original sound; reverb waveform shows a dense cluster of smaller peaks fading gradually.
BEcho waveform is a smooth continuous wave; reverb waveform has sharp spikes only at the start.
CEcho waveform has no visible delay; reverb waveform shows a single delayed peak.
DEcho waveform and reverb waveform look identical with no visible differences.
Attempts:
2 left
💡 Hint

Think about how echoes and reverbs sound and how that translates visually in waveforms.

Practice

(1/5)
1. What is the main difference between echo and reverb effects in audio processing?
easy
A. Echo is a single delayed repeat; reverb is many quick repeats.
B. Echo is louder than the original sound; reverb is quieter.
C. Echo removes the original sound; reverb enhances it.
D. Echo happens instantly; reverb has a long delay.

Solution

  1. Step 1: Understand echo effect

    Echo is created by adding a single delayed repeat of the original sound.
  2. Step 2: Understand reverb effect

    Reverb is created by adding many quick, overlapping repeats that simulate space.
  3. Final Answer:

    Echo is a single delayed repeat; reverb is many quick repeats. -> Option A
  4. Quick Check:

    Echo vs Reverb difference = single vs many repeats [OK]
Hint: Echo = one delay; reverb = many quick delays [OK]
Common Mistakes:
  • Confusing echo with reverb as the same effect
  • Thinking echo is louder than original
  • Believing reverb removes original sound
2. Which of the following Python code snippets correctly applies a simple echo effect to an audio signal array signal with delay d and decay factor alpha?
easy
A. echoed = signal * alpha + np.roll(signal, d)
B. echoed = signal + alpha * np.roll(signal, d)
C. echoed = np.roll(signal, d) + alpha
D. echoed = signal + np.roll(signal, alpha)

Solution

  1. Step 1: Understand echo formula

    Echo effect adds the original signal plus a delayed, scaled copy: signal + alpha * delayed_signal.
  2. Step 2: Check code correctness

    echoed = signal + alpha * np.roll(signal, d) uses np.roll(signal, d) to delay and multiplies by alpha, then adds to original signal correctly.
  3. Final Answer:

    echoed = signal + alpha * np.roll(signal, d) -> Option B
  4. Quick Check:

    Correct echo formula = original + alpha * delayed [OK]
Hint: Echo = original + alpha * delayed signal [OK]
Common Mistakes:
  • Multiplying original signal by alpha instead of delayed
  • Using alpha as delay index
  • Adding alpha as a scalar instead of scaling delayed signal
3. Given the following Python code applying a simple echo effect, what will be the value of output[3]?
import numpy as np
signal = np.array([1, 2, 3, 4, 5])
delay = 2
alpha = 0.5
output = signal + alpha * np.roll(signal, delay)
medium
A. 5.0
B. 4.5
C. 3.5
D. 2.5

Solution

  1. Step 1: Calculate delayed signal at index 3

    np.roll(signal, 2) shifts signal by 2: [4, 5, 1, 2, 3]. At index 3, delayed value is 2.
  2. Step 2: Calculate output at index 3

    output[3] = signal[3] + alpha * delayed[3] = 4 + 0.5 * 2 = 4 + 1 = 5.0
  3. Final Answer:

    5.0 -> Option A
  4. Quick Check:

    4 + 0.5*2 = 5.0 [OK]
Hint: Add original + alpha * delayed at index [OK]
Common Mistakes:
  • Mixing up indices after roll
  • Forgetting to multiply delayed by alpha
  • Using wrong delay value
4. The following code attempts to create a reverb effect by mixing multiple delayed signals, but it produces unrealistic results. What is the main issue?
import numpy as np
signal = np.array([1, 2, 3, 4, 5])
delays = [1, 2, 3]
alpha = 0.5
output = signal
for d in delays:
    output += alpha * np.roll(signal, d)
medium
A. The variable output is not initialized as a float array, causing type errors.
B. The += operator cannot be used with numpy arrays.
C. The loop should multiply alpha by d, not signal.
D. Using np.roll shifts the signal incorrectly for reverb.

Solution

  1. Step 1: Identify the issue with np.roll

    np.roll(signal, d) performs a circular shift, wrapping the end of the signal to the start, which creates unrealistic artifacts in reverb simulation.
  2. Step 2: Proper approach for reverb delays

    To simulate true delays, pad the signal with zeros instead of using circular roll to avoid wrap-around.
  3. Final Answer:

    Using np.roll shifts the signal incorrectly for reverb. -> Option D
  4. Quick Check:

    np.roll = circular shift [unsuitable for reverb] [OK]
Hint: np.roll wraps around; use zero-padding for delays [OK]
Common Mistakes:
  • Using circular np.roll for linear delays
  • Ignoring wrap-around artifacts in reverb
  • Thinking data types cause issues
5. You want to create a reverb effect by mixing the original audio signal with 3 delayed copies at delays 1, 2, and 3 samples, each with decreasing decay factors 0.6, 0.3, and 0.1 respectively. Which Python code correctly implements this?
hard
A. output = signal + 0.1*np.roll(signal,1) + 0.3*np.roll(signal,2) + 0.6*np.roll(signal,3)
B. output = signal * (0.6 + 0.3 + 0.1) + np.roll(signal,1) + np.roll(signal,2) + np.roll(signal,3)
C. output = signal + 0.6*np.roll(signal,1) + 0.3*np.roll(signal,2) + 0.1*np.roll(signal,3)
D. output = signal + np.roll(signal,1)*0.1 + np.roll(signal,2)*0.3 + np.roll(signal,3)*0.6

Solution

  1. Step 1: Understand reverb mixing

    Reverb mixes original plus delayed signals scaled by decay factors in order of delay.
  2. Step 2: Match decay factors to delays

    Decay 0.6 for delay 1, 0.3 for delay 2, 0.1 for delay 3 matches output = signal + 0.6*np.roll(signal,1) + 0.3*np.roll(signal,2) + 0.1*np.roll(signal,3).
  3. Step 3: Check code correctness

    output = signal + 0.6*np.roll(signal,1) + 0.3*np.roll(signal,2) + 0.1*np.roll(signal,3) adds original signal plus each delayed signal multiplied by correct decay factor.
  4. Final Answer:

    output = signal + 0.6*np.roll(signal,1) + 0.3*np.roll(signal,2) + 0.1*np.roll(signal,3) -> Option C
  5. Quick Check:

    Decay factors match delays in order [OK]
Hint: Match decay factors to delays in order when adding [OK]
Common Mistakes:
  • Mixing decay factors with wrong delays
  • Multiplying original signal by sum of decays
  • Reversing decay order
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