First implementation of spectrum-calculation