♩ ECE · Signal Processing · Scilab

Audio Tone
Generator

Digital Audio Synthesis

A Scilab-based audio synthesis engine that generates musical tones across six octaves using sine wave mathematics — from deep bass C1 to soaring C6.

Waveform Visualizer Real-time
Click to play — C Major Scale
01 — About the Developer

Meet the Creator

🎵
Priyanka Gandhi A
ECE Student · 22UEL031
Electronics Communication Engg. Scilab Signal Processing Audio DSP

Priyanka Gandhi A is an Electronics and Communication Engineering student (Roll No. 22UEL031) with a strong grasp of signal processing and digital audio systems. This project demonstrates the application of fundamental DSP concepts — sine wave synthesis, sampling theory, and frequency-domain analysis — implemented entirely in Scilab.

The Audio Tone Generator covers 7 musical notes (C through B) across 6 octaves, offering capabilities ranging from individual note playback to complex chord synthesis and melody sequencing. It bridges abstract mathematical theory with tangible, audible output.

42 Unique Tones
6 Octaves
8k Sample Rate (Hz)
02 — How It Works

The Science Behind Sound

1 〰️ 𝄞

Sine Wave Generation

Each tone is a pure sine wave computed as A·sin(2πft), where frequency f determines musical pitch across 6 octaves.

2 📐

Sampling at 8 kHz

Digital audio is discretized at fs = 8000 Hz with a 0.5-second time vector, satisfying Nyquist for all generated frequencies.

3 🎸

Chord Synthesis

Chords emerge by summing simultaneous sine waves. C Major = C + E + G — superposition of waveforms produces harmony.

4 🎼

Melody Sequencing

Concatenating individual note arrays creates melodic sequences. The code plays a full scale by chaining C4→D4→E4→F4→G4→A4→B4.

03 — Interactive Demo

Hear the Frequencies

Audio Synthesizer — Web Demo
0.50
0.5s
Live Waveform
Current Note
Frequency
Hz
04 — Source Code

Written in Scilab𝄞

4.sce — Scilab
by Priyanka Gandhi A · 22UEL031
// Project done by Priyanka Gandhi A (22uel031)

clc;
clear all;
close;

// Sampling frequency
fs = 8000;
t  = 0:1/fs:0.5;   // Time vector for 0.5 seconds
k  = 2;              // Frequency scaling factor

// ── C Notes (C1–C6) ──────────────────────────
C1 = sin(2*%pi*k*33*t);   C2 = sin(2*%pi*k*65*t);
C3 = sin(2*%pi*k*130*t);  C4 = sin(2*%pi*k*262*t);
C5 = sin(2*%pi*k*523*t);  C6 = sin(2*%pi*k*1047*t);

// ── A Notes (A1–A6) ──────────────────────────
A4 = sin(2*%pi*k*440*t);  // Concert pitch A440

// ── Play higher octave tones ──────────────────
sound(C5, fs);     // Play C5 (523 Hz)
sound(C6, fs);     // Play C6 (1047 Hz)

// ── Plot waveform ─────────────────────────────
plot(t, C6);
title('Waveform of C6 (1047 Hz)');

// ── Chord: Higher octave C major ──────────────
notes_high = [C5; E5; G5];
sound(sum(notes_high, 'r'), fs);

// ── Melody: Scale C5→G5 ───────────────────────
sound([C5, D5, E5, F5, G5], fs);
05 — Mathematics

Signal Theory

Sine Wave Equation

Every musical tone in the generator is mathematically described by the fundamental sine wave formula:

y(t) = A · sin(2π · f · t + φ)
A= amplitude
f= frequency (Hz)
t= time (s)
φ= phase = 0

Nyquist-Shannon Theorem

The sampling frequency (fs = 8000 Hz) must be at least twice the highest frequency to avoid aliasing:

fs ≥ 2 · fmax

The highest generated tone is B6 at 1976 Hz. Since 8000 Hz > 2 × 1976 = 3952 Hz, Nyquist is satisfied for all tones.

Octave Doubling

Each octave doubles the frequency. This logarithmic relationship is why musical intervals sound consistent across registers:

f(octave n+1) = 2 · f(octave n)
C4262 Hz
C5523 Hz
C61047 Hz

Chord Superposition

Chords are generated by summing individual sine waves. The principle of superposition gives us harmonic content:

chord(t) = C(t) + E(t) + G(t)

The C major chord combines three sine waves at 262 Hz, 330 Hz, and 392 Hz — matching the harmonic series of Western music theory.

06 — Frequency Reference

Note Frequencies

Note Frequency (Hz) Scilab Expression (k=2) Relative Range
🐙

Explore the Source

Full Scilab source code, waveform plots, and documentation available on GitHub.

github.com/power-code129/Audio-Tone-generator →