Assignment title: Information


2016 HOME EXAM IN FYS-2006 Part 1: Music Spectrogram This problem will investigate the frequency spectrum of a short musical sequence. Our sample is taken from the 1977 film "Close encounters of the third kind" and is the melody played to try to communicate with the aliens. It consists of five notes. The data file CE3Notes.mat contains our sound signal, notes, and we are told that the sampling frequency, fs, was 44100 Hz. (a) Your first aim is to play the sound to confirm that you clearly hear the five notes. You may use the built-in MatLab functions sound() and soundsc() to do this, alternatively use play() or playblocking() via an audioplayer object. You will have to work out the choice of parameters by reading the help files. Write out whatever function call you used, with your parameters. [1 pt.] (b) What length is the discrete-time signal notes and how long should it play in seconds? State your reasoning. [2 pts.] Your next aim is to investigate the short-time spectral properties of the signal and produce a time-frequency chart similar to Figure 3-24 from the old textbook and Figure 3-25 from the new textbook. For this task you should use the built-in MatLab function spectrogram(), but you will have to read the help and work out the best parameters to give good results. Hint: do the next two questions together, as the details of the musical scale will help choose the best settings. You should find the standard frequencies for the musical scales on the internet, but choose the scale with A = 440 Hz. (c) Use the built-in spectrogram() function and experiment with the parameters and options to give the clearest spectrogram you can to show the five notes. Show your spectrogram plot, and write out the code and parameters used to create it. [4 pts.] (d) Work out and list the five notes as A-G musical letters, potentially with flats and sharps, and their corresponding cyclic frequencies, f1; f2; f3; f4 and f5. Explain how you obtained your result. [3 pts.] (e) You are told that the spectrogram breaks the time sequence up into short time segments, and then performs a discrete Fourier transform (DFT) for each segment to produce a frequency component strengths. Look up the DFT in the textbook or elsewhere, to explain, i.e., summarise in your own words, how the spectrogram() function works. [2 pts.] (f) Experiment with your parameters to try different time intervals and overlap. Try to understand and describe the concept known as the "uncertainty Principle" of time-frequency resolution. Demonstrate the effect with your own figures. [3 pts.] 22016 HOME EXAM IN FYS-2006 Part 2: Music Filter-bank An alternative implementation of a spectrogram is to use a filter bank, that is, a set of bandpass filters, set to each of the frequencies of interest. It is sufficient to use ideal band-pass filter designs for this work, but you may also experiment with windowed/tapered versions. (a) Explain, in words, how the filter bank system may work. Can you suggest any reasons or situations to prefer the filter bank approach to the DFT approach? [2 pts.] (b) Sketch a block diagram of the whole filter bank system. [1 pt.] (c) Sketch the Frequency response for one such filter, and explain your choice of frequencies for all filters with respect to the same problem as Part 1 { the music spectrogram. [2 pts.] (d) How can you implement this simple Frequency response filter on your original signal. Which domain is easiest? Explain how you can actually perform this filter bank operation, with a step-by-step workflow. [2 pts.] (e) The frequency response (of an ideal band-pass filter) is easy to describe in the Frequencydomain. Use your knowledge of Fourier transform relations between the domains to argue, or rationalise, conceptually for what shape you think the impulse response in the Timedomain would look like. E.g., is it finite or infinite? Explain your reasoning and sketch your idea. [3 pts.] Hint: decompose the frequency response into simpler components and then transform the components and the operator individually to the Time-domain. Think of different scales and envelopes. A simple way to display the filter bank results is to apply the multiple frequency selective filters to the entire signal and just plot the output Time-domain signal for each filtered result stacked one above each other. It will be immediately clear where the signal has strength and where it doesn't from the plot's amplitude scale. (e) Perform the proposed filter bank operation for a set of musical scale centre frequencies covering the appropriate one and a half octaves. Use MatLab's built-in subplot() function to plot them all in one figure in different rows, with the axis off. Label the y-axis of each sub-plot with the frequency scale A-G of each filter, with time as the x-axis. You should be able to make the figure look very much like the spectrogram you produced in Part 1. Show your plot and discuss whether you can identify the given note sequence from this plot also. [2 pts.] (f) You probably obtained some noise like effects, particularly at the boundaries between the notes. Can you explain why this may occur when the notes are suddenly changing? [1 pts.] 32016 HOME EXAM IN FYS-2006 Part 3: Sound Effects We shall perform some digital sound effects on a pre-recorded signals or your own recordings. Two sample sound files are available as Please.mat and Thankyou.mat that contain stereo signals in a variable called data and the sampling frequency fs. Note that you may work in just one channel as they are identical apart from very low level noise. To record your own voice you may use MatLab via the audiorecorder objects and the recordblocking() function, and then save it as a simple data vector as in the previous problem. See the help files to learn how to use these. (a) Confirm that you can play the sound samples by writing down what the Please.mat and Thankyou.mat files are saying? You may want to use the playblocking() function in any scripts, so that the sounds do not overlap in time. [1 pts.] (b) Use the spectrogram() function as before, but try to work out the approximate fundamental frequency of the different voices, including your own if you can. Note that the fundamental frequencies of human voices probably falls within the range from 85 to 300 Hz. (from Wikapedia). Can you make any comments regarding the fundamental frequency throughout the duration of each sentence? Show an example spectrogram plot for one of the voices. [2 pts.] We first want to add a single echo signal to our sound, which could simulate echoing off of a single wall some distance away from the speaker. Lets take the echo time as Te = 0:15 seconds and have a relative strength of 0:5 times the original signal strength. (You may want to play with different time delays afterwards.) (c) What is the difference equation for this single echo system? Is it FIR or IIR and what order? What would the impulse response look like (sketch its form)? [2 pts.] (d) Write out the system function, in the Z-domain, for this echo system and try to sketch its Pole-Zero plot (at least symbolically). [2 pts.] (e) Have fun implementing this system. You can do this in different ways { from the difference equation by just blending shifted vectors, or from the Fourier-domain processing { take your pick. Just explain how you do it. [2 pts.] Now we want to simulate a reverberating echo signal instead, which could simulate echoing between two walls some equal distance from the speaker. Lets take the echo time as Te = 0:15 seconds and relative strength of 0:5 again. (You may want to play with different time delays afterwards.) 4(f) What is the difference equation for this reverberating echo system? Is it FIR or IIR and what order? What would the impulse response look like (sketch its form)? [2 pts.] (g) Write out the out the system function, in the Z-domain, for this echo system and try to sketch its Pole-Zero plot (at least symbolically). [2 pts.] (h) Have fun implementing this system. You can only really do this from the Fourier-domain processing, explain why. [2 pts.] Our next task is to change the fundamental frequency of the recorded speech, i.e., the pitch. We will try a simple way and a more complicated way. You should try to both increase the frequency, say 2 times, to make the \chipmunk" or \helium gas" sound, and also decrease to a very deep voice about, 0.5 times. (i) First consider the simple approach by changing the playback sampling frequency, fs. Explain how making the playback rate different from the recording rate can affect the pitch. Play around with different rates to explore the effect. Are there any other consequences to the sound recordings when changing pitch with this method? Explain why? [2 pts.] (j) Secondly we want to change the pitch while keeping the duration the same. What is the main factor defining the duration of the playback? What would you have to do to change the pitch and still keep the duration the same? [2 pts.] (k) Try to implement this advanced pitch adjustment and upload an example of your resulting sound file. Explain how you do it and include your code. [3 pts.] 5