views:

942

answers:

6

Is there any Java or C# library for signal analysis using the sound card of a PC? I'm not interested in music mixing, rather in general purpose signal analysis - take a look at SIGVIEW - I'm interested in a Java or C# library that can do that. Another example is the scEEG project, striving to build a sound card electroencephalograph, by analyzing brain-wave signal captured by the sound card.

+1  A: 

You can access audio inputs in Java using the JavaSound API (classes in javax.sound.sampled). The last time I used .NET for this, you had to use the managed DirectX API, which was not so easy to use, but newer .NET frameworks may have an easier API for this.

When it comes to signal processing, I guess you have to be a little bit more accurate about your requirements. It's a very broad field and it may or may not be available libraries to perform the analysis or processing you need, but no one can guess what you're up to.

jarnbjo
What I'm "up to" is exactly what I've stated: signal comes in trough the audio-in of my computer's sound board, then <library name here> reads it as an octet stream and offers me a range of transformations and statistical measures useful in signal analysis.
luvieere
And depending on which transformations and which measurements you require (but obviously are not willing to share with us), you may need a different library. My crystal ball is unfortunately broken today.
jarnbjo
I'm interested in whatever may be available, be creative with your answer, I'm curious to know what options I have. If you know more libraries, it's even better, you can post more of them, links to their sites are ok, be sure I'll check them out.
luvieere
Yea..javascript is good with playing audio. Take a look at imeem. They have javascript everywhere
Luke101
A: 

It depends on what kind of signal processing you'd like, there are sound libraries out there like irrklang (http://www.ambiera.com/irrklang/features.html) that will do plenty of manipulation etc, and there are also ones that will just change basic things like tempo/pitch (http://www.surina.net/soundtouch/).

I've personally used BASS (http://www.un4seen.com/) before and it's awesome however it does have a license fee for non-commercial use, so you might want to look around a bit more if you're using it for a commercial project. It makes use of the DirectSound API which uses the hardware, so it's basically an abstraction API.

George
I'm not interested in manipulating sound, the sound card is for me just a cheap equivalent of an expensive proffesional signal capture card. I want to use it to analyze general-purpose signal, in the same way as an oscilloscope would do it.
luvieere
A: 

Dependening on what you're looking to do Exocortex.DSP went into Math.NET attempt and so on.. Worth investigating if it is sufficient or performing well.

Alternatively, use what pros use and interop into it, Intel DSP and Math kernel packages have some work done and plenty of decent attempts out there to easily interface with it.. And to add, neither Java or C# does a good job on primitive arrays, and their implementation is usually outperformed by an order of magnitude for any decent size data set.

[piece to against-interop managed world ]

rama-jka toti
Ok... I've looked at the sites, but I've found no reference to reading inputs from the sound card. Could you provide me with a link to where you've found this particular piece of information?
luvieere
It's all from memory dealing with disaster that is CLR :) For sound input, go for NAudio on CodePlex.
rama-jka toti
A: 

Check out NAudio. Looks pretty functional in terms of extracting data from audio

Conrad
I don't want to extract data from audio, I want to process generic signal that comes into the audio-in of the sound card, and this means that this signal will not be formatted in an audio format (pcm, mp3...). From what I've seen on NAudio's site, the library is specialized in analysis of audio formats, whereas I want to capture raw signal input, and be able to filter it the same way an oscilloscope does - find and measure patterns in it.
luvieere
A: 

I'm only familiar with the java stuff. Sadly, I don't know of any nice, free, easy to use signal processing library. I've always been using a bit of this and that.

Capture:

  • JavaSound API (http: // java.sun.com/docs/books/tutorial/sound/capturing.html) to capture the sound from the soundcard.

  • Sphinx4 (http: // cmusphinx.sourceforge.net/sphinx4/) does implement the capture and much more... it is, however, a big project with a complex structure

DSP:

  • http: // www.webkitchen.com/brainathlon is used for EEG analysis and has implemented some signal processing routines (filters)

  • http: // www.falstad.com/mathphysics.html has lots of applet examples, namely with signal processing. the code is not always very understandable, but it has helped me in the past

Hope it helps

mvaz
A: 

MATLAB has some powerful signal analysis tools that work well on audio. Not sure if you can feed it real-time streams out of the box, but it should be straightforward to hack. MATLAB is best known as an interactive app, but there's also an embedded version.

Dewb