There are several ways in which this can be done. The traditional method is the use of a spectrum analyzer that produces the power spectral density plot in real number space.
Spectrums are complex so the use of digital spectral methods has increased in recent decades.
The common methods in use are fast fourier transform and wavelet transforms. There are in fact several variations on these and some other less popular but useful transforms as well. This covers the fourier methods very well and discusses the Welch power spectral density algorithm which is very popular. It also discusses Cepstrum and some others that are often useful for vibration and acoustics problems. G. Strang's 'Wavelet Processing' is also very valuable.