Design Con 2015
Breaking News
Comments
Newest First | Oldest First | Threaded View
goafrit
User Rank
Manager
re: Audio simulations that will knock your SoX off!
goafrit   5/6/2011 8:47:51 PM
NO RATINGS
Congrats on the award

Soundfac
User Rank
Rookie
re: Audio simulations that will knock your SoX off!
Soundfac   2/5/2011 7:42:51 PM
NO RATINGS
Thanks for the pointer Frank. If you are designing hardware you can also use Linear Technology's LTSpice to play and record wav files from a schematic. You can use any wav file as an input voltage source and save the output result as a wav file. It's very nice to 'listen' to your design before you build it. LTSpice is free from http://www.linear.com/designtools/software/

Mark Wehrmeister
User Rank
Rookie
re: Audio simulations that will knock your SoX off!
Mark Wehrmeister   10/29/2010 6:54:51 AM
NO RATINGS
SoX sounds like a great open source tool. Does anyone know of other open source tools that can do the same (or similar) things?

ReneCardenas
User Rank
Rookie
re: Audio simulations that will knock your SoX off!
ReneCardenas   10/28/2010 12:09:52 AM
NO RATINGS
Frank, Thanks for this pointer, it sure comes timely for me (since I wasn't aware of it), and I am working some personal project to synthesize couple simple sounds, such as: Heartbeat at rest, active, whistle, etc

old account Frank Eory
User Rank
Rookie
re: Audio simulations that will knock your SoX off!
old account Frank Eory   10/26/2010 11:28:54 PM
NO RATINGS
Yes, sox is open source and is commonly included in Linux distributions. Chances are you probably already have it under /usr/bin.

Robotics Developer
User Rank
Rookie
re: Audio simulations that will knock your SoX off!
Robotics Developer   10/24/2010 3:33:21 AM
NO RATINGS
That sounds really neat! Is SoX free? I do not do much analog but the opportunity to test out and try various filters (using spice or matlab) and hearing the result would be very helpful (not to mention cool)! Thanks for the heads up.

old account Frank Eory
User Rank
Rookie
Audio simulations that will knock your SoX off!
old account Frank Eory   10/22/2010 12:23:51 AM
NO RATINGS
If you work in audio hardware design, I'm sure there are times when you've wanted to actually hear the results of a particular signal processing task -- to hear the output of your simulation -- to make sure the algorithm or filter achieved the effect you wanted. Sometimes examining the FFT of the simulation output just doesn't cut it...you really want to HEAR it. Now you're probably thinking, why not just use the wavread & wavwrite functions in Matlab? After all, if you're working in audio, you probably have access to Matlab. But even if you do have Matlab, when you're working on a hardware design, at some point you're simulating Verilog or VHDL RTL, or a combination of RTL and SPICE in a mixed-signal simulation. Perhaps your simulation environment has all the analysis capability you need, except for the ability to read & write .wav files -- files you could actually play and hear -- and as much as you love Matlab, it's a pain to go back & forth between tools, maybe even between computers, just to be able to hear the results of your fabulous signal processing. To the rescue comes Sox, a multi-platform utility that does audio format conversions and a whole bunch of other stuff. Sox is one of the few programs that can read a plain text file of numeric values and turn it into a .wav file. Likewise, it can read a .wav file and turn it into a text file of numeric values, so you can make more interesting stimuli for your simulations that just the usual sine waves! Take for example a hypothetical Verilog RTL simulation in which you have captured the audio sample times and audio sample values for an output channel in a text file as floating point numbers, like this: 2.26757E-05 4.76E-01 4.53515E-05 5.25E-01 ... Just add a one line comment at the top of the file that indicates the sampling rate in Hz, as follows: ; Sample Rate 44100 Make sure your text file name ends in .dat and sox will understand exactly how to convert it in a simple one line shell command: sox -V outfile.dat outfile.wav sox can also play the resulting .wav file on most platforms. And again, for more interesting stimuli to run through those Verilog or mixed-signal simulations, you can run: sox -V piece_of_music.wav piece_of_music.dat and you will get a text file of sample times and audio sample values that, with minor massaging, can be applied as stimulus to just about any simulator you might be using. I recently had a need to do just such a text-to-wav conversion and despite my best search efforts, found it difficult to find a clear example of using sox for this conversion. So if anyone else has a similar need, I hope you find this helpful.



Top Comments of the Week
Flash Poll
Like Us on Facebook

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)
EE Life
Frankenstein's Fix, Teardowns, Sideshows, Design Contests, Reader Content & More
Max Maxfield

Want a Voltera Desktop PCB Printer?
Max Maxfield
15 comments
I just received an email from my chum Javi in Spain. "Have you heard about Voltera (VolteraInc.com)? It's a Canadian company that is going to offer desktop-size PCB printers for fast ...

Aubrey Kagan

Have You Ever Been Blindsided by Your Own Design?
Aubrey Kagan
37 comments
I recently read GCHQ: The uncensored story of Britain's most sensitive intelligence agency by Richard J. Aldrich. The Government Communication Headquarters (GCHQ), Britain's equivalent of ...

Martin Rowe

No 2014 Punkin Chunkin, What Will You Do?
Martin Rowe
2 comments
American Thanksgiving is next week, and while some people watch (American) football all day, the real competition on TV has become Punkin Chunkin. But there will be no Punkin Chunkin on TV ...

Rich Quinnell

Making the Grade in Industrial Design
Rich Quinnell
15 comments
As every developer knows, there are the paper specifications for a product design, and then there are the real requirements. The paper specs are dry, bland, and rigidly numeric, making ...

Special Video Section
The LT8640 is a 42V, 5A synchronous step-down regulator ...
The LTC2000 high-speed DAC has low noise and excellent ...
How do you protect the load and ensure output continues to ...
General-purpose DACs have applications in instrumentation, ...
Linear Technology demonstrates its latest measurement ...
10:29
Demos from Maxim Integrated at Electronica 2014 show ...
Bosch CEO Stefan Finkbeiner shows off latest combo and ...
STMicroelectronics demoed this simple gesture control ...
Keysight shows you what signals lurk in real-time at 510MHz ...
TE Connectivity's clear-plastic, full-size model car shows ...
Why culture makes Linear Tech a winner.
Recently formed Architects of Modern Power consortium ...
Specially modified Corvette C7 Stingray responds to ex Indy ...
Avago’s ACPL-K30T is the first solid-state driver qualified ...
NXP launches its line of multi-gate, multifunction, ...
Doug Bailey, VP of marketing at Power Integrations, gives a ...
See how to ease software bring-up with DesignWare IP ...
DesignWare IP Prototyping Kits enable fast software ...
This video explores the LT3086, a new member of our LDO+ ...
In today’s modern electronic systems, the need for power ...