The Spectrum is possibly the most complex PD class in the CLAM repository. It is an important class for the framework's purposes and some extra care and effort have been put into it.

A CLAM Spectrum can be represented in one of the following formats: array of complex numbers, array of polar numbers, a pair of magnitude/phase arrays, and a pair of magnitude/phase BPF's (Break Point Function). The Spectrum class is designed in such a way so as to always keep consistency of the data in its different representations. This is accomplished through some public methods to change the type of the representation and synchronizing all existing representation to the data in one of them.

There is an accessory interface for accessing/setting magnitude and phase regardless its internal representation. These methods are not efficient but help in keeping different representations transparent for users or some generic algorithms that do not worry about efficiency.

Because of this complexity the Spectrum class is the only PD class that has an associated configuration. This configuration is used for initialization purposes and a local copy is not kept in the object. Whenever the GetConfig(SpectrumConfig& c) method is called, the argument passed and used as output of the method is synchronized with the internal structure of the spectrum.