MaplePortal/DataImagesAudio - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Home : Support : Online Help : MaplePortal/DataImagesAudio

 Importing and Visualizing Data, Images, and Audio

 Introduction

You can import data from many different types of files, including

 • text files and spreadsheets
 • images
 • audio
 • and more

Additionally, if your Maple worksheet is saved as a Workbook, you can attach your data file to the Workbook; this means you only have to manage one file on your computer, not several.

 Import and Plot Data from Excel

 > $\mathrm{data}≔\mathrm{ExcelTools}:-\mathrm{Import}\left(\mathrm{cat}\left(\mathrm{kernelopts}\left(\mathrm{datadir}\right),"/Excel/ExperimentalData.xls"\right),"Experimental","A2:B12"\right):$
 > $\mathrm{plot}\left(\mathrm{data}\right)$

 Import, Play, and Visualize Audio

Here, we import and play audio, and then generate a spectrogram and periodogram of its frequency contents.

The audio is imported as an array of data.

 >
 ${\mathrm{audioFile}}{≔}\left[\begin{array}{cc}{"Sample Rate"}& {11025}\\ {"Bit Depth"}& {16}\\ {"Channels"}& {1}\\ {"Points/Channel"}& {8227}\\ {"Duration"}& {0.75}{}{s}\end{array}\right]$ (1)

This data can be manipulated and further explored using tools from the AudioTools and SignalProcessing packages.

 > $\mathrm{AudioTools}:-\mathrm{Play}\left(\mathrm{audioFile}\right)$
 > 

Spectrogram and Power Spectrum of an Audio File

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$
 > $\mathrm{Spectrogram}\left(\mathrm{audioFile},\mathrm{size}=\left[800,200\right]\right)$
 > $\mathrm{Periodogram}\left(\mathrm{audioFile},\mathrm{size}=\left[800,200\right]\right)$

 Import and Display an Image

 > $\mathrm{img}≔\mathrm{ImageTools}:-\mathrm{Read}\left(\mathrm{cat}\left(\mathrm{kernelopts}\left(\mathrm{mapledir}\right),"/data/images/worldmap.jpg"\right)\right)$
 > $\mathrm{ImageTools}:-\mathrm{Embed}\left(\mathrm{img}\right)$

 Import Data Assistant

 Rather than writing commands to import data, you can also use the Import Data assistant from the Tools > Assistants menu.

 Applications El Centro Earthquake Analysis System Identification Spectrograms PV Diode Parameter Estimation