Hello
.
I've been doing some experiments using PWM to generate audio.
After I was able to execute everything successfully, I noticed a small hum.
I passed the oscilloscope to FFT and tried to analyze the problem.
When measuring several points I realized that even in the PWM pin this signal (of hum) continued to appear. Then I disconnected everything leaving only an RC filter attached to the pin.
I changed the code so that the MCU only do the following: set the clock, configure the PWM channel (Fpwm = 47KHz), configure duty cycle to 50%, terminate.
The truth is that there is a peak of 3KHz that I can not identify the source.
This is the image of PWM (always at 50%):
This is the FFT of the PWM signal:
Signal detail of 3KHz - this is the most worries me because it directly integrates in the audio (other peaks: 9KHz, 15KHz):
Signal detail of 3KHz - after low pass filter (fc = 17KHz - Only this part was welded, because the next circuit together with this RC would improve the cutoff frequency):
Can someone tell me why this is happening?
I've been stuck with this problem for some time but I can not solve it.
I think it's not harmonic of the PWM because in that case it would be the 15th harmonic ... and it would be much more attenuated.
If I look to the signal on the oscilloscope, I see no apparent ripple, other than the "triangular wave" resulting from the filter ...