Close

Nasty clicking noise between change of notes, and poor volume output!

A project log for PIC32MX music box with FM synthesis and I2S DAC

Six-channel FM synthesis music box using PIC32MX250F128B microcontroller with envelope generator.

nyh-workshopNYH-workshop 01/02/2018 at 03:070 Comments

I have been addressing this issue for a few months and noticed that something is really wrong with the output.

First, what did work are the FM oscillators which are generating normally, as long as I don't put very high values on the FM modulator's amplitude.

However, when the notes switches after playing, it clicked. Yeah, it sounded irritating. I have checked other references (especially that fancy Japanese musical clocks in Youtube and actual clock shops) and they don't click like mad! A search in Google revealed that I have to dampen the sound between note-switches to prevent very sharp change of values in the output. That - I'm inserting these after I port Bruce Land's envelope generator algorithm inside: Bruce Land's FM Sound Synthesis

Another thing connecting the DAC to the little cheap mini compo set, the volume is decent. But to connect this to the LM386, or any of those PAM8403 and to the 4ohm speaker results in a tinny and unfulfilling volume! What just happened? I begin to suspect that there is a DC offset that prevents this from having a decent sound.

Using the Analog Discovery 2 and getting the first 512 samples from the system, it is noticed that there is really a DC offset somewhere at the lowest frequency area: (FFT is calculated using Octave)

Check the first value: 11.60945 + j0.0000. There could be a need to just get rid of it once and for all!

Discussions