Why does signal processing focus on analyzing data patterns?
Think about what useful things we want to get from signals.
Signal processing analyzes data patterns to find useful information like voice, images, or sensor readings. This helps us understand or improve the signals.
What is the output of this MATLAB code that detects a pattern in a signal?
signal = [1 2 3 2 1 0 1 2 3 2 1]; pattern = [1 2 3]; idx = strfind(signal, pattern); disp(idx);
Look for where the pattern [1 2 3] starts in the signal array.
The pattern [1 2 3] appears starting at positions 1 and 7 in the signal array.
What error does this MATLAB code produce when trying to find a pattern in a signal?
signal = [1 2 3 4 5]; pattern = [2 3 6]; idx = strfind(signal, pattern); disp(idx);
Consider what happens if the pattern is not found in the signal.
The code runs without error but returns an empty array because the pattern [2 3 6] does not exist in the signal.
Which option correctly applies a moving average filter to smooth a signal in MATLAB?
signal = [1 3 5 7 9 11]; windowSize = 3;
Check the order and number of arguments for the filter function.
The filter function syntax is filter(b, a, x) where b is numerator coefficients and a is denominator coefficients. Option A uses correct syntax for moving average.
Given this MATLAB code that detects peaks in a noisy signal, how many peaks does it find?
t = 0:0.01:1; signal = sin(2*pi*5*t) + 0.5*randn(size(t)); [pks, locs] = findpeaks(signal, 'MinPeakHeight', 0.7); numPeaks = length(pks);
Consider the frequency of the sine wave and the noise threshold.
The sine wave has 5 cycles in 1 second, but the noise and peak height threshold reduce detected peaks to about 3.
