Giter VIP home page Giter VIP logo

tuner's Introduction

Tuner

by Richard Hartmann

Tuner - frequency analysis of the microphone input suitable to tune instruments.

image gui

Install and Run

if you have not, install poetry, dependency management and packaging in Python.

Use poetry install to install dependencies.

Run the app by poetry run python start_tuner.py

Usage

  1. Make sure the desired microphone is selected. If you do not want to tune to a at 440Hz, change the value
  2. Select the key you want to tune to. Use the 'next' and 'prev' to see how the inputs 'key' and 'level' work. It also shows the target frequency of that key.
  3. Play a tone and tune such that the relative difference (upper right panel) is well below 1% (0.01) for some time. You can use the mouse (drag and scroll) to adjust the axes.

License

GNU General Public License v3.0

Donation

If you like the tuner-App, feel free to donate with PayPal. If you don't like PayPal, contact me at richard_hartmann(at)gmx.ⅾⅇ.

Basic Idea of the Algorithm

  1. Perform Fourier integral (finite integral over several oscillations of the recoded microphone signal) for frequencies in the vicinity of a given target frequency Ω, and multiples of that (higher harmonics contributions).
  2. Plot such spectra and shift the frequency axis by -nΩ (different shift for each higher harmonic!). In that way, if the base frequency of the recoded signal ω1 is resonant with Ω, all maxima should align at ω-nΩ = 0. In practice the maxima of the spectra vary much over time, so their alignment is not well suited to judge the resonance, i.e. the tuning to the target frequency Ω. (upper left plot)
  3. Use the amplitude and phase information from the Fourier integral as initial condition to fit a harmonic model signal with base frequency ω1 and its higher harmonics nω1 to the recoded input. (lower plot)
  4. Show the relative difference of the optimal value ω1 with respect to the target frequency Ω. Keep track of its value over some time. Record no value if the least square fitting does not converge sufficiently fast. (upper right plot)

Acknowledgements

As of the great collection of numeric routines provided by numpy putting the algorithm in place was straight forward. The plotting was made possible using Qt wrapped to Python via pyqtgraph. Thanks!

tuner's People

Contributors

cimatosa avatar

Watchers

 avatar

Forkers

kennivelez

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.