There are a lot of radiation spectrum detectors such as IR detectors and seems they provide power versus time.

But how is spectrum(power versus wavelength) obtained from power versus time information?

You calculate the Fourier transform. Given a time series $$f(t)$$ the Fourier amplitude in frequency space is

$$F(\omega)=\int_{-\infty}^\infty dt f(t)\:e^{-i \omega t}$$

$$F(\omega)$$ is in general a complex function (containing not only the amplitude but also the relative phase shift of each wave component at frequency $$\omega$$). Its absolute value $$|F(\omega)|$$ is the frequency spectrum and $$|F(\omega)|^2$$ the power spectrum.

You can find some basic explanations and examples here http://mriquestions.com/fourier-transform-ft.html (they use the variables $$s(t)$$ and $$S(\omega)$$ instead).

Below an example I encountered in my own work in the past (frequency spectrum of a nonlinear oscillation (ie. with modulated amplitude))

In practice (like for the example above) the time dependence is too complicated for a closed mathematical expression to exist for the Fourier transform, so it has to be calculated numerically. Many software packages for so called FFTs (Fast Fourier Transforms) exist. You can even do it in Excel (see https://youssef-lab.sdsu.edu/wp-content/uploads/2016/09/FFT-Tutorial.pdf for explanations and instructions)

There are three ways:

• Wavelength dispersive
• Energy dispersive
• Fourier

The first method uses a dispersive element like a prism or a diffraction grating. Than one can change the detector angle and measure a spectrum. Alternative, one has a detector with many pixels.

The second method is primarily used in gamma spectroscopy and for x-rays. The high energy photon then produces an electrical pulse that is higher for higher photon energies. Electronics can then measure the pulse-height distribution.

When the frequency is low one can do Fourier transforms directly. For IR there is the method with interference: scanning the length of a cavity.