Reading WAV as data/numbers into Excel

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

This discussion focuses on reading WAV files as numerical data in Excel for Fourier analysis. Users have shared their experiences with using the winmm.dll library to create and play WAV files from Excel, but face challenges in processing the large data sets typical of CD-quality audio (44,000 samples per second). Recommendations include using the SoX program for WAV to text conversion and considering MATLAB for more efficient data handling. The conversation highlights the limitations of Excel in managing extensive audio data compared to specialized tools like MATLAB.

PREREQUISITES
  • Understanding of WAV file structure and audio data representation
  • Familiarity with Fourier analysis techniques
  • Basic knowledge of the SoX audio processing tool
  • Experience with MATLAB for data analysis
NEXT STEPS
  • Learn how to use SoX for converting WAV files to CSV format
  • Explore MATLAB's capabilities for handling large datasets and performing Fourier transforms
  • Investigate the limitations of Excel for audio data processing and potential workarounds
  • Research methods for compressing and reconstructing WAV files based on amplitude data
USEFUL FOR

Audio engineers, data analysts, and researchers interested in audio signal processing and numerical analysis of sound data using Excel and MATLAB.

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