Complete the code to create a new sample rate by doubling the original sample rate.
new_sample_rate = original_sample_rate [1] 2
Multiplying the original sample rate by 2 doubles it, which is a common way to increase sample rate.
Complete the code to downsample a signal by keeping every {{BLANK_1}}-th sample.
downsampled_signal = original_signal[::[1]]Using a step of 2 in slicing keeps every second sample, effectively downsampling by 2.
Fix the error in the code to correctly upsample a signal by inserting zeros between samples.
upsampled_signal = [original_signal[i // [1]] if i % [1] == 0 else 0 for i in range(len(original_signal) * [1])]
Using 2 inserts a zero between each original sample, doubling the length and upsampling by 2.
Fill both blanks to create a dictionary mapping each sample index to its value only if the value is greater than 0.
filtered_samples = {i: sample for i, sample in enumerate(original_signal) if sample [1] 0 and i [2] 10}The code keeps samples greater than 0 and with index less than 10.
Fill both blanks to create a dictionary of squared sample values for samples with index less than 5 and value greater than 0.
squared_samples = {i: sample[1] for i, sample in enumerate(original_signal) if i [2] 5 and sample > 0}The dictionary comprehension keeps index as key, squares the sample value, and filters by index less than 5 and positive samples.
