---
title: Constant-Q Transform in Java with TarsosDSP
canonical: https://0110.be/posts/Constant-Q_Transform_in_Java_with_TarsosDSP
markdown_url: https://0110.be/posts/Constant-Q_Transform_in_Java_with_TarsosDSP.md
id: 363
published_at: '2013-10-09T00:00:00Z'
updated_at: '2020-11-17T09:01:43Z'
author: Joren
tags:
- name: Code
  markdown_url: https://0110.be/tags/Code.md
- name: Computational musicology
  markdown_url: https://0110.be/tags/Computational%20musicology.md
- name: HoGent
  markdown_url: https://0110.be/tags/HoGent.md
- name: Java
  markdown_url: https://0110.be/tags/Java.md
- name: Music Information Retrieval
  markdown_url: https://0110.be/tags/Music%20Information%20Retrieval.md
- name: TarsosDSP
  markdown_url: https://0110.be/tags/TarsosDSP.md
---

# Constant-Q Transform in Java with TarsosDSP

The DSP library for Taros, aptly named TarsosDSP, now includes an implementation of a *Constant-Q Transform* (as of version 1.6). The Constant-Q transform does essentially the same thing as an FFT, but has the advantage that each octave has the same amount of bins. This makes the Constant-Q transform practical for applications processing music. If, for example, 12 bins per octave are chosen, these can correspond with the western musical scale.

Also included in the newest release (version 1.7) is a way to visualize the transform, or other musical features. The visualization implementation is done together with Thomas Stubbe.

The example application below shows the Constant-Q transform with an overlay of pitch estimations. The corresponding waveform is also shown.

<div align="center">
<a href="http://0110.be/releases/TarsosDSP/TarsosDSP-latest/TarsosDSP-latest-Examples/ConstantQ-latest.jar"><img src="https://0110.be/files/attachments/363/constantq-visualization-java.png" alt="Constant-Q transform in Java"/></a>

</div>
Find your oven fresh baked binaries at the [TarsosDSP Release Repository](http://tarsos.0110.be/releases/TarsosDSP/).\
The source code can be found at the [TarsosDSP GitHub repository](https://github.com/JorenSix/TarsosDSP).


- [constantq-visualization-java.png](https://0110.be/files/attachments/363/constantq-visualization-java.png)
