Linear algebra in cubes and biquadrates: arithmetic harmonic analysis