My project is to modulated and demodulate an information signal on a microcontroller. I am able to modulate and demodulate but when I hear demodulated signal, I hear high frequency components. I need to know how I can remove these high frequency components using C language in microcontroller.
-
2Please add more information about your system. At the very least, a block diagram, or even better, the equations for the processing you've implemented. – MBaz Feb 15 '22 at 14:11
-
1And the channel. "hear" implies and audio channel. What's the speaker, room, placement, microphone setup, etc. – Hilmar Feb 15 '22 at 15:36
1 Answers
Overkill but that solves anything you could mean by that is a fourier transform. There are lots of libraries for it, even for c and particular microcontroller family that you use.
Fourier transform gives frequencies. Then you can make high frequendies to be 0, and transform signal back. Basically it can be used as an equalizer.
But you probably wont be able to do it in realtime if you use arduino or some other far from hardware suite. Then you would ask how to do it faster, as fast as hardware can. Then I would answer exponential moving average. Fiddling with the constants you can find option that sufficiently blocked your unwanted frequencies. But it will also disturb main sound.
Then you would ask for realtime and be more precise in frequencies. And then I will answer that I dont know, its too complex. But probably you can try kalman filter of some sort. Good luck with that.
All of these three solutions are widespread enough for you to find examples for your language and microcontroller family.
UPD: if zeroing high freq bins causes detectable sound, use smaller window for the fourier transform, and use overlapping windows. It is unlikely to matter for a simple case.
- 25,714
- 9
- 46
- 91
- 132
- 3
-
2Zeroing out bins in the FFT is a bad idea. See https://dsp.stackexchange.com/questions/6220/why-is-it-a-bad-idea-to-filter-by-zeroing-out-fft-bins – Hilmar Feb 15 '22 at 17:07
-
@SurprisedSeagull The choice is not binary between simplest and theoretically perfect solutions. There are potentially plenty of good, sound solutions that the OP could implement -- depending on the details of the problem, which have not been forthcoming. Anyway, I hope your answer provides some useful pointers to the OP. – MBaz Feb 16 '22 at 00:13