3

I am trying to evaluate the power spectral density $S_{xx}(f)$ of a cosine signal $x(t) = A\cos(2\pi f_0t)$, by starting from its definition for deterministic power signals $$S_{xx}(f) = \lim_{T\rightarrow\infty}\frac{1}{T}\left|X_{T}(f) \right|^2\;, \tag{1}$$ where $X_T(f)$ is the Fourier transform of a signal $x(t)$ which has been truncated to a time window $T$, given by $$X_T(f) = \int_{-T/2}^{T/2}x(t)\;e^{-2\pi if t}\;dt \;.\tag{2}$$

I know that the answer should be $$S_{xx}(f) = \frac{A^2}{4}\bigg[\delta(f-f_o) + \delta(f+f_o)\bigg]\;,\tag{3}$$ but I am stuck with my working. Can anyone check it so far, and help me fill in the gaps? Perhaps my mathematics is not as good as it ought to be!

\begin{align} S_{xx}(f) &= \lim_{T\rightarrow\infty}\frac{1}{T}\left|X_{T}(f) \right|^2\ \tag{4} \\ &= \lim_{T\rightarrow\infty}\frac{1}{T}\left[ \int_{-T/2}^{T/2}x(t)\;e^{-2\pi if t}\;dt \int_{-T/2}^{T/2}x^\ast(t')\;e^{2\pi if t'}\;dt' \right] \tag{5} \\ &= \lim_{T\rightarrow\infty}\frac{1}{T}\left[ \int_{-T/2}^{T/2}\int_{-T/2}^{T/2} A^2\cos(2\pi f_0t)\cos(2\pi f_0t')\;e^{2\pi if(t'-t)}\;dt \;dt'\right] \tag{6} \\ &= \lim_{T\rightarrow\infty}\frac{A^2}{2T}\left[ \int_{-T/2}^{T/2}\int_{-T/2}^{T/2} \Big[\cos\big(2\pi f_0(t+t')\big) + \cos\big(2\pi f_0(t'-t)\big)\Big]\;e^{2\pi if(t'-t)}\;dt \;dt'\right] \tag{7} \end{align} where the last line is obtained by using the product-to-sum identity for cosines. Now, I'm a little stuck. I can make the substitution $\tau = t'-t$, which simplifes the exponential

$$ S_{xx}(f) = \lim_{T\rightarrow\infty}\frac{A^2}{2T}\left[ \int_{-T/2-t}^{T/2-t}\int_{-T/2}^{T/2} \Big[\cos\big(2\pi f_0(2t+\tau)\big) + \cos\big(2\pi f_0\tau\big)\Big]\;e^{2\pi if\tau}\;dt \;d\tau\right] \tag{8} $$

but now I am not sure how to proceed. I can also replace my cosines with complex exponentials to obtain

$$\lim_{T\rightarrow\infty}\frac{A^2}{4T}\left[ \int_{-T/2}^{T/2}\int_{-T/2}^{T/2} \Big[ e^{2\pi if_0(t+t')} + e^{2\pi if_0(t-t')} +e^{2\pi if_0(t'-t)}+e^{-2\pi if_0(t+t')} \Big]\;e^{2\pi if(t'-t)}\;dt \;dt'\right]$$

Can someone teach me how to finish this? Ideally I would like it if someone could show me how to evaluate it in terms of $T$, and then show how the $\delta$ functions arise as we finally take the limit $T\rightarrow\infty$.

teeeeee
  • 681
  • 6
  • 17
  • 1
    In line (6) try substituting in

    $$ \cos( \theta ) = \frac{e^{i\theta}+e^{-i\theta}}{2} $$

    for each of your cosine terms. This will make your resultant integral that of a sum of exponents after multiplying them all out which should be easily evaluated.

    – Cedron Dawg Apr 01 '20 at 17:45
  • Also, if you do your variable substitution you have to adjust the limits on your integral as well. – Cedron Dawg Apr 01 '20 at 17:53
  • I have done as you suggested (see edit), but again need a hint! Thanks! – teeeeee Apr 01 '20 at 18:39
  • It looks like you did the substitution on line (7) instead, but that should work as well. You still need to adjust the limits after your substitution. Move the brackets inside around the inner integral, then solve that first.

    $$ \int e^{ax} dx = \frac{1}{a} e^{ax} + C $$

    You need to do the definite integral version of that for each term.

    – Cedron Dawg Apr 01 '20 at 18:44
  • I adjusted the limits already - did I do it wrongly? Only the limits on the $t'$ integral need changing, because that is the variable I replaced? – teeeeee Apr 01 '20 at 18:46
  • It's not right. $t$ doesn't exit outside the inner integral. Let me look more carefully. – Cedron Dawg Apr 01 '20 at 18:51
  • I think you need to reverse the order of integration before you make the substitution. Still, it will be easier overall I think, if you go back to (6) do the $cos$ substitution then multiply out the results without doing a variable substitution. – Cedron Dawg Apr 01 '20 at 19:01
  • Okay, I have edited back to before the variable substitution. Simply substituted into 6 and multiplied out the brackets. How were you anticipating that would help? – teeeeee Apr 01 '20 at 19:08
  • Right, now complete the multiplying out by multiplying the outer $e^{2\pi if(t'-t)}$ on your inner sum and you will get a simple sum of exponentials. The 8 in the denominator should be a 4, no? – Cedron Dawg Apr 01 '20 at 19:11
  • No, it should be a 8 because there was already a 2 there from earlier. You have noticed that the $f$ on the the outer exponential and the $f_0$ on the inner ones are different, right? – teeeeee Apr 01 '20 at 19:13
  • 1
    That 2 came from the transition from (6) to (7). Yes, you are going to get some ugly exponential expressions, but they are solvable. We are getting the chat prompt. I'm going to take the dog for a walk, back in about an hour. – Cedron Dawg Apr 01 '20 at 19:16
  • Taking a step back, you should be able to evaluate (2) on a standalone basis. – Cedron Dawg Apr 01 '20 at 19:18

2 Answers2

2

You don't need to make it so complicated as to use two variables $t$ and $t^\prime$.

\begin{align} X_T(f) &= \int_{-T/2}^{T/2} x(t)\exp(-j2\pi ft)\,\mathrm dt\\ &= \int_{-T/2}^{T/2}\frac{\exp(j2\pi f_0t)+\exp(-j2\pi f_0t)}{2}\exp(-j2\pi ft)\,\mathrm dt\\ &= \frac 12\int_{-T/2}^{T/2} \exp(j2\pi (f_0-f)t)+\exp(-j2\pi (f_0+f)t)\,\mathrm dt\\ &= \frac 12 \left[\frac{\exp(j2\pi (f_0-f)t)}{j2\pi(f_0-f)}~ + ~\frac{\exp(j2\pi (f_0+f)t)}{j2\pi(f_0+f)}\right\vert_{-T/2}^{T/2}\\ &= \frac 12 \left[\frac{\exp(j\pi (f_0-f)T)-\exp(-j\pi (f_0-f)T)}{j2\pi(f_0-f)}\right.\\ &\qquad\qquad + \left.\frac{\exp(j\pi (f_0+f)T)-\exp(-j\pi (f_0+f)T)}{j2\pi(f_0-f)}\right]\\ &= \frac T2 \big(\operatorname{sinc}((f_0+f)T) ~+ ~\operatorname{sinc}((f_0-f)T)\big)\\ &= \frac T2 \big(\operatorname{sinc}((f-f_0)T) ~+ ~\operatorname{sinc}((f+f_0)T)\big). \end{align} So we get \begin{align}\frac 1T\big|X_T(f)\big|^2 &= \frac T4 \big(\operatorname{sinc}^2((f-f_0)T) ~+ ~(\operatorname{sinc}^2((f+f_0)T)\\ &\qquad\qquad + 2\operatorname{sinc}((f-f_0)T)(\operatorname{sinc}((f+f_0)T)\big) \end{align} In the frequency domain, the two $\operatorname{sinc}^2$ functions are of height $\frac T4$, are centered at $\pm f_0$ with central lobes of width $\frac 2T$ Hz. As $T \to \infty$, the central lobe widths shrink to $0$ and it is straightforward to show that for any value of $f$ other than $\pm f_0$, $$\lim_{T\to\infty} \frac 1T\big|X_T(f)\big|^2 =0, ~ f \neq \pm f_0.$$ Now, $\frac 1T|X_T(\pm f_0)|^2$ diverges to $\infty$ and with the usual trick of pulling a Dirac delta out of the hat in such cases, we get that it must be that $$S_{xx}(f) = \lim_{T\to\infty} \frac 1T|X_T(f)|^2 = \frac 14 \big(\delta(f-f_0) + \delta(f+f_0)\big), ~~ \text{when} ~x(t) = \cos(2\pi f_0 t).$$

Dilip Sarwate
  • 20,349
  • 4
  • 48
  • 94
  • Looks like you took that step back and did (2). You missed a factor of T when you went to $sinc$. Without it, the limit of (4) goes to zero. – Cedron Dawg Apr 01 '20 at 20:30
  • Can you include the full steps - in particular how you would then take this solution and use it to evaluate $$S_{xx}(f) = \lim_{T\rightarrow\infty}\frac{1}{T}\left|X_{T}(f) \right|^2$$ I would like to see how you take your answer and multiply it by its complex conjugate and then take the T to infinity limit as the final step. I think that's what leads to it being so complicated, and don't know how to avoid it. – teeeeee Apr 01 '20 at 21:01
  • Yes, but I want to show explicitly how what happens to the term $$2\operatorname{sinc}((f-f_0)T)\operatorname{sinc}((f+f_0)T)$$ as $T$ goes to $\infty$. That's what I'm not sure how to prove. You say it is straightforward to show...? Thank you! – teeeeee Apr 02 '20 at 08:28
  • When you are doing the integration step, you dropped a sign in the $f+f_0$ term. It turns out to be inconsequential to the final result as it will cancel in the next steps. – Cedron Dawg Apr 02 '20 at 14:16
1

The secret to proving the limit is to not convert the $sin$ to $sinc$. This leaves the $T$ in the argument and not outside. No need to worry about the complex conjugate as the values are real. The $sin$ values are bounded by -1 and 1.

At that point it becomes:

$$ \begin{align} 0 \le S_{xx}(f) &= \lim_{T\rightarrow\infty}\frac{1}{T}\left|X_{T}(f) \right|^2 \\ &= \lim_{T\rightarrow\infty}\frac{1}{T}\left( \frac{ \sin(\pi(f_0-f)T)}{\pi(f_0-f)} + \frac{ \sin(\pi(f_0+f)T)}{\pi(f_0+f)} \right)^2 \left( \frac{A}{2} \right)^2 \\ &\le \lim_{T\rightarrow\infty}\frac{1}{T}\left( \frac{1}{\pi|f_0-f|} + \frac{1}{\pi|f_0+f|} \right)^2 \left( \frac{A}{2} \right)^2 \\ &= \lim_{T\rightarrow\infty}\frac{1}{T}\left( \frac{1}{|f_0-f|} + \frac{1}{|f_0+f|} \right)^2 \left( \frac{A}{2\pi} \right)^2 \\ \end{align} $$

If $f \ne f_0 $ and $f \ne -f_0 $ the limit will be zero. Otherwise, a Dirac delta.

I seem to get an extra $\pi$ compared to what you say the answer should be.

Cedron Dawg
  • 7,560
  • 2
  • 9
  • 24
  • Hmm, I the reason I said the answer should be that is because I know the average power of a cosine wave is $P=A^2/2$ (https://dsp.stackexchange.com/q/64833/38419). Therefore, when we integrate this final power spectral density result over frequency, it should give the correct power. I don't undestand the $\pi$... Does it somehow cancel with the $\pi$ in the sin terms when you take a limit? – teeeeee Apr 02 '20 at 11:48
  • Like $\sin(x)\approx x$ for small $x$? – teeeeee Apr 02 '20 at 11:56
  • 1
    No, I don't think that is it. I don't work with the continuous FT all that much or I would have started you with the (2) evaluation first. Reviewing the math here, I found a small error in the integration which just flips a sign, but that has no impact at the end. I'll look for a little while longer, then Dan B can come in and save the day. – Cedron Dawg Apr 02 '20 at 11:59
  • The difference between your line (2) and line (4) is simply that you have dropped the sin numberators. Are you convinced that you can simply do that? – teeeeee Apr 02 '20 at 12:12
  • Yes, that is the bound coming into play. It makes it the largest possible absolute value inside the big parentheses. When the $sin$ is bounded by 1, the $\pi$ in the numerator is still in the argument so it goes away. – Cedron Dawg Apr 02 '20 at 12:18
  • @teeeeee You are correct in that I did it sloppy, I've included the absolute value bars to make it correct. – Cedron Dawg Apr 02 '20 at 12:25
  • I don't understand - how does that help with the $\pi^2$? – teeeeee Apr 02 '20 at 12:42
  • The expression in your line (2) works correctly - if I integrate this numerically with respect to $f$, then the correct total power is recovered $P=A^2/2$. The issue is with the lines that follow. – teeeeee Apr 02 '20 at 13:01
  • That helps. The proof is to show that any value of $f$ except $f_0$ and $-f_0$ has a zero limit by bounds. When $f$ is one of these values you have to go back to line (2) and replace the $sin$ term with plain old $T$. This is where $\sin(x)\approx x$ comes in. Thus you are then asking what is the limit of $T$ as $T$ approaches infinity which matches the Dirac delta, sloppily speaking. – Cedron Dawg Apr 02 '20 at 13:12
  • I am happy that when $f$ is not $\pm f_0$ the expression is zero in the $T$ to $\infty$ limit. But why replace the sin with $T$ when $f$ is one of the two freqs? – teeeeee Apr 02 '20 at 13:16
  • 1
    $$ \lim_{f\rightarrow f_0} \frac{ \sin(\pi(f_0-f)T)}{\pi(f_0-f)} = \lim_{f\rightarrow f_0} T \frac{ \sin(\pi(f_0-f)T)}{\pi(f_0-f)T} = T $$ – Cedron Dawg Apr 02 '20 at 13:21
  • Okay that's a nice way to see it. So as $f\rightarrow +f_0$ we have $$\textrm{PSD} = \lim_{T\rightarrow\infty} \frac{A^2}{4}\cdot T$$. How to see that is Dirac delta, given that the area under the delta must remain fixed? – teeeeee Apr 02 '20 at 13:36
  • You have to be careful dealing with infinities. That is how Real Analysis came about and why I said "sloppily speaking". If you do a variable replacement of $x = 1/T$ then your expression becomes:

    $$ \textrm{PSD} = \lim_{T\rightarrow\infty} \frac{A^2}{4}\cdot T = \lim_{x\rightarrow 0} \frac{A^2}{4}\cdot \frac{1}{x} $$

    The "value" of the Dirac delta function is $ \lim_{x\rightarrow 0} \frac{1}{x} $. Again, sloppily speaking.

    – Cedron Dawg Apr 02 '20 at 13:56
  • This all makes reasonable sense to me now. Thanks for all your help and patience with my problem - I'm sure you have your own stuff to be doing now! – teeeeee Apr 02 '20 at 13:59
  • You're welcome, and you are right about that, but a distraction doesn't hurt once in a while. – Cedron Dawg Apr 02 '20 at 14:13