ECE 203: Introduction to MATLAB Programming
Assignment 3 (20 Points)
Using the provided program in resources record_sound.m record a sentence in your voice (with a
minimum of four words). You may name the audio file “my_sentence.wav”
Problem 1 (12 Points)
1. Create a new Script file “run_reverse_repeat_words.m”
2. Load the audio “my_sentence.wav”
3. Play the audio file and pause for 7 seconds.
4. Create a new figure window. Plot a waveform of the audio file against sample indices and
make sure to label the axes.
5. Segment the words present in the audio file by determining the indices of each word using
MATLAB’s data cursor in the waveform plot.
6. Now create an array named “repeat_reverse” and concatenate the words such that each
word repeats in the reverse order. For instance, if your original audio contained the words
“One, Two, Three, Four” then your repeat_reverse audio should contain “Four Four, Three
Three, Two Two, One One”
7. Create a new figure window. Plot the waveform of repeat_reverse against sample indices
and make sure to label the axes.
8. Make sure to write the repeat_reverse audio variable into an audio file
“repeat_once_reverse.wav”
Problem 2 (8 Points)
1. Create a new Script file “run_determine_shortest_word.m”
2. Load the audio “my_sentence.wav”
3. Segment the words present in the audio file by determining the indices of each word using
MATLAB’s data cursor in the waveform plot. (You may paste the work you did for
Problem 1 Steps 1-4).
4. Determine the duration of each word in seconds
5. Determine the shortest word (lowest in terms of seconds) in the sentence you recorded
6. Print the shortest word along with its duration in seconds using fprintf()
Things to Submit
1. my_sentence.wav
2. repeat_once_reverse.wav
3. run_reverse_repeat_words.m
4. run_determine_shortest_word.m