I have a setup with an embedded DSPIC. This is used to link multiple audio inputs to the outputs and changed between them either when told to, or when one is active. This changing takes place on a hardware that is purchased and from what I can tell uses a relay. I have DSP software using a heterodyne filter to remove static noise as the system runs.
However, when the output switches from silent to one output on, there is a large spike in amplitude that lasts for about 3 to 4 milliseconds. This is similar to the click a walkie talkie makes.
I was wondering if there was any way to determine when this happened and then do some sort of amplitude reduction. My sample rate is only 8khz and the signal has been checked on the scope to run at 1khz during this period. I tried doing a 5 point median filter which kind of worked, but on a larger speaker system would still be loud. I also looked into doing a differentiation filter and seeing if the derivative was large. If it was I would cut the next sample point in half and continue. This had no apparent effect.