Question: How long is a sound compared to the original when its been frequency doubled (Program 116 (page 261))? How long is a sound compared to

How long is a sound compared to the original when it’s been frequency doubled (Program 116 (page 261))? How long is a sound compared to the original when only every fourth sound value is copied into the target sound?


Data from Program 116

def double(source): len = getLength(source) / 2 + 1 target = makeEmptySound (len) targetIndex = 0 for sourceIndex in range (0, getLength(source), 2): getSampleValueAt (source, sourceIndex) setSampleValueAt (target, targetIndex, sourceValue) sourceValue = targetIndex targetIndex + 1 %3D play(target) return target

def double(source): len = getLength(source) / 2 + 1 target = makeEmptySound (len) targetIndex = 0 for sourceIndex in range (0, getLength(source), 2): getSampleValueAt (source, sourceIndex) setSampleValueAt (target, targetIndex, sourceValue) sourceValue = targetIndex targetIndex + 1 %3D play(target) return target

Step by Step Solution

3.41 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

With the frequency doubled the sound is half its origi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction to Computing and Programming in Pytho Questions!