Engineers emulating bagpipes are flummoxed by an annoying clipping sound
The board consisted of two processors, one for control and main algorithm processing and other one for sound effects generating. There was a parallel flash memory and a variety of extra circuits for several purposes: communication, programming, voltage regulators, battery management. Of course, one of the most important stages of the board was the CODEC and sound amplification stage. I chose the CODEC PCM1770 from TI. It was a good CODEC for our requirements: dynamic range 98dB, software control, headphone amplifier, pop-noise-free circuit and small packages, TSSOP-16 and VQFN-20. Below is a photo of a finished board with all assembled components and battery.
Image 1. Main Control PCB.
The first apparition of the MCS issue was when we downloaded the control program into our ATMEGA64 and ran the program. I started to play the bagpipes. The logic operation of the program was easy: detect the positions of the fingers in the chanter, find the correct note in a hash table and send the property MIDI commands to the sound processor to map the sample and generate the correct I2S signals to the CODEC stage. So we could emulate a bagpipe as a sequence of samples generated faster in the time, so human ears received a continuous melody. The problem was that between samples we always heard a clip sound. You can see this clip in this image:
This sound was terribly annoying because the magic of our algorithm disappeared. We tried to reduce the output capacitors, which had a value of 1uF, less than a traditional value of 10 or 100uF. But nothing changed. We suspected that the MCS was due to a transition response of the CODEC with the line DATA of the I2S bus stopped. So we thought why don't we send a continuous sound out of the audible human range to the CODEC? The solution was near. We generated an infrasound of 1Hz with a lower power level. When we changed the bagpipes to the play mode, first of all we sent this infrasound to the CODEC in a loop configuration. The clip sound met expectations. Mystery solved.
About Author Javier Martínez Gutiérrez: I am an independent electronic engineer living in Asturias, Spain. My principal business is to design a family of electronic air musical instruments using the latest technologies. When I am not in front of my computer I enjoy reading science fiction, programming in C+, and preparing for my next trek in the fantastic natural landscape of the Asturias..