In: Statistics and Probability
The sampling frequency should exceed the Nyquist limit of twice the frequency of the note in order to prevent aliasing (appearing as a lower frequency that it actually is). Use the 440 Hz ‘A’ note shown below for the following exercises. Thoroughly answer all questions using the disp() function. Always play the altered series of notes following the original ‘A’ in a ‘song.’ If you are required to plot anything, make sure you limit the axes in such a way (e.g. several cycles) that you can analyze the notes and make educated comments. a = sin(2*pi*440*(0:0.000125:0.5));
a. [7 points] The Magnitude. Change the multiplier in front of the sin() from its default of 1 to 2, 3, and 4. Change it to .5, 1/3, and .25. Include the original ‘A’ along with each of the variations in a ‘song’ (just play them sequentially – Use this method to test your notes in all of the following problems). What does the multiplier control, both mathematically and audibly?
b. [15 points] The Sampling Frequency. Change the sampling frequency, (represented by its reciprocal, the sampling period = 0.000125) from 8000 Hz to 400 Hz, 800 Hz and 2000 Hz. Play the sounds and compare the results by listening to the sounds and plotting the four graphs as subplots on one figure. The subplots should be lined up vertically (subplot(4,1,n)) and the time axis (horizontal) should be the same amount of time for each of them so that you can compare the waves. Remember that soundsc() uses a default sampling frequency unless you specify it. What is the default sampling frequency for soundsc()? What are the problems with lower sampling frequencies? – Give a thoughtful analysis in your displayed text. Can you hear the problems that occur when you play the notes back sequentially using the default sampling frequency? Explain the distortion in the sound. See http://en.wikipedia.org/wiki/Aliasing for help in understanding this. You should consider creating a separate time vector for each sampling frequency and its corresponding ‘A’... t8000 = [0:0.000125:0.5]; %Time vector sampled at 8000 Hz A8000 = sin(2*pi*440*t8000); %0.5s A-note sampled at 8000 Hz t400 = [0:0.0025:0.5]; %Time vector sampled at 400 Hz A400= %0.5s A-note sampled at 400 Hz ...
c. [7 points] The Frequency. Change the multiplier of the 440 frequency from 1 to 2, 3, and 4. Is there any difference in the sound? If so, what is the difference? Use specific terms to describe the relationship of each altered note to the original note. Consult the MathMusic.pdf if you need to understand the relationships of the altered notes to the original.
d. [6 points] The Phase Angle. Change the initial angle of the sine wave by adding a phase shift of pi/4 to the argument of the sine in order to shift the curve. (Time shift-start time) Is the sound different? Why or why not?
e. [20 points] Adding Harmonics. Create the following single note: (Notice the addition of harmonics – frequency multiples of the fundamental A frequency - with lower amplitudes) a_aug = sin(2*pi*1*440*(0:(1/8000):0.5)) ... + 0.70*sin(2*pi*2*440*(0:(1/8000):0.5)) ... + 0.50*sin(2*pi*3*440*(0:(1/8000):0.5)) ... + 0.25*sin(2*pi*4*440*(0:(1/8000):0.5)); What is the difference in sound between this note and a pure ‘A’ note? Play them sequentially in a ‘song’ so that you can compare. Your answer should be both qualitative and quantitative. In other words, how does it differ in sound to your ear AND how is it mathematically different? Graph a limited segment (approximately two cycles) of the two sounds for comparison on one plot not using subplots. Include a legend.