Why do we perform sample rate conversion in digital signal processing?
Think about why two devices with different sampling rates need to communicate.
Sample rate conversion changes the sampling frequency of a digital signal so it can be processed or played back on systems with different sampling rates.
What is the output array after upsampling the input signal by a factor of 2?
Input signal: [1, 2, 3]
Upsampling means inserting zeros between samples.
input_signal = [1, 2, 3] upsample_factor = 2 output_signal = [] for sample in input_signal: output_signal.append(sample) output_signal.append(0) print(output_signal)
Upsampling by 2 inserts one zero after each original sample.
Upsampling by 2 inserts one zero after each sample, doubling the length of the signal.
Given a signal of length 1000 samples, what is the length after downsampling by a factor of 4?
Downsampling by 4 keeps every 4th sample.
Downsampling by 4 reduces the number of samples to one fourth, so 1000 / 4 = 250.
Which plot best shows the effect of applying an interpolation low-pass filter after upsampling a signal by 2?
The original signal is a sine wave sampled at 10 Hz.
Interpolation filters smooth the zero-inserted samples to reconstruct the signal.
After upsampling by inserting zeros, the interpolation filter smooths the signal to approximate the original waveform at a higher sample rate.
What error will this Python code raise when trying to downsample a signal by 3?
signal = [10, 20, 30, 40, 50] downsample_factor = 3 result = [signal[i] for i in range(0, len(signal), downsample_factor + 1)] print(result)
Check how the step size in range affects the indices selected.
The code uses step = downsample_factor + 1 = 4, so it picks indices 0 and 4, outputting [10, 50]. The code is incorrect because it should use step = downsample_factor = 3 to pick every 3rd sample.
