Reading WAV as data/numbers into Excel

  • Thread starter Thread starter bcameron
  • Start date Start date
  • Tags Tags
    Excel Reading
Click For Summary

Discussion Overview

The discussion revolves around reading WAV files as data into Excel for analysis, particularly for Fourier analysis. Participants explore methods for converting WAV files into a format compatible with Excel and discuss the limitations of Excel in handling large datasets typical of audio files.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • Barrett seeks to read WAV file data into Excel for Fourier analysis, having previously done so in MATLAB.
  • One participant suggests converting WAV files to text or CSV format, noting that Excel may struggle with the high data rate of CD-quality audio.
  • Barrett considers writing a utility to convert WAV to text while decimating the data to fit Excel's limitations.
  • Another participant mentions that the sox program can perform the necessary conversion from WAV to text.
  • Concerns are raised about Excel's row limitations, with one participant suggesting that MATLAB or other scientific programs may be better suited for handling large datasets.
  • Barrett shares output from sox, asking for help interpreting the data, specifically regarding the meaning of the fields and units of measurement.
  • Another participant responds to Barrett's query, explaining that the first field represents time and the second field represents amplitude, with amplitude values typically ranging between -1 and 1.

Areas of Agreement / Disagreement

Participants express differing opinions on the suitability of Excel for handling large audio datasets, with some advocating for its use while others recommend alternative software like MATLAB. The discussion remains unresolved regarding the best approach to convert and analyze WAV data in Excel.

Contextual Notes

Limitations include the potential for Excel to struggle with the volume of data from CD-quality audio, and the need for clarification on the units of measurement for audio amplitude.

bcameron
Messages
2
Reaction score
0
Hi,

I have read WAV files as data/numbers into MATLAB before for Fourier analysis etc and am now trying to do the same with Excel.

I have found code online which has allowed me to make use of the winmm.dll from windows to be able to create a WAV sound file from excel and also to be able to play them. Now i can record and play sounds i need to be able to read the data in the WAV files and perform Fourier analysis etc.

Has anyone done this or have any code which i can implement to do this?

Kind regards,

Barrett.
 
Technology news on Phys.org
Not that I can think of, first step would probably be to find some utility or write something to turn wav into text, just numbers in a csv file.
One other problem, CD quality WAV is 44,000 values/second/per channel - Excel is going to struggle trying to do anything with that many rows.
 
Last edited:
Yea good point...

I think MATLAB has a bigger master array and that's why this was never an issue there.

Perhaps what i need to think about is writing something that converts from WAV to txt but decimates a WAV file into excel sized chunks of txt for importation.

Do you know of any code that i can get that would convert WAV to txt?

Kind regards,

Barrett.
 
bcameron said:
Hi,

I have read WAV files as data/numbers into MATLAB before for Fourier analysis etc and am now trying to do the same with Excel.

I have found code online which has allowed me to make use of the winmm.dll from windows to be able to create a WAV sound file from excel and also to be able to play them. Now i can record and play sounds i need to be able to read the data in the WAV files and perform Fourier analysis etc.

Has anyone done this or have any code which i can implement to do this?

Kind regards,

Barrett.

the sox program can do the conversion.

See:

http://www.integratedprocess.com/sigproc.html

and

http://sox.sourceforge.net/
 
Last edited by a moderator:
I believe 65k is the maximum number of rows. As pointed out, CD-quality audio has 44K*16b/second.

Now, the beta version of 64bit excel might be able to go higher, or you may find clever way's of encoding your data (for example, 1 column per second will give you 65,000 seconds), but I think the bottom line is that excel is written for basic business purposes. If you need to do statistical analysis of large amounts of data, or store large database records, you are better off using a database or scientific program that was designed with analyzing large amounts of data: Matlab, Mathematica, Access, SQL, et cetera.
 
Hi, vociferous. I wouldn't even begin to try it, not because Excell can't handle it, but because it can't handle it well at all.

If you're looking to perform Fourier transforms, or analyis on acoustical data, I suspect you're not talking about just one second's worth, right?

Even if not, you might cram that into 64-bit Excell. Don't know for sure, though, as I've not played with it, yet. Yes, MatLab is a more obvious solution, as it's headroom stems from loftier goals (and better programming).

Thus:

1. You might try 64-bit Excel. If it works, terrific!

2. If it doesn't, try MatLab.

3. If that doesn't, repost the quest and let someone who knows more than I do help you find a solution. I'm pretty good at running through and eliminating the logical steps at this stage, but not much more.
 
I read a wav file using sox and I got the following output

; Sample Rate 22050
; Channels 1
0 -0.0234375
4.5351474e-005 -0.0234375
9.0702948e-005 -0.0234375
0.00013605442 -0.0234375
0.0001814059 -0.0234375
0.00022675737 -0.0234375
0.00027210884 -0.0234375
0.00031746032 -0.0234375
0.00036281179 -0.0234375
0.00040816327 -0.0234375
0.00045351474 -0.0234375
0.00049886621 -0.0234375
0.00054421769 -0.0078125
0.00058956916 -0.0234375
0.00063492063 -0.0234375
0.00068027211 -0.0234375
0.00072562358 -0.0234375
0.00077097506 -0.0234375
0.00081632653 -0.0234375
0.000861678 -0.0234375
0.00090702948 -0.015625

Can someone help me in interpreting this information obtained. The first field I understood was time. What is the second field? If its amplitude, then why is it in fractions? What is the unit? I need to compress and reconstruct another wav file. So what unit should I consider?

Thanks
 
mdmobashiir said:
I read a wav file using sox and I got the following output

; Sample Rate 22050
; Channels 1
0 -0.0234375
4.5351474e-005 -0.0234375
9.0702948e-005 -0.0234375
0.00013605442 -0.0234375
0.0001814059 -0.0234375
0.00022675737 -0.0234375
0.00027210884 -0.0234375
0.00031746032 -0.0234375
0.00036281179 -0.0234375
0.00040816327 -0.0234375
0.00045351474 -0.0234375
0.00049886621 -0.0234375
0.00054421769 -0.0078125
0.00058956916 -0.0234375
0.00063492063 -0.0234375
0.00068027211 -0.0234375
0.00072562358 -0.0234375
0.00077097506 -0.0234375
0.00081632653 -0.0234375
0.000861678 -0.0234375
0.00090702948 -0.015625

Can someone help me in interpreting this information obtained. The first field I understood was time. What is the second field? If its amplitude, then why is it in fractions? What is the unit? I need to compress and reconstruct another wav file. So what unit should I consider?

Thanks
the first field is time, and it increments in 1/frequency.
The second field is the amplitude. Digital audio always has an amplitude between -1 and 1. THe units are dB, however dB is a pure logarithmic unit. Its a unit, but its not actually there. Kind of like radians
 

Similar threads

Replies
8
Views
1K
  • · Replies 22 ·
Replies
22
Views
4K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K