I've started playing with I2S audio generation on an ESP32. It appears
that any kind of discontinuity in a waveform will make clicks & pops --
it's a lot more significant than you'd expect for a 1/16000 sec blip!
I'm sure this is Old News for people who've been doing MIDI and audio
stuff for years, but to help me get up to speed:
What are some good techniques for generating "pretty good" audio samples
quickly enough to feed a voracious I2S DMA? My current goals are
"analog-phone" noises -- dial tone, ring tone, busy, DMTF, tri-tone
SIPs, etc. I'd like to have smooth, pop-free start and stop of tones
with configurable duration.
Some ideas:
* Prepare a clean set of 16-bit samples of an integral number of cycles
of (mixed) tones, and use a simple envelope algorithm to ramp up and
down. (This can be a fairly large number of samples when mixed
frequencies have a large LCM.)
* Prepare clean sets of 16-bit samples of individual frequencies, then
just add them prior to DMA
* Prepare a single cycle of 16-bit samples of a sine wave, and use
different indexes stepping through it to get different frequencies.
(Maybe using fixed-point delta increments to get finer frequency control.)
The ESP32 doesn't seem to have enough horsepower to just make samples on
the fly using floating point.
--
Mersenne Law ·
www.mersenne.com ·
+1-503-679-1671
Small Business, Startup and Intellectual Property Law
420 N.W. 11th Ave., Suite 814; Portland, Oregon 97209