Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MATLAB 2.3 Reading WAV File into MATLAB and Playing an Array Many sound files are stored in av format: see http://en.wikipedia.org/wiki/WAV for more infor mation
MATLAB
2.3 Reading WAV File into MATLAB and Playing an Array Many sound files are stored in av format: see http://en.wikipedia.org/wiki/WAV for more infor mation about this particular format. Other formats are available, such as mp3; we will focus on wav in this lab. The MATLAB command audioread is the one to use to read data in wav files into MATLAB data arrays. For example: xxaudioread 'myvoice.wav will load the data in the file myvoice.wav into the array xx. Another command length(xx) will tell you how many values have been read into xx. In many applications, you may need to know what is called the sampling rate, which is the number of sample values per second at which the data was acquired into the file. These parameters can be retrieved as part of the audioread result xx, fs]-audioread ('myvoice.wav) For this exercise, you need to access some wav files. If you have your own inventory of vav files, you are welcome to use them here. (Make sure the file is long enough for the exercise; see below). If not, a file called ece2026Lab01voice.vav can be downloaded from t-square for your use. Learn to use the audioread command to read the data into an array, say xx. You can find out how long the signal is in seconds by reading the length of the array via length(xx) which gives you the total number of samples and then divide it by fs, the sampling rate in samples per second. Then, plot the sound wave xx, from t = 0.25 to t = 0.5. You need to know how to translate time into the index of the array: an example has already been shown above Show the plotted result to the instructor Instructor Verification (separate page) In MATLAB, an array of data can be played to produce audible sound, using soundsc (xx, fs) % what is xx and fa??? Make sure you know what these are Try the command yourself and listen to the data you just read in from the file ece20261ab0voice.wav Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started