ABCs_sound - Write your code here F = 1(C*E F G Find the...

Info icon This 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.
Image of page 1

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

View Full Document Right Arrow Icon
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern