4.4 The ESD, PSD and MS Spectrum functions
While the PSD targets power signals, the ESD is a convenient tool for analyzing energy signals, informing how the total energy is distributed over frequency. Both are “density” functions, with the independent variable . The mean-square (MS) spectrum is a discrete-frequency function with the independent variable . We will discuss each of the three functions in this section.
4.4.1 Energy spectral density (ESD)
To understand the ESD definition, it is useful to recall the Parseval theorem. The (Parseval) Theorem 2 for block transforms can be extended to continuous and discrete-time signals. For continuous-time, together with Eq. (1.22), one has
| (4.14) |
stating that the energy is the same in both time and frequency domains. This suggests defining
| (4.15) |
as the ESD in continuous-time. Therefore, describes how the signal energy is spread over frequency and its integral is the energy . The adopted unit for the ESD is joules/Hz.
Example 4.3. ESD of a real-valued exponential. Consider the energy signal in volts, where . Its Fourier transform is and the ESD in joules/Hz is
The signal energy is . Listing 4.6 illustrates how can be estimated in time-domain and also using . In this case, the range is simulated as s and Hz in time and frequency-domain, respectively.
1%% Generate time-domain signal 2Ts=0.0001; %defines resolution in time 3t=0:Ts:30; %time axis 4a=0.9; %constant 5x=exp(-a*t); %signal 6subplot(211), plot(t,x) 7xlabel('t (s)'); ylabel('x(t) amplitude') 8%% Generate ESD 9f=linspace(-2,2,1000); %frequency axis 10Gf= 1 ./ ((2*pi*f).^2 + a^2); %ESD 11subplot(212) 12plot(t,x), plot(f,Gf) 13xlabel('f (Hz)'); ylabel('ESD (J/Hz)') 14%% Confirm Parseval theorem 15energy_equation = 1/(2*a); %theoretical 16energy_time = sum(abs(x).^2)*Ts; %integration 17df=0.0001; %defines resolution in frequency 18min_f = -1000; %range of interest 19max_f = 1000; 20f=min_f:df:max_f; %frequency axis 21Gf= 1 ./ ((2*pi*f).^2 + a^2); %recalculate ESD 22energy_frequency = sum(Gf)*df; %integration 23disp(['Theoretical energy =' num2str(energy_equation) ' Joules']) 24disp(['Integration in time =' num2str(energy_time) ' Joules']) 25disp(['Integration in frequency =' num2str(energy_frequency) ' J']) 26%% Energy in given frequency band 27min_f = 0.2; max_f = 1; %range of interest 28f=min_f:df:max_f; %new frequency axis 29Gf= 1 ./ ((2*pi*f).^2 + a^2); %recalculate ESD 30energy_band = 2*sum(Gf)*df; %integration using 2 times 31disp(['Energy in band =' num2str(energy_band) ' Joules'])
Listing 4.6 also illustrates how can be conveniently used to estimate the energy within a given frequency band. In this example, the energy within the range from 0.2 to 1 Hz, considering both negative and positive frequencies, is J.
Example 4.4. ESD of a sinc in time-domain. Now consider the energy signal is in volts. According to Eq. (A.56), one needs to consider that , such that Hz. With this assumption, Eq. (A.56) can be used together with the linearity property of the Fourier transform. The linearity takes care of a factor of 4 that multiplies Eq. (A.56), such that one has for Hz and 0 otherwise. Hence, the ESD of is for Hz and 0 otherwise. In this case, using the ESD instead of , it is easy to conclude that the total signal energy is joules.
4.4.2 Advanced: Units of ESD when angular frequencies are adopted
Similar to the discussion in Section 2.5.4 regarding the Fourier transform with in rad/s, there is a subtle issue when using radians per second instead of Hertz for the ESD. In this case, the factor needs to be taken in account such that has the unit of joules/(rad/s). The energy over a band of frequencies specified in rad/s can then be calculated by integrating over this band. For instance, considering a band the energy is:
| (4.16) |
where and the unit of is joules/(rad/s).
Example 4.5. The unit of is joules/(rad/s). For instance, take the sinc signal of Example 4.4, which has a flat ESD given by J/Hz within the range Hz and zero otherwise. The representation of this ESD in rad/s has the same constant value but now over the range rad/s. The value can be interpreted as a density in J/(rad/s). Within the range , one has J.
In continuous-time spectral analysis, the linear frequency in Hertz is more convenient and angular frequencies are seldom adopted. But this is not an option in discrete-time processing, given that is an angle (assumed in radians) and does not have a counterpart in Hertz. Hence, the ESD in discrete-time
| (4.17) |
needs to be normalized by the factor to be interpreted as in units of joules per radians. Using this definition, one can properly interpret a version of the Parseval theorem in discrete-time:
| (4.18) |
Table 4.2 summarizes the discussed ESD functions.
Time | Variable | ESD definition | ESD main property | |
Continuous-time | (Hz) | |||
Continuous-time | (rad/s) | |||
Discrete-time | (rad) | |||
4.4.3 Power spectral density (PSD)
In most cases, the signal under analysis has infinite energy, such as a deterministic power signal (e. g. a periodic signal) or realizations of a stationary random process. Therefore, the main interest in spectral analysis relies not on the ESD but on the PSD.
Main property of a PSD
Noticing from Eq. (4.14) and (4.18) that squared magnitudes provide the energy distribution over frequency, to obtain the power distribution one can intuitively consider dividing the ESD by “time”, via a normalization factor that converts energy into power.
The PSD has the important property that the average power can be obtained in continous-time by
| (4.19) |
with in watts/Hz.
Similar to the reasoning associated to Eq. (4.16), the version of Eq. (4.19) when the continuous-time PSD is a function of in radians/s is
| (4.20) |
and is interpreted in units of watts per rad/s.
The PSD definition in discrete-time is
| (4.21) |
where is interpreted in units of watts per radians.
In all three equations above, the PSDs describe the distribution of power over frequency. The frequency can be linear in Hz, angular frequency in radians/s or discrete-time angular frequency , which is an angle in radians.
PSD definitions and the focus on random signals
As discussed in Section 1.6, there are many categories of signals. Figure 4.24 illustrates some of them. Different categories of signals require distinct definitions of PSD. To simplify the discussion, some spectral analysis textbooks3 choose to emphasize discrete-time random signals, and define the PSD for this kind of signals. Moreover, the spectral estimation problem is defined in these textbooks4 as:
- From a finite-length record of a second-order stationary random process, find an estimate of its power spectral density for .
In other words, the context of this problem is restricted to discrete-time power signals with duration of samples. Here we also discuss other cases, such as: a) continuous-time PSDs, b) when the signal is deterministic and c) the theoretical PSD expressions for infinite-duration signals.
It makes complete sense to focus the study of PSD estimation on random signals, because they are important in many applications, such as in digital communications. One useful model for these signals is the wide-sense stationary (WSS) random process with autocorrelation (see definitions in Appendix A.20). In many spectral analysis problems,5 besides being WSS, the random process is assumed to be autocorrelation ergodic.
The PSD for a continuous-time power signal corresponding to a realization of a WSS stochastic process is defined as
| (4.22) |
where is the Fourier transform of a truncated (windowed) version of with duration . In other words, where for or zero otherwise.
An alternative to obtaining a PSD via Eq. (4.22) is using the Wiener-Khinchin theorem,6 which states that the power spectral density (PSD) of a WSS process is the Fourier transform of the corresponding autocorrelation function, i. e.
| (4.23) |
Similar expressions exist in discrete-time and even for deterministic signals.
For example, in discrete-time processing, the PSD is the DTFT of the autocorrelation function:
| (4.24) |
where is the lag, and the inverse DTFT gives
| (4.25) |
Similar to Eq. (4.22), the PSD for a discrete-time power signal corresponding to a realization of a WSS stochastic process is defined as
| (4.26) |
where is the DTFT of , a truncated version of obtained via a rectangular window of non-zero samples. The unit of is watts per radians.
In practice, there is a finite number of realizations of and often only one realization is available. Fortunately, ergodicity of the autocorrelation can be assumed in many cases and the ensemble averages substituted by averages taken over time (see Appendix A.19). Besides, the number of samples (the duration of ) is often limited to a given value that can be determined, for example, by the time over which the process can be considered stationary. For example, in speech analysis applications, it is typically assumed the process of vowel production is quasi-stationary over segments with durations from 40 to 80 ms. With limited-duration signals, the challenge for spectral analysis is to obtain accurate estimates, as discussed in this chapter.
For both Eq. (4.22) and Eq. (4.26), windows other than the rectangular can be used when the signal under analysis has a short duration. But a rectangular window with infinite duration is the adequate window for the PSD definition.
Table 4.3 summarizes the discussed PSD functions.
Time | Variable | Definition | Main property | |
Continuous-time | (Hz) | |||
Continuous-time | (rad/s) | |||
Discrete-time | (rad) | |||
PSD of deterministic and periodic signals
The PSD definition that is adopted for continuous-time deterministic signals (and does not require the expected value used in Eq. (4.22)) is
which is basically the ESD normalized by the time interval .
A special case of deterministic signals are the periodic ones. Assuming a continuous-time signal with period , its PSD is
| (4.27) |
where are the Fourier Series coefficients and is the fundamental frequency. Similarly, for , the expression is
| (4.28) |
where rad/s.
In summary, the PSD of a deterministic (non-random) periodic signal is composed by impulses with areas determined by the squared magnitude of Fourier series coefficients.
Example 4.6. PSD of a continuous-time sinusoid. If , then and the average power is .
When considering a discrete-time periodic signal , its PSD can be obtained by first considering an expression for the frequency range :
| (4.29) |
where is the period, is the fundamental frequency, and the DTFS of . Finally, the PSD is simply the periodic repetition of :
| (4.30) |
Example 4.7. PSD of a discrete-time sinusoid. If (assume obeys Eq. (1.21) to have periodic), then and
provides its PSD, which has period , as expected.
4.4.4 Advanced: Fourier modulation theorem applied to PSDs
If is the PSD of a WSS random process , the PSD of a new process is
| (4.31) |
Similarly, if , then
| (4.32) |
To observe why Eq. (4.31) (and, consequently, Eq. (4.32)) is true, recall the Wiener-Khinchin theorem of Eq. (4.23) and the autocorrelation definition of Eq. (1.50). Generally speaking, when modifying a WSS process , the effect on its PSD can be obtained by checking how the modification affects its autocorrelation, and then relating this to frequency domain using Eq. (4.23). For example, multiplying by a scalar corresponds to scaling its autocorrelation by and leads to a PSD given the linearity of the Fourier transform.
According to this reasoning, a proof sketch of Eq. (4.31) follows:
Eq. (4.32) can be obtained by decomposing the cosine into two complex exponentials and taking in account that the factor leads to the in the PSD expression. Eq. (4.32) allows to observe that the result of a signal multiplied by a cosine of unitary amplitude has half of the original signal power.
4.4.5 Mean-square (MS) spectrum
The PSD is very useful especially when dealing with random signals and the power of the signal over a frequency range is obtained by integrating the PSD over that range. However, in some cases it is desired to use a function that allows to directly infer the average power of sinusoid components of a periodic signal, without the integration step. In these cases, the so-called MS or power spectrum is more convenient.7 However, in applications characterized by a mixed signal in which there is a deterministic signal of interest that is contaminated by random noise (such as sinusoids contaminated by AWGN), the PSD representation is often more convenient than the MS spectrum.
While in continuous-time the PSD unit is watts/Hz, the mean-square spectrum is given directly in watts. Assuming a signal with fundamental period samples, the mean-square spectrum corresponds to the squared magnitude of the corresponding DTFS:
| (4.33) |
with the property
| (4.34) |
where is the signal power.
Recall from the discussion associated to Eq. (2.49) that, if is periodic with fundamental period , its DTFS can be obtained with an -point FFT:
| (4.35) |
One often uses Eq. (4.35) even for a non-periodic , but then the result spectrum must be properly interpreted: as if the signal were a periodic version of the windowed version of using samples.
If the FFT size is chosen as , the -th FFT value in Eq. (4.35) corresponds exactly to the -th DTFS coefficient, that is, they both represent the same frequency . In case , Eq. (4.37) is still a valid way to obtain the average power , but the -th bin frequency must be interpreted according to the FFT grid as .
In general, an estimate of the MS spectrum of a discrete-time signal can be obtained from its -length windowed version with
| (4.36) |
and
| (4.37) |
The “hat” in indicates that in general, Eq. (4.36) is an estimate of the true MS spectrum.