On ESP32's DAC, I am producing cosine waves of frequencies between 20KHz - 30KHz over a period of 1000ms. After 1000ms, the wave generation is stopped. Furthermore, after every 50ms, the wave frequency is randomly changed between the specified range of 20KHz - 30KHz using a timer callback function.
I am using a modified version of DAC Cosine Wave Generator example [https://github.com/espressif/esp-idf/bl ... ple_main.c]
After every 50ms, whenever the program switches to a different frequency, I hear 'popping' noise on the speaker. So in a period of 1000ms, frequency switches about 20 times and hence that means a lot of popping. I am using a 3W Audio Amplifier (PAM8403) and 150W speaker (also tried a 0.5W speaker). The popping noise is negligible at low frequencies (e.g. 1-3 KHz)
Following is a sample of the audio generated (range : 20-30KHz): (use headphones)
https://drive.google.com/file/d/1bJ9Bz_ ... sp=sharing
And following is a sample with low frequencies (range : 2-3KHz): (use headphones)
https://drive.google.com/file/d/1DPwqbH ... sp=sharing
I want to know about the cause of this popping noise on the speaker.
ESP32 DAC producing popping noise on the speaker
Re: ESP32 DAC producing popping noise on the speaker
Use a scope to look at the signal.I want to know about the cause of this popping noise on the speaker.
When you stop your DAC leave the output at midrange. Odds are its going to gnd when off, so when it starts you get the pop.
Or it could be how you have the output coupled to the amp. Do you have a series cap to your amp ?
Re: ESP32 DAC producing popping noise on the speaker
Are you keeping the phase continuous between frequency changes? The human ear is very sensitive to phase discontinuity
-
- Posts: 94
- Joined: Tue Sep 07, 2021 12:07 pm
Re: ESP32 DAC producing popping noise on the speaker
1) If you don't have a scope, use audacity to see the wave form in the audio file.
aliasing.
The low frequency file looks better. The mpeg compression also adds artifacts. You might want to use an uncompressed .wav file. There might be a standard for 96kHz sampling, which would get you to 48kHz frequencies. None of my consumer grade hardware would be able to do that.
2) The high frequency file appears to be a codec that has a 48kHz sample rate. Your frequencies > 24kHz will create horrible artifacts called Craige
Who is online
Users browsing this forum: Eltrion, Google [Bot] and 158 guests