Reading WAV as data/numbers into Excel

  • Thread starter Thread starter bcameron
  • Start date Start date
  • Tags Tags
    Excel Reading
AI Thread Summary
The discussion centers on the challenges of reading WAV files into Excel for Fourier analysis, a task previously accomplished in MATLAB. The user, Barrett, has successfully created and played WAV files using Excel but seeks assistance in extracting and analyzing the data from these files. Concerns are raised about Excel's limitations in handling large datasets, particularly with CD-quality audio, which generates a significant number of data points. Suggestions include using the Sox program for converting WAV files to a more manageable text format and considering the use of 64-bit Excel for potentially increased capacity. The conversation also touches on the interpretation of output data from WAV files, clarifying that the first field represents time and the second field indicates amplitude, which ranges between -1 and 1. The discussion emphasizes the need for more suitable tools for extensive data analysis, such as MATLAB or specialized software, rather than relying solely on Excel.
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
 
Back
Top