Reading WAV as data/numbers into Excel

In summary: This is a summary of the WAV file. In summary, the WAV file has a sample rate of 22050, channels 1, and a range of -0.0234375 to 0.0234375.
  • #1
bcameron
2
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
  • #2
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:
  • #3
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.
 
  • #4
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 [Broken]

and

http://sox.sourceforge.net/
 
Last edited by a moderator:
  • #5
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.
 
  • #6
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.
 
  • #7
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
 
  • #9
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
 

1. How can I read a WAV file as data/numbers into Excel?

To read a WAV file as data/numbers into Excel, you can use a program or software that can convert the audio file into a spreadsheet format. There are several programs available online that can do this, such as Audacity, WavePad, and Wav to Excel converter.

2. Can I directly open a WAV file in Excel?

No, Excel does not have the capability to directly open a WAV file. However, you can use a third-party software to convert the audio file into a compatible format that can be opened in Excel.

3. What is the benefit of reading WAV as data/numbers into Excel?

The benefit of reading WAV as data/numbers into Excel is that it allows you to analyze and manipulate the audio data in a more organized and structured manner. You can perform various calculations, create charts and graphs, and even combine the audio data with other types of data for further analysis.

4. Is it possible to read only a specific part of the WAV file into Excel?

Yes, it is possible to read only a specific part of the WAV file into Excel. You can use a program that allows you to select and extract the desired portion of the audio file and convert it into a spreadsheet format.

5. Can I convert the data in Excel back into a WAV file?

Yes, you can convert the data in Excel back into a WAV file by using a program or software that supports this function. However, keep in mind that the quality of the audio file may be affected during the conversion process.

Similar threads

  • Programming and Computer Science
Replies
8
Views
664
  • Programming and Computer Science
Replies
22
Views
3K
  • Programming and Computer Science
Replies
4
Views
713
  • Programming and Computer Science
Replies
1
Views
169
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
11
Views
959
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
6
Views
924
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
5
Views
725
Back
Top