---
title: TarsosDSP Spectral Peak extraction
canonical: https://0110.be/posts/TarsosDSP_Spectral_Peak_extraction
markdown_url: https://0110.be/posts/TarsosDSP_Spectral_Peak_extraction.md
id: 421
published_at: '2014-04-10T00:00:00Z'
updated_at: '2014-05-07T13:45:08Z'
author: Joren
tags:
- name: TarsosDSP
  markdown_url: https://0110.be/tags/TarsosDSP.md
- name: UGent
  markdown_url: https://0110.be/tags/UGent.md
---

# TarsosDSP Spectral Peak extraction

The TarsosDSP Java library for audio processing now contains a module for spectral peak extraction. It calculates a short time Fourier transform and subsequently finds the frequency bins with most energy present using a median filter. The frequency estimation for each identified bin is significantly improved by taking phase information into account. A method described in "Sethares et al. 2009 - Spectral Tools for Dynamic Tonality and Audio Morphing".

The noise floor, determined by the median filter, the spectral information itself and the estimated peak locations are returned for each FFT-frame. Below a visualization of a flute can be found. As expected, the peaks are harmonically spread over the complete spectrum up until the Nyquist frequency.


![Spectral peaks of a flute. The first 10 harmonic are detected up until the Nyquist frequency. ](https://0110.be/files/photos/421/spectral_peaks.png)
