0
0
Intro to Computingfundamentals~10 mins

How audio and video are digitized in Intro to Computing - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to represent the process of converting sound waves into digital data by sampling.

Intro to Computing
digital_audio = sample(sound_wave, [1])
Drag options to blanks, or click blank then click option'
Afrequency
Bamplitude
Cduration
Dspeed
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing amplitude instead of frequency
Confusing duration with sampling rate
2fill in blank
medium

Complete the code to show how video frames are captured at a certain rate for digitization.

Intro to Computing
digital_video = capture_frames(video_source, [1])
Drag options to blanks, or click blank then click option'
Aresolution
Bcolor_depth
Cbit_rate
Dframe_rate
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing resolution instead of frame rate
Confusing bit rate with frame rate
3fill in blank
hard

Fix the error in the code that converts analog audio to digital by quantizing the amplitude values.

Intro to Computing
digital_audio = quantize(analog_audio, [1])
Drag options to blanks, or click blank then click option'
Asample_rate
Bbit_depth
Cframe_rate
Dresolution
Attempts:
3 left
💡 Hint
Common Mistakes
Using sample rate instead of bit depth
Confusing frame rate with bit depth
4fill in blank
hard

Fill both blanks to complete the dictionary comprehension that maps video frames to their timestamps in seconds.

Intro to Computing
frame_timestamps = {frame: frame[1] frame_rate for frame in range(1, 6) if frame [2] 2 == 0}
Drag options to blanks, or click blank then click option'
A/
B%
C*
D-
Attempts:
3 left
💡 Hint
Common Mistakes
Using multiplication instead of division for timestamp
Using subtraction instead of modulo for condition
5fill in blank
hard

Fill all three blanks to create a dictionary of audio samples with their quantized values filtered by bit depth.

Intro to Computing
quantized_samples = {sample[1] bit_depth: value for sample, value in audio_data.items() if value [2] max_value and sample[3] 2 == 0}
Drag options to blanks, or click blank then click option'
A**
B<
C%
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using '+' instead of '**' for power
Using '>' instead of '<' for filtering
Using '-' instead of '%' for modulo