DSPRelated.com
Forums

Tools for Realtime DSP

Started by QWERTY November 13, 2006
Hello there!

I want to perform *realtime* audio signal processing.
Could someone suggest what tool to use?
I tryed to write program in JAVA but there is no chance to process
sound in realtime. I have found out that it is because of internal
buffering in JAVA.

Now I'm thinking about C/C++. 


What tools do you, people, use?

A full version of Texas Instruments Code Composer Studio,

a Texas Instruments EVM PCI DSP Card

and MATLAB for extensive math oriented libraries








QWERTY wrote:
> Hello there! > > I want to perform *realtime* audio signal processing. > Could someone suggest what tool to use? > I tryed to write program in JAVA but there is no chance to process > sound in realtime. I have found out that it is because of internal > buffering in JAVA. > > Now I'm thinking about C/C++. > > > What tools do you, people, use?
QWERTY wrote:
> Hello there! > > I want to perform *realtime* audio signal processing. > Could someone suggest what tool to use? > I tryed to write program in JAVA but there is no chance to process > sound in realtime. I have found out that it is because of internal > buffering in JAVA. > > Now I'm thinking about C/C++. > > > What tools do you, people, use? >
You're leaving out the processor & platform. The key phrase word is "real time", as you're finding out, but you'll want to think about just what your real time requirements are -- do you just want the sound to come out all in one piece, even if it's way delayed, or do you have some maximum delay in mind? If your sound comes in as files you can process them entire using Java, then play them using a media player. I suspect this isn't what you want. A Windows box should be able to process sound with some delay, and with fair reliability. To do this, you have to use the Windows multimedia extensions to get the processor often enough. In theory you could do this using just about any compiled language if it came with the right libraries; in fact you'll probably want to use C or C++ -- but note that the _language_ isn't the most important part. If you must process the sound with some specified delay, and any break in the playback is a failure, then you cannot use Windows (or Linux, for that matter). For this to work you need a good real-time operating system (or no OS, just run bare metal), and a processor with sufficient bandwidth. I'd look to DSP chips, although you could spend some power consumption and circuit complexity and get a more common processor like a Pentium or an ARM. Note that I haven't specified a chip for you -- this is because you haven't said what audio processing you want to do. To get a sufficient processor you have to know how much processing you're doing, and this varies a lot with your task. Were I approaching an unknown DSP task I'd prototype things in SciLab or MatLab, use the complexity of the algorithm to estimate what processor resources would be consumed, then I'd go shopping for a processor. Good luck. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html
Tim Wescott <tim@seemywebsite.com> wrote in 
news:gMSdnRvvlL3AOsXYnZ2dnUVZ_rmdnZ2d@web-ster.com:

> QWERTY wrote: >> Hello there! >> >> I want to perform *realtime* audio signal processing. >> Could someone suggest what tool to use? >> I tryed to write program in JAVA but there is no chance to process >> sound in realtime. I have found out that it is because of internal >> buffering in JAVA. >> >> Now I'm thinking about C/C++. >> >> >> What tools do you, people, use? >>
If you are looking for a DSP route, I have this suggestion: Analog Devices has a product that is very useful for generating production quality code using a graphical design interface called VisualAudio. It is a front end to Visual DSP, their more traditional C & ASM development tool. The code is compiled and then runs on a SHARC or Blackfin target. We have support for our dspstak 21369 family of boards. Our boards are supported by a free KIT license of Visual DSP. We have versions that include an EZ-KIT style debugger. This means that you could use both VisualAudio and Visual DSP for free (assuming you are using one of our boards or an EZ-KIT). Analog Devices is the leading DSP manufacturer in the audio market (assuming we don't count cell phones or telephony as part of the audio market). You can find more info on our web site. -- Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com

QWERTY wrote:

> Hello there! > > I want to perform *realtime* audio signal processing.
It depends on what do you mean by *realtime* and what do you mean by *processing*.
> Could someone suggest what tool to use? > I tryed to write program in JAVA but there is no chance to process > sound in realtime. I have found out that it is because of internal > buffering in JAVA.
Indeed you can do a real time audio processing in JAVA if you are interfacing directly to the JAVA sound API. Although JAVA is certainly not the best tool for that.
> > Now I'm thinking about C/C++.
The standard Win32 wave API will allow for the minimum buffering delay of about 50ms. Using the DirectSound, you can get minimum of ~10ms buffering at the output, however the input buffer will be still about 50 ms.
> What tools do you, people, use?
All tools that you need are the clever head and the assiduous arse. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
"QWERTY" <igor_igor@vip.hr> writes:

> Hello there! > > I want to perform *realtime* audio signal processing. > Could someone suggest what tool to use? > I tryed to write program in JAVA but there is no chance to process > sound in realtime. I have found out that it is because of internal > buffering in JAVA. > > Now I'm thinking about C/C++.
I think C/C++ is an excellent choice for this type of work. I use <gasp> a text editor, gnu make, and the gnu compiler. Others may need a crutch like MSVC++. It's been awhile since I've done anything with it, but MinGW used to be an excellent (free) API for win32 work (including the multimedia API). -- % Randy Yates % "Watching all the days go by... %% Fuquay-Varina, NC % Who are you and who am I?" %%% 919-577-9882 % 'Mission (A World Record)', %%%% <yates@ieee.org> % *A New World Record*, ELO http://home.earthlink.net/~yatescr
I've had considerable success processing signals in real-time on the
Pentium PC using a standard Sound Card, DirectX, C++ complier (I use
Borland C++ Builder) and DSP support from Intel's IPP Signal Processing
library. I also use the OptiVec library for vector math functions.

By real-time, I mean that I can easily keep up with the input/output data
rate without any 'holes', but there is a natural latency (delay) between
input/output as there would be with any system that requires data to be
buffered for vectorisation (eg. FFT etc).

Up until about 3 years ago, I used to use dedicated DSP cards in the PC,
but discovered that modern Pentium processors are more than capable of
providing the horsepower I need. One of my recent systems simultaneously
processes 12 channels of 24-bit sonar data at sample rates exceeding
100ksps per channel without problems (using a separate PCI A/D card)

Jeff
QWERTY wrote:
> Hello there! > > I want to perform *realtime* audio signal processing. > Could someone suggest what tool to use? > I tryed to write program in JAVA but there is no chance to process > sound in realtime. I have found out that it is because of internal > buffering in JAVA. > > Now I'm thinking about C/C++. > > > What tools do you, people, use?
Hi, I would suggest that you check out the Xilinx System Generator for DSP, which is a Xilinx blockset for Simulink. SysGen generates hardware directly from the algorithm created with the Xilinx blockset in Simulink. There exists a University board, XUP Virtex-II Pro, which is available at an academic rate via digilent: www.digilentinc.com. There also exists a quick start guide (see http://www.xilinx.com/univ/xupv2p.html) that illustrates how to map SysGen designs directly to the audio interface of this board. Regards, Jeff
Jeff Caunter wrote:

> One of my recent systems simultaneously > processes 12 channels of 24-bit sonar data at sample rates exceeding > 100ksps per channel without problems (using a separate PCI A/D card)
This is only impressive if you closer specify what "process" means in this case :-). Regards, Andor
>This is only impressive if you closer specify what "process" means in >this case :-).
Each of the 12 channels are encoded into the frequency domain by means of FFTs with simultaneous resolutions ranging 32-point to 512-point (that is, each channel has 5 spectra associated with it, giving 5 ranges of timing resolution. Spectrum magnitudes are ignored, only phase values are used herein. Each bin of each FFT of each channel is then treated as a separate data stream (there are upwards of 10,000 of these), and a proprietary (to my company) vector process is used to detect the presence of periodic transmissions in each of these streams. The characteristics of the transmissions and their spatial properties then undergo a process of 'data fusion' and are passed to a separate display processor. To give some idea of the power of the Pentium processor, in the time it takes to sample a given block of data, the processor only takes about 1/2 of this to fully process it. In terms of overall sonar performance, the process will detect and classify a transmission with >90% probability of detection, < 1 false alarm in 4 hours, at signal/noise ratios >= +6dB within any spectral bin. Jeff