Tutorial on Scaling of the Discrete Fourier Transform and the Implied Physical Units of the Spectra of Time-Discrete Signals
This text was originally presented as
Jens Ahrens, Carl Andersson, Patrik Höstmad, Wolfgang Kropp, “Tutorial on Scaling of the Discrete Fourier Transform and the Implied Physical Units of the Spectra of Time-Discrete Signals” in 148th Convention of the AES, e-Brief 56, May 2020 [ pdf ].
Please reference the text using this.
Abstract
The combination of the time-discrete property of digital signals together with the commonly employed definition of the discrete Fourier transform (DFT) can cause ambiguity when interpreting magnitude spectra with respect to the physical unit of the signal under consideration. Standardized scaling of spectra increases the comparability of frequency-domain data that are published in scientific articles or data sheets of commercial products. We present and discuss in this tutorial a collection of the most relevant scaling options for DFT spectra to yield amplitude spectra, power spectra, and power density spectra, and we illustrate how an implied physical unit of the underlying signal is reflected by the magnitude of the spectrum. The tutorial is accompanied by Matlab/Octave scripts that demonstrate the different cases.
1 Introduction
The Fourier transform (FT) is one of the most common mathematical operations in acoustics and audio. Definitions for continuous signals (CFT) as well as for discrete signals (DFT) exist. When speaking of a discrete signal, we refer to a signal that exhibits a dependency on a discrete variable such as time or space. We assume the instantaneous amplitude of the signal to be known with infinite accuracy.
Discrete signals require a somewhat different treatment than continuous ones because discrete signals are not physical. One aspect with which this becomes evident is interpreting the magnitude of the spectrum of a discrete signal, which is greatly facilitated when the spectrum is scaled. Although the scaling methods that we present here are widely known, we are not aware of a compact resource that summarizes the important information in an educational manner. This tutorial aims at filling this gap. Our treatment will be simplifying in a latent manner in the sense that we leave out certain less tangible details of the matter and focus on the fundamental concepts. We refer the reader to the references based on which we compiled this tutorial [1], [2, Sec. 4.2] [3, Ch. 4], [4, Ch. 6] and to the supplementary materials that we provide \cite{github_scaling}. For ease of compactness, we omit stating proofs.
After a brief excursion to the CFT in Sec. 2, scaling options for the DFT are presented in Sec. 3.1 and 3.2. Sec. 3.3 introduces the concept single-sided spectra, which the scaling approach requires to produce a representation of the spectrum that can be interpreted conveniently. Examples are presented. Further aspects are discussed in Sec. 4 and 5.
2 The Continuous Fourier Transform
We assume the following definition of the CFT:
is a purely real signal that is dependent on time, is the angular frequency, is the frequency in , and is time in . is termed the spectrum of . Note that above example represents a CFT over time. CFT over space exists, too [5].
Let us assume that in \eqref{eq:cft} represents a microphone signal in V. In terms of the units, the complex exponential is dimensionless (i.e., it has unit 1, or no unit in other words), and it is easy to show that integration over results in multiplying with s, the unit of . The spectrum is therefore given in the unit of
therefore represents an amplitude density, i.e. amplitude per frequency interval.
3 The Discrete Fourier Transform
Interpretation of the spectrum of the DFT in terms of the units is not as straightforward as with the CFT. We assume the following definition of the DFT in this tutorial:
is a signal that is dependent on the integer time index . One also speaks of as the signal at tap . is the integer frequency index also known as bin. Other definitions exist that differ only with respect to a normalization constant and/or the sign of the exponent. Eq. \eqref{eq:dft} appears to be the most widely used definition of the DFT and is also used by MATLAB and Python.
3.1 Scaling of DFT Spectra of Discrete Tones
A continuous signal that is composed of discrete tones is characterized primarily by the amplitude and phase of each of the tones. A first property of that we notice is that is directly proportional to , which is undesired in most situations (cf. Fig. 1). It is preferable to scale the spectrum such that the amplitudes of said tones are apparent. Compensating for the total number of samples as
yields an amplitude spectrum, i.e. a spectrum whose implied unit1 is the implied unit of . Refer to Fig. 2 and 3 in Sec. 3.3 for examples of amplitude spectra.
Fig. 1: of a sine wave of frequency and with amplitude for (left) and (right)2. The horizontal axis was converted from bin index to frequency in Hz as explained in Appendix A. See this MATLAB script.
The square of this spectrum constitutes a power spectrum,
the values of which are directly proportional to the power in each bin 3. This means that the power of each of the discrete tones in a signal is represented by (if the energy of each discrete tone is confined to one bin). Assuming the implied unit of is , then the implied unit of is .
3.2 Scaling of DFT Spectra of Broadband Signals
As we will demonstrate in Sec. 3.3, for a continuous signal that can be described as a broadband stochastic signal of some frequency distribution and power rather than an amplitude, it can be favorable to adapt the scaling.
The most important alternative to amplitude and power spectra is the power spectral density (PSD) or power density spectrum
with the implied unit . The PSD is the power spectrum \eqref{eq:power_spectrum} divided by the frequency resolution . Consider a continuous broadband signal that is sampled at different sample rates but with the same number of samples. At a lower sample rate, each bin represents a narrower frequency band so that the magnitude of the power spectrum will be lower. The PSD compensates for this.
It is also possible to create an amplitude density spectrum like \eqref{eq:cft}. However, the usefulness of this with discrete signals is not obvious.
3.3 Single-Sided and Double-Sided Spectra
When computing in \eqref{eq:dft} for a sufficient range of , one finds that is periodic with a period equal to the length of the signal . When is purely real - as it is the case with most audio-related scenarios - then exhibits certain symmetries with respect to that allow for concluding that some of the values of inside one period are redundant and may be removed from the representation.
It is helpful in many situations – such as the context of this paper – to convert the (symmetric) double-sided spectrum, i.e., for a given range of length of to a single-sided spectrum that contains only non-redundant values. To account for the change of representation through omitting non-redundant values, we multiply all values of that represent a pair of a value of as well as a redundant value by 2.
Let us assume in the following a spectrum of a purely-real signal of even length . The symmetry is summarized as
The asterisk denotes complex conjugation. The direct current (DC) bin () and the bin at , i.e., the bin that corresponds to the Nyquist frequency (cf. Appendix A, are purely real and unique.
We therefore define the single-sided spectrum as
Note that for odd , all bins other than have to be multiplied with 2. The single-sided representations of , , , and are obtained equivalently to \eqref{eq:single-sided}.
To highlight the usefulness of the single-sided representation, Fig. 2 depicts the single-sided amplitude spectrum (cf. \eqref{eq:amplitude_spectrum}) of a signal that represents a pure sine wave with amplitude and an amplitude offset (DC) of . The amplitude of the sine wave as well as and the DC can be directly deduced from .
Fig. 2: Illustration of single-sided amplitude spectra. The upper plot depicts , a sine wave of frequency Hz, with amplitude , and a DC of . The lower plot depicts . See this MATLAB script.
However, the picture is very different when interpreting amplitude spectra of broadband signals as illustrated in Fig. 3. The spectrum of a sine wave with additive noise is depicted for two different lengths of the DFT. The magnitude of the sine wave is independent of while the magnitude of the noise changes with .
Fig. 3: Single-sided amplitude spectra on a logarithmic scale of a sine of amplitude 1 and implied unit with additive white noise. . Left: . Right: . See this MATLAB script.
When the analysis of the noise in the signal from Fig. 3 is of interest, a power density scaling is more favorable. Fig. 4 presents the single-sided power density spectrum of the signal from Fig. 3 for different sampling frequencies and different lengths . Contrary to the amplitude spectrum in Fig. 3, the magnitude of the noise is independent of and . However, the magnitude of the discrete tone changes. This is a fundamental dilemma that cannot be avoided. The reason for this is that the concept of a spectral density is not meaningful for discrete tones (and the concept of a spectral amplitude is most of the times not meaningful for broadband signals).
Fig. 4: Single-sided power spectral density of the signal from Fig. 3 for different sampling frequencies and lengths . Left: , . Right: , . See this MATLAB script.
Note that while (Eq. \eqref{eq:power_spectrum}) holds for double-sided power spectra, this relation reads
for single-sided spectra (and similarly for the PSD). This can be interpreted in terms of the crest factor of sine waves of , i.e., the ratio of maximum value (in the case of sine waves the amplitude) to root-mean-square (RMS, cf. App. B. For , the RMS of the signal at each bin is obtained by dividing the magnitude of the amplitude spectrum by as the basis functions of the DFT may be interpreted as sine waves:
We term RMS spectrum. It represents the RMS amplitudes of the discrete tones in the signal, and holds. A similar definition can be established for an RMS density spectrum . Note that RMS-spectra are inherently single sided and have no equivalent double-sided representation.
4 Windowing
It is common in spectral analysis of discrete signals to apply a window to the signal before the DFT in \eqref{eq:dft}. This needs to be taken into account in the scaling of the spectra, which has be performed differently for tonal signals as in Sec. 3.1 and for broadband signals as in Sec. 3.2:
where is the DFT of . Simply put, the factors in \eqref{eq:amplitude_spectrum} and \eqref{eq:power_spectrum} are replaced by the sum of the window samples, and the factor in the last equality in \eqref{eq:power_spectral_density} is replaced by the sum of the squared window samples. Eq. \eqref{eq:window_scaling_1} simplifies to \eqref{eq:amplitude_spectrum} for the case of , \eqref{eq:window_scaling_3} to \eqref{eq:power_spectrum}, and \eqref{eq:window_scaling_4} to \eqref{eq:power_spectral_density}.
5 Other Remarks
A complex number may be represented either as real and imaginary parts and or as magnitude and phase as
Since the complex exponential is dimensionless, , , and carry the same physical unit that is determined from the type of spectrum that is part of.
The transfer function of a system can be represented as the ratio of output and input spectra as . Any scaling of and will cancel out. Regarding the units, holds so that is dimensionless if . Similar considerations hold of the impulse response. Note that the magnitude of the unscaled spectrum of an impulse with amplitude 1 is always 1 independent of .
6 Conclusions
The combination of scaling and the single-sided representation of the DFT spectra of purely real signals allow for spectral representations like amplitude spectra, power spectra, and power density spectra of discrete signals that can be conveniently interpreted in terms of the implied physical units. Different scaling is required for discrete tones and for stochastic signals to make the scaled magnitude spectrum of one of the two signal types independent of the length of the Fourier transform and the sampling frequency. This causes a fundamental dilemma when analysing signals that contain both types of elementary signals.
APPENDICES
A The Relation Between Bin Index and Frequency
When taking the into account with what frequency a previously time-continuous signal was sampled, then it is possible to relate the bin index in \eqref{eq:dft} to a frequency in Hz that represents the center frequency of the bin as
Eq. \eqref{eq:k} was used in all figures in this paper that depict spectra to express the horizontal axis in Hz.
B Root Mean Square
The RMS of a discrete time domain signal is given by
Inserting Parseval’s theorem given by
into \eqref{eq:rms_t} allows for computing the RMS from the spectrum as
References
- G. Heinzel, A. Rüdiger, R. Schilling. Spectrum and spectral density estimation by the Discrete Fourier transform (DFT), including a comprehensive list of window functions and some new flat-top windows. Tech. Rep. http://hdl.handle.net/11858/00-001M-0000-0013-557A-5, 2002.
- J. G. Proakis and D. G. Manolakis. Digital Signal Processing: Principles Algorithms and Applications. Prentice-Hall, Upper Saddle River, New Jersey, USA, 3rd edition, 1996.
- L. Tan and J. Jiang. Digital Signal Processing: Fundamentals and Applications. Academic Press, Amsterdam, The Netherlands, 2nd edition, 2013.
- D. C. Swanson. Signal Processing for Intelligent Sensor Systems with MATLAB. CRC Press, London, UK, 2017.
- E. Williams. Fourier Acoustics: Sound Radiation and Nearfield Acoustical Holography. Academic Press, New York, 1999.
-
We speak of an implied unit as, strictly speaking, discrete signals do not have a physical unit. If is the discrete representation of a physical signal , then we consider , the unit of , the implied unit of . ↩
-
Note that magnitude spectra are typically plotted on a logarithmic scale, i.e. when representing amplitude or when representing power or energy. We chose a linear scale here for ease of demonstration. ↩
-
With electrical signals, the power is obtained as , with being the effective (RMS) voltage and being a resistance. The RMS spectrum is defined in \eqref{eq:rms_spectrum}, and its square is directly proportional to via \eqref{eq:single-sided}. ↩