Projects & Notes
Embedded Systems — Traffic Light Controller
Finite State Machine (FSM) with debounce logic, built on STM32 using HAL. Timing via SysTick, states: RED
→ RED_AMBER
→ GREEN
→ AMBER
.
// Pseudocode
state = RED
loop:
output_lights(state)
delay(T[state])
state = next[state]
Signals — FIR Low‑Pass Filter
Windowed‑sinc filter, Hamming window, N = 51 taps. Great for smoothing sensor noise.
for n in range(N):
h[n] = sinc(2*fc*(n-M)) * (0.54 - 0.46*cos(2*pi*n/N))
Algorithms — Dijkstra in 12 Lines
def dijkstra(g, s):
import heapq
dist = {v: float('inf') for v in g}; dist[s]=0
pq=[(0,s)]
while pq:
d,u = heapq.heappop(pq)
if d!=dist[u]: continue
for v,w in g[u]:
nd=d+w
if nd