# Peak to peak amplitude of sum of sinusoidals (harmonic frequencies)

I would like to estimate the peak-to-peak amplitude of a periodic signal whose frequency components are known. This is, I have the frequency spectrum (a peak in the fundamental frequency and other peaks in its harmonics) and I would like to compute the peak-to-peak amplitude. Is that possible without reconstructing the signal in the time domain and then detecting peaks?

Suppose that we have a continuous-time periodic signal $\displaystyle s(t) = a_0 + \sum_{n=1}^N a_n \cos(n\omega_0 t + \theta_n)$.

What does this mean? Do we have a trace of $s(t)$ on some recorder chart and the trace looks periodic? If we did, the question to be solved would be trivial since we could simply measure the maximum and minimum values of $s(t)$ on the chart. So the problem of interest is:

Given the values of $\omega_0, a_0, a_1, a_2, \cdots, a_N, \theta_1, \theta_2, \cdots, \theta_N$, find the values of $$M_\max = \max s(t)\quad \operatorname{and} \quad M_\min = \min s(t).$$

The OP wants to find the peak-to-peak amplitude of $s(t)$ and this is, of course, just $M_\max-M_\min$. It is worth noting that since $s(t)$ is periodic with period $T = \frac{2\pi}{\omega_0}$, the maximum value and minimum value occur (at least once) in each interval of length $T$ on the time axis. The key issue here is since we know the $a_i$ and the $\theta_i$ etc., we can write down the formula $$s(t) = a_0 + \sum_{n=1}^N a_n \cos(n\omega_0 t + \theta_n)\tag{1}$$ (whether this constitutes "reconstruction" of the time-domain signal is a question that I will leave to others to answer) but the standard method for finding the maxima and minima of $s(t)$ requires us to find solutions to the nonlinear equation $(2)$ below (that is, values of $t$ for which $(2)$ holds): $$\frac{ds(t)}{dt} = -\sum_{n=1}^N a_n\cdot n\omega_0 \sin(n\omega_0 t + \theta_n) = 0. \tag{2}$$ Once we have found the values $t_1, t_2, \ldots, t_k, \ldots$ for which $\displaystyle \sum_{n=1}^N a_n\cdot n\omega_0 \sin(n\omega_0 t_k + \theta_n) = 0$, we can simply calculate $s(t_1), s(t_2), \ldots, s(t_k), \ldots$ and search through this list of numbers (it is not necessary to sort the list as recommended in hotpaw2's answer) to find $M_\max$ and $M_\min$. But, ignoring the difficulty of finding the $t_k$'s makes hotpaw's answer not particularly useful in solving the OP's problem. The answer by ethereal is even worse in this regard since all it boils down to is the assertion that (for $\alpha > 0$) the maximum and minimum values of $\alpha\cdot s(t)$ are $\alpha\cdot M_\max$ and $\alpha\cdot M_\min$ respectively. Finding the maximum and minimum of $s(t)$ from knowledge of its Fourier series is a nontrivial task, not at all as easy as it is made out to be by ethereal or by hotpaw2.

A related problem has received a lot of research attention in the past thirty years or so. For a periodic signal such as $s(t)$, the average power in the signal is readily computed as $$\bar{P} = \frac{1}{T}\int_0^T |s(t)|^2\,\mathrm dt = a_0^2 + \frac{1}{2}\sum_{i=1}^N |a_i|^2.$$ On the other hand, the peak power is $P_\max = \max\{M_\max^2, M_\min^2\}$, and is also of interest, especially to system and power amplifier designers, and the ratio $\frac{P_\max}{\bar{P}}$, aptly named the _peak-to-average-power ratio (PAPR) has received much attention. It can be calculated exactly for a given $s(t)$ but only with great computational effort, and so a lot of effort has gone into finding bounds on the PAPR. Some of these could help in getting bounds for the OP's problem. only with a great deal of effort.

• Thank you very much for your detailed answer. I'm going to search bibliography about PAPR, although it seems that maybe reconstructing the signal in the time domain will be an easier solution after all :S – Ayla Jun 26 '13 at 9:28

For periodic signals, the maximum peak-to-peak amplitude is dependent in the relative phase of each harmonic, as well as their magnitudes. Do you have that information? If so, you can numerically evaluate all the local maxima and minima and sort.

• But that requires reconstructing the signal, which the OP doesn't want to do. – Jim Clay Jun 25 '13 at 18:26
• Only the local extrema, which does not require reconstructing the entire signal. – hotpaw2 Jun 25 '13 at 20:30
• The calculation of the locations of the maxima and minima of the functions is a nontrivial task, and that is precisely the point that you fail to discuss. – Dilip Sarwate Jun 26 '13 at 3:19
• The question does not specify that a trivial solution is required. Only non-reconstruction. – hotpaw2 Jun 26 '13 at 5:04
• @hotpaw2 A flippant response intended to obscure the truly unhelpful nature of your answer? You dismiss the hard part of the problem -- the difficulty of finding the locations of the maxima and minima -- as not worthy of discussion and give an unnecessarily complicated solution to the easy part. It is not necessary to sort (an $O(n \log n)$ process) through the values of the local maxima and minima to find the global maximum and minimum: a simple linear search (an $O(n)$ process) suffices. – Dilip Sarwate Jun 26 '13 at 12:30

Consider the linearity property of the DFT: This indicates that the DFT amplitude scales directly with the time domain amplitude of your signal. Therefore, you should be able to deduce the time domain amplitude directly from the frequency domain amplitude empirically; find the DFT amplitude of a baseline or unity TD signal, and from that you can easily compute a scaling factor that can be applied to your spectral peaks to derive the TD amplitude.

• Of course the DFT amplitude scales with the signal amplitude. But the maximum amplitude of the time-domain signal depends on how the different harmonics add up. So the phase as well as the magnitude are important, and so given the (complex) coefficients it is not so straightforward to determine the time-domain amplitude. So what "baseline or unity TD signal" would you use? – Matt L. Jun 25 '13 at 15:34
• This answer has mostly incorrect conclusions. The problem of finding the peak amplitude of a sum of sinusoids is an area of active research, and peak to average power ratio is what one should be asking about on search engines. – Dilip Sarwate Jun 25 '13 at 15:35
• @MattL., the OP indicated a well known sum of sinusoids. Creation of the baseline signal is left to the reader. – Ethereal Jun 25 '13 at 15:46
• @DilipSarwate if the OP is indeed looking for papr, then you are correct, he would be best served reading about the numerous existing implementations! – Ethereal Jun 25 '13 at 15:47
• @ethereal: what do you mean by "a well known sum of sinusoids"? In the question only a spectrum of harmonics is mentioned, just as is the case for any periodic signal. And "left to the reader" is a funny way of saying that either you are not able or willing to help. Your answer is misleading and not to the point. – Matt L. Jun 25 '13 at 16:36