ECE203: Introduction to MATAB programming
HW2
Problem 1 [10pts]
Using the provided program record_sound.m record two different sounds (each eight
seconds long). One of them ought to contain at least 5 words of your choosing (a sentence). The
other one should be a music of your choosing. You may rename the my_sound.wav file generated
by the program after recording the first time around in order to avoid re-writing it (so that you have
two separate wave files that you can manipulate).
Create a script file called run_sound_processing.m and start by reading in those two wave
files into two different variables. Note that the sampling frequency should be the same (8K
samples/sec) for both recording since you made use of the same program to generate the wave
files. You are to replace the quite instances (instances between words of first recording) with
segments of the second recording. As you play the end-result, you should hear a word followed by
music, another word followed by music and so on. Note that you don’t want to crop long segments
of music as you need to ensure that there are enough segments to be inserted for all 5 words.
Additionally, do provide a plot where the end-result is plotted against sample indices into
one subplot and another one where the end-result is plotted against time in seconds. Use different
colors to show the two recordings (e.g., red for the ones corresponding to words and blue for the
ones corresponding to music segment). Make sure to label your plots and assign a legend.
Do make sure to include all your files when submitting your work (including the .wav files)
Problem 1 [5pts]
Create a program called plot_logo..m. Insert lines of code to reproduce the figure shown
below. Hint: you can change the center of a circle by simply adding an offset the coordinates of
its perimeter.
-1.5 -1 -0.5 0 0.5 1 1.5 -1.5
-1
-0.5
0
0.5
1