Challenge - 5 Problems
Correlation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateOutput of cross-correlation between two signals
What is the output of the following Python code that computes the cross-correlation of two signals using numpy?
Signal Processing
import numpy as np x = np.array([1, 2, 3]) y = np.array([0, 1, 0.5]) result = np.correlate(x, y, mode='full') print(result.tolist())
Attempts:
2 left
💡 Hint
Recall that numpy.correlate with mode='full' returns the cross-correlation at all lags.
✗ Incorrect
The cross-correlation of x and y with mode='full' computes the sum of products at each lag, resulting in [0.5, 2.0, 3.5, 3.0, 0.0].
❓ data_output
intermediateLength of correlation output array
Given two signals of lengths 7 and 5, what is the length of their cross-correlation output using full mode?
Attempts:
2 left
💡 Hint
The length of full cross-correlation output is length_x + length_y - 1.
✗ Incorrect
For signals of length 7 and 5, the full cross-correlation length is 7 + 5 - 1 = 11.
🧠 Conceptual
advancedUnderstanding correlation symmetry
Which statement correctly describes the symmetry property of cross-correlation between two real signals x and y?
Attempts:
2 left
💡 Hint
Think about how swapping signals affects the lag axis.
✗ Incorrect
Cross-correlation of x and y equals the cross-correlation of y and x flipped in time (reversed). This is a key symmetry property.
🔧 Debug
advancedIdentify the error in cross-correlation code
What error will the following code produce when computing cross-correlation of two lists?
Signal Processing
import numpy as np x = [1, 2, 3] y = [0, 1, 0.5] result = np.correlate(x, y, mode='full') print(result)
Attempts:
2 left
💡 Hint
Check if numpy.correlate accepts lists as input.
✗ Incorrect
numpy.correlate accepts lists and converts them internally to arrays, so no error occurs and it prints the cross-correlation.
🚀 Application
expertDetecting time delay using cross-correlation
You have two signals: a clean signal and a delayed noisy version. Which method correctly estimates the delay between them using cross-correlation?
Attempts:
2 left
💡 Hint
The delay corresponds to the lag with highest similarity.
✗ Incorrect
The time delay is estimated by finding the lag where the cross-correlation reaches its maximum, indicating best alignment.
