MatLab has in-built filtering and other digital signal processing tools that you can use to modify the audio. Once you have the audio file read-in to MatLab, you can do a whole host of things to it. Sample values in the audio matrix are represented by doubles and are normalized (the maximum value is 1). I would encourage the reader to save both since the sample rate will prove to be important in basically every useful process you could perform on the audio. The audioread function has two output arguments: the matrix of samples from the audio file & the sample rate. If you want to select the file off your computer, you could use uigetfile for this. Please note, filename here means the directory too (:C\TheDirectory\TheFile.wav). So let’s get into some details… audioread has only one input argument (actually, it can be used with more than one, but for our purposed, you only have to use one), the filename. Still, there are a number of good, free MP3 encoders out there that can turn your WAV or FLAC file into an MP3 after you’ve created it. Both functions can tolerate most conventional audio file formats (WAV, FLAC, M4A, etc…) however, there is an asymmetry between the two function in that, while audioread can read-in MP3 files, audiowrite cannot write MP3 files. As the names may suggest, audioread can read-in an audio file from your machine and turn it into a matrix audiowrite can take a matrix and write it to your computer as a new audio file. MathWorks provides two built-in functions for handling audio: audioread() & audiowrite(). Paired with some of the knowledge for my last two articles, one can begin to see how a variety of media-processing tools can be created using MatLab.Īudio is, perhaps, the simplest place to start. Learning about how to handle media files allows to you see how computation effects pictures, and hear how it effects music. To the programming enthusiast, it can be hard to learn about data structures and search algorithms and have only the facilities to apply this knowledge to text documents and large arrays of numbers. Handling media files in MatLab is, not only extremely useful, but is also rewarding. You might be wondering: does anyone love anything as much as I love MatLab? I get it, another MatLab article… Well, this one is pretty cool.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |