ABCs_sound - % % Write your code here: F = 1./(C.*E); F %...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
function [A, B, C, D, E, F, G, H, I, J, K] = ABCs_sound(filename) % ABCs of Sound % % This is a multi-part problem. Do each of the parts below. % % DO NOT CHANGE THE FUNCTION HEADER (the first line of code) % % a,b) wavread(). Open the .wav whose name is stored in the variable % filename. Store the amplitude values in A and store the sampling % frequency in B. % % Write your code here: [A B] = wavread(filename); [ % C) Find how many samples there are in the sound file read in in parts % A and B? Store your answer in C. % % Write your code here: C = length(A); C % D) Find the duration (or maximum time) of the sound from part a. Store % this value in D. % % Write your code here: D = C./B; D % E) Find dt (delta time), the time in seconds which each sample % represents. % % Write your code here: E = 1./B; E % F) Find the frequency difference (df/delta frequency) between fast % fourier transforms of the samples of the sound from part a. Store your % answer in F. % % Refer to the book for assistance. Units should be 1/s = Hz.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % % Write your code here: F = 1./(C.*E); F % G) Find the maximum possible frequency that could be present in A. Store % your answer in G. Use the Nyquist theorum. % % Write your code here: G = 0.5.*C.*F; G % H) Find the Fast Fourier Transform of the sound from part a. Store your % answer in H. Refer to fft.pdf. % % Write your code here: H = 2.*abs(fft(A))./C; H = H(1:end/2); H % I) Find an amplitude vector that when played will be the sound from part % a in reverse. Store your answer in I. % % Write your code here: I = A(end:-1:1); I % J) Find the sampling frequency that you would use with A and sound() to % make A sound an octave higher. Store the result in J. % % Write your code here: J = B.*2; J % K) Find the amplitude vector that you would use with B and sound() to % make A sound an octave higher. Use round(linspace()). Store the result % in K. % % Write your code here: K = A(round(linspace(1,C,C./2)));...
View Full Document

Page1 / 2

ABCs_sound - % % Write your code here: F = 1./(C.*E); F %...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online