# How to calculate the mean/center frequency of the spectrum?

Assume that the Fourier Transform of $$x(t)$$ is $$X(j\omega)$$. And I want to calculate the $$\bar{\omega}$$ which is the center freqency in the spectrum ( the highest).

• And a classmate tells me this formula $$\bar{\omega} = \int \omega X(j\omega)\ d\omega$$ could be used to calculate the center frequency ? But it is the first moment, it seems that the result is mean frequency.
• Could anyone help me with this question?
• What is the mean and center frequency of the spectrum?

There is no solution in Alan's book.

EDIT:

Maybe I did not state the center frequency clearly. I want to find out the frequency where the amplitude spectrum is biggest.

Another situation: assume that the signal is discrete $$x[n]$$. So we could just compute a period $$[-\pi, \pi]$$. In this case, this formula could represent the center frequency?

• @LaurentDuval Yep, I want to find out the frequency which amplitude is the largest one in the spectrum for the single-mount signal. What do you mean by power tends to infinity? – stander Qiu Mar 29 '17 at 13:08
• @LaurentDuval Yep, I have tried the code. Now I want to do the calculation. So I want reference for the formula. You could reply to me if you have time. – stander Qiu Mar 29 '17 at 13:52

[EDIT] If just want to compute the location of the maximum amplitude, you just have to compute the maximum. You can work in a more generic context, however. As you remarked, the notion of center frequency is not evident. The notion of centroid could be more pertinent.

I assume that your signal is real (since you are talking about a maximum, not well defined in the complex domain). Since its amplitude spectrum is symmetric about $0$, this possible center of mass is useless, since it is the same for all real signals (the zero-frequency). More likely, one is looking at a more useful quantity, based on a one-sided spectrum:

$$\overline{\omega}_W = \int_{\mathbb{R}^+} \omega W(X(\omega))d\omega$$

where $W(X(\omega))$ is a weighting function that (may) depend on the spectrum $X$. The "mean" $\overline{\omega}_W$ will depend on the choice of $W$. A code was given in the answer to Finding the right measure to compare sound signals in the frequency domain.

You can base it on an absolute value, or something else (positive). But it is important to have a normalized weight: it should, somehow, sum to one, like for a traditional center of mass. The reason is scaling homogeneity. The mean should not change if you multiply every $X(w)$ by the same quantity.

For orthogonal transforms, based on the energy conservation:

$$\int [x(t)|^2dt = \int [X(\omega)|^2d\omega$$

it is very common to use a mean/center definition based on an energetic weight, ie a square of the absolute spectrum. So every often, the mean frequency is defined as:

$$\overline{\omega}_2 = \frac{\int_{\mathbb{R}^+} \omega|X(\omega)|^2d\omega}{\int_{\mathbb{R}^+}|X(\omega)|^2d\omega}\,.$$

This choice is very sensitive when dealing with time/frequency location uncertainty related to the Weyl-Pauli-Heisenberg inequalities.

But you can use other $L_p$ norms, with:

$$\overline{\omega}_p = \frac{\int_{\mathbb{R}^+} \omega|X(\omega)|^pd\omega}{\int_{\mathbb{R}^+}|X(\omega)|^pd\omega}\,.$$

As $p\to\infty$, this estimator converges to the location of a maximum, as demonstrated in Metric Spaces: Why $L_\infty$ selects the maximum value.

When $p=1$, this is called the spectral centroid, or "brightness" (of sound), or simply "centre of gravity of amplitudes". It is described with other moments in Chapter 6.1 Spectral shape description. When $p=2$, this is sometimes called the power spectral centroid.

I have not found yet useful references for other powers (still searching).

• Yep. I just use MATLAB to test a signal. The result is the last formular you give. Thank you! – stander Qiu Mar 26 '17 at 13:53
• But why is $\bar{w}_1$ not true? Why amplitude does not make sense? – stander Qiu Mar 26 '17 at 13:54
• Hello! I still have a question. Could you discuss with me in the chat?chat.stackexchange.com/rooms/56145/the-mean-frequency Thanks!:) – stander Qiu Mar 28 '17 at 1:13