AleSua93 / ToneGenerator

Signal generator for Android devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tone Generator

Signal generator for android devices. Can produce sine, square, and sawtooth waveforms between 20 Hz and 20 kHz.

Getting Started

  • You need to have Android SDK and Android Studio installed.
  • Run the app using Android Studio or deploy the apk. to your device of choice.

The frequency can be changed by either adjusting the slider or by using the textbox (it only accepts integers).

Waveform can be selected by tapping the corresponding button.

Prerequisites

  • Android Minimun SDK: 5.0 (Lollipop)

Info on wave synthesis

Three types of waves are generated: sine waves, square waves, and sawtooth waves.

Sine waves are the most basic type. The equation that defines their behaviour is as follows:

However, for practical purposes, it is more useful to define it as:

Where

And

Where is the minimum step between samples. Generalizing this equation, we obtain:

This is known as a phase accumulator, since we are defining each phase in relation to the previous phase, in a cumulative sum. The advantage of this approach is that we can change the frequency dynamically and there will be no discontinuities in the generated wave. This is the logic implemented for sine wave generation.

Using a Fourier expansion, a square wave can be represented as an infinite sum of sinusoidal waves:

The generation of complex waves by adding their sinusoidal components is known as additive synthesis. The app generates square waves using this method, with a limited number of sinusoidal waves (20).

The same is true of sawtooth wave generation, the only difference is the generating equation:

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Signal generator for Android devices

License:MIT License


Languages

Language:Java 100.0%