Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20558

Share your working BASCOM-AVR code here : How to use 2 MSGEQ7 to give 14 differents bands. : REPLY

$
0
0
Paulvk, Thank you for your nice contribution ! Really, it makes the code very clean. If someone wants to know why the ADC value is multiplied by 5 and then divided by four ( *1,25 ), that is because the Output voltage from MSGEQ7 can reach 4 Volts only, then i make the multiplication only to have values near 1023. The best solution was use one voltage divider to make the ADC converter work with 4 volts... but anyway this works too. And if someone prefer, add two more MSGEQ7, with others 7 diferent bands each, and select the desirable frequency for each one; this way you can make one Spectrum with 30, 60, 120, 250, 500, 1k, 2k, 4k, 8k, and 16 Khz , like the commercial products. To chose the new 7 bands values, the trick is to change the Resistor or the Capacitor that makes the internal clock from MSGEQ7. The original values to have the higher band from 16 kHZ are R=200K and C=33 pF . The filter frequency varies with the inverse product of RC. All the 7 bands are related with adjacent bands by the factor of 2,5 by design. Then, if you want the new higher value to be 20 Khz, you need to make the product of R and C be smaller with the proportion of 20/16 = 1,25 . You have two choices : R = 200/1,25 = 160k or C = 33/1,25 = 26,4 pF. I always use one resistor smaller with one trimpot in series, to adjust the value precisely, because the MSGEQ7 have about 20% of tolerance form the clock frequency. Is better make the adjust with one sound source. Then you will have the following bands : 20 /2.5 = 8Khz 8/2.5 = 3,2 Khz 3.2/2.5 = 1,28 Khz 1,28/2.5 = 510 Hz 510/2.5 = 204,8 Hz 204.8/2.5 = 81,9 Hz For better visualization : 82 Hz, 205 Hz, 510 hz, 1.3 Khz, 3.2 Khz, 8 kHZ and 20 Khz . Paulo

Viewing all articles
Browse latest Browse all 20558

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>