Compressing a .wav file

Oct 05, 2006 16 Replies

Hello All:



I'm building a system where I need to transfer PC type wav files from a host to a remote. The remote systems can be located very far away and a modem is about the only answer in those cases. The modem will also slow sown to 33K baud or less.



These wav files are either 8 bit or 16 bit mono at sampling rates of 11 or 22 KHz. The transmission time is a problem.



So my questions is what are your ideas on speeding this up..............


  1. Zipping the original file gives me almost a 2:1 reduction is size. I'm running a NIOS processor (ARM like) at 50 MHz. So I could unzip at the receiver.


  1. Has anyone looked at only sending deltas. Send Sample 1, Send Sample 2 - Sample1, Send Sample3 - Sample2 ...... If the change is small the deltas will be small and perhaps less data.



Any other ideas.



Thanks George



If you can accept loss, why not use MP3? Other wise, indeed send deltas, but encode them first using huffmann, which gives you short bit runs for small deltas and vice versa.

Meindert

Yes, someone did that 10 to 20 years ago. It's called mp3.

There's a whole lot more to MP3 than just sending deltas.

Meindert

Does it need to be lossless? If not you could use MP3, Ogg Vorbis or a standard telecoms protocol like H324. For lossless coding using FLAC will give you better compression than ZIP.

Peter

The key questions are what kind of audio quality do you need and how much of the processing you can afford.

If you will be satisfied with the phone line like quality, the audio can be compressed approx. up to 4800 bps. A fair quality music will take at least 64kbps.

Don't reinvent the wheel. Google GSM 6.10, G.723.1, ogg, mp3...

Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

formatting link

Thinking laterally, if you have a modem then you have a phone line so you could just play the sound down the line and record it at the other end. That way you don't even need a modem and your losses are restricted to the quality of the line. I reckon that at 33.6Kbs you can move about about 173Kb of data in a minute. One minute of audio compressed to mp3 is about 1Mb roughly so you are gaining 6 times the speed without incurring any mp3 loss.

Just a thought.

Only MP3 compression involve fourier analysis and storing the results. At the other end the waveform is re-synthesized out of sine wines. Nothing as simple as subtraction...

Andrew Smallshaw andrews@sdf.lonestar.org

Have a look at NICAM, it is quite old, a good description via wikipedia.

martin

Delta works fine and will probably gain you

2x effective sampling rate for a given bandwith.

The biggest disadvantage of delta is that a transient bit error will usually drive the calculated output into saturation, giving you a catastrophic and ongoing error in your output. So you either want a robust data link or error checking and correction.

You can also do what the phone company does and convert the linear code into a log code. Even more interesting is sending the delta as a signed log code, though you have to take steps to prevent excessive error buildup.

Google ADPCM.

Just a note: Decompressing MP3 in real time takes 25 MIPS. per ARM app note. Also is there readily available C code for decompression? It's a possibility.

l> > 2. Has anyone looked at only sending deltas. Send Sample 1, Send

Good Idea!! Worth a try.

Duhhhh!!! Why didn't I think of that. THat's a good one.

NICAM looks to be better than deltas. Worth exploring.

I was a bit vague in loss vs. lossless. Some applications of this system can tolerate loss while other can not. The suggestions so far are great. I've got several good leads to check out.

And while the system is idle it can play soothing elevator music to the remote system to stop it getting lonely out there on its own in the cold.

messagenews: snipped-for-privacy@i42g2000cwa.googlegroups.com...

system is idle it can play soothing elevator music to the

I'm an engineer and I come with a low pass marketing filter installed. So that suggestion is lost. Wait for Ver 2.0

george

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required