FFt and matrix controller code