# Computing the center of mass of a signal using the Fourier transform

I am having difficulty with a homework problem which asks:

I have some ideas in mind but I have no clue as to whether they are correct or not. Below is my attempt:

• This seems very much like a homework problem or self-study problem. These are on-topic here, BUT we prefer you to include your attempt (no matter whether you think it's right or not). Upload a picture of your working if that helps. I'll re-open (or another mod will) once that's done. – Peter K. Feb 23 '18 at 1:27
• Alright, that makes sense. I have uploaded what I think the answer is. – user34067 Feb 23 '18 at 1:49
• Not really what you're asking, but that is not a sensible definition of the center of mass of a signal. More sensible definitions would use either $|x|$ or $|x|^2$ in place of $x$. – Jazzmaniac Feb 23 '18 at 12:39
• @user34067, I just noticed that there's a minus sign missing in the exponent in your first equation for X. – applesoup Feb 23 '18 at 12:44
• I don't think your formula for the spectral centroid is correct. Please, see here en.wikipedia.org/wiki/Spectral_centroid. Anyway, I have a c++ implementaion and even if you don't use c++ it should be fairly easy to convert it to whatever language you're using. – dsp_user Feb 23 '18 at 18:40

The first thing you do is correct. You can calculate the sum of all the values of a signal evaluating its DTFT at $\omega=0$.
When you try to express the numerator with the DTFT though, you make a pretty clever thing but it is not correct, because you are evaluating the DTFT at $\omega=\ln\left( n^{\frac{1}{j2\pi n}}\right)$, which is not always real-valued. Remember that $\omega\in\mathbb{R}$.
To find how the DTFT of $x(n)$ and the numerator of $c$ are related, you can use the following property:
$$x(n)\xrightarrow{\mathscr{F}}X(\omega) \implies nx(n)\xrightarrow{\mathscr{F}}j\frac{dX(\omega)}{d\omega}$$
Using this property and your approach for the denominator (evaluating the transform at $\omega=0$), you should get the desired result.