Frequency Spectrum Analyzer – Schematics


To display the fft output values, a setBar function was created. This function receives the value for which frequency column to modify and the data for that frequency set. Six strip color variables are set corresponding to the six rows of the LED grid along with a variable threshold for modifying gain. Because the LEDs follow a zig-zag pattern, the LED position values increase for every other column and decrease for the rest as you count from the base of the enclosure to the top. This can be illustrated through a table.
54 53 . . . . . .             18 17 6 5
55 52 . . . . .               19 16 7 4
56 51 . . . . .               20 15 8 3
57 50 . . . . . .             21 14 9 2
58 49 . . . . . .           22 13 10 1
59 48 47 36 35 24 23 12 11 0

An issue arises if you set the LED n value to the column number multiplied by 6. This will invert the direction of the column lighting in every odd numbered column. To address this, the odd numbered columns have a bottom LED value of 6*column+5 which correctly sets the second column base LED n value to 11 (1*6+5). Then you count down as you increase in the column.