Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 3.97 KB

README.textile

File metadata and controls

42 lines (30 loc) · 3.97 KB

TarsosDSP

TarsosDSP is a collection of classes to do simple audio processing. It features an implementation of a percussion onset detector and two pitch detection algorithms: Yin and the Mcleod Pitch method. Also included is a Goertzel DTMF decoding algorithm and a time stretch algorithm (WSOLA).

Its aim is to provide a simple interface to some audio (signal) processing algorithms implemented in pure JAVA. Some TarsosDSP example applications are available.

The following example filters a band of frequencies of an input file testFile. It keeps the frequencies form startFrequency to stopFrequency.


AudioInputStream inputStream = AudioSystem.getAudioInputStream(testFile);
AudioDispatcher dispatcher = new AudioDispatcher(inputStream,stepSize,overlap);
dispatcher.addAudioProcessor(new HighPass(startFrequency, sampleRate, overlap));
dispatcher.addAudioProcessor(new LowPassFS(stopFrequency, sampleRate, overlap));
dispatcher.addAudioProcessor(new FloatConverter(format));
dispatcher.addAudioProcessor(new WaveformWriter(format,stepSize, overlap, "filtered.wav"));
dispatcher.run();

The source tree is divided in three directories:

  • src contains the source files of the core DSP libraries.
  • test contains unit tests for some of the DSP functionality.
  • build contains ANT build files. Either to build Java documentation or runnable JAR-files for the example applications.
  • examples contains a couple of example applications with a Java Swing user interface:
    • SoundDetector show how you loudness calculations can be done. When input sound is over a defined limit an event is fired.
    • PitchDetector this demo application shows real-time pitch detection. When pitch is detected the hertz value is printed together with a probability.
    • PercussionDetector show the percussion (onset) dectection. Clapping your hands causes an event. This demo application also shows the influence of the two parameters on the algorithm.
    • UtterAsterisk a game with the goal to sing as close to a melody a possible. Technically it shows real-time pitch detection with YIN or MPM.
    • Spectrogram in Java shows a spectrogram and detected pitch, either live or from an audio file. It is interesting to see which frequencies are picked as fundamentals.
    • Goertzel DTMF decoding an implementation of the Goertzel Algorithm. A fancy user interface shows what goes on under the hood.
    • Audio Time Stretching – Implementation in Pure Java Using WSOLA Similarity Overlap Add) an implementation of the a time stretching algorithm. By using WSOLA it is possilbe to change the playback speed while audio is playing.

Credits

Tarsos and TarsosDSP are developed at University College Ghent, Faculty of Music
http://cons.hogent.be

The onset detector implementation is based on a VAMP plugin example by Chris Cannam at Queen Mary, London.

For the implementation of the YIN pitch tracking algorithm. Both the the YIN paper and the aubio implementation were used as a reference.