How to simplify cos^2(kx) using trig identities?

  • Thread starter Thread starter Benabruzzo
  • Start date Start date
  • Tags Tags
    Summation
Benabruzzo
Messages
7
Reaction score
0

Homework Statement


Given
\begin{equation}
x[n]=A\cos(\frac{2\pi n}{M}+\phi)
\end{equation}

Evaluate(average power of a sinusoidal digitally sampled signal) :

\begin{equation}
P_x=\frac{1}{N}\sum_{n=0}^{N-1}{|x[n]|}^2
\end{equation}

Homework Equations


Trig Identities: http://www.sosmath.com/trig/Trig5/trig5/trig5.html

The Attempt at a Solution


Since the problem is evaluating a cos^2 function, it is always positive, so the absolute value is irrelevant, it is mostly solving the title of the post, cos(kx)^2. I have been trying to manipulate trig identities to reduce the cos squared term to some combination of first order sines and cosines, hoping that I could get it into a form where I would have something like:
2 Sin(t/2) Sin(t) = Cos(t/2) - Cos(3t/2)
2 Sin(t/2) Sin(2t) = Cos(3t/2) - Cos(5t/2)
2 Sin(t/2) Sin(3t) = Cos(5t/2) - Cos(7t/2)
2 Sin(t/2) Sin(4t) = Cos(7t/2) - Cos(9t/2)
Where I can eliminate the inner terms to end up with a solution like Cos(t/2) + Cos (2n+1)t/2 etc. No luck so far...
 
Last edited:
Physics news on Phys.org
Hi Benabruzzo! :smile:

Let's find a value for

\sum_{k=0}^n{\cos^2(kx)}

Now, you could start by eliminating those annoying square by applying the identity

\cos^2\alpha=\frac{1+\cos(2\alpha)}{2}

What does that give us?
 
I think I may have accidentally caused some confusion with the title of the thread. Did my tex/mathjax script load properly on your browser? I may want to clarify for what I am looking before going too much further..

(id est, did I fail to type some sort of script bookend to make my equations correctly?)

edit:
I've gotten the formatting now,
given:
\begin{equation}
x[n]=A\cos(\frac{2\pi n}{M}+\phi)
\end{equation}

We sample x[n] N times, (0 to N-1), this completes a full period of the signal. to determine the average power of the wave, we take the sum of the absolute value of the function, square it, and then divide it by the number of samples:
\begin{equation}
P_x=\frac{1}{N}\sum_{n=0}^{N-1}{|x[n]|}^2
\end{equation}

Since the square of a sine/cosine wave is always positive, we can drop the absolute value, and simply sum the function at each timestep, n.

\begin{equation}
P_x=\frac{1}{N}\sum_{n=0}^{N-1}{\cos^2[{\frac{2\pi n}{M}}}]
\end{equation}

In order to simplify the evaluation of the summation, I reduced the form to the following:

\begin{equation}
\sum_{n=0}^{N-1}{\cos^2(kn)}
\end{equation}

It is here that I am stuck. The usual summation of a cosine sums the frequency modifier (stepping k instead of n).

I just don't see the next step for molding the equations to something useful. I see you're trig identity, and it is clearly an option, but it don't see the path I should take.
 
Last edited:


(I didn't mention earlier that M is the period of the sinusoid, and the average power equation sums the sampled terms during one period only, thus M=N)
Here is what I have so far:
\begin{equation}
x[n]=Acos(\frac{2\pi n}{M}+\phi)
\end{equation}
and
\begin{equation}
P_x=\frac{1}{M}\sum_{n=0}^{M-1}{|x[n]|}^2
\end{equation}
\begin{equation}
P_x=\frac{1}{M}\sum_{n=0}^{M-1}{|Acos(\frac{2\pi n}{M}+\phi)|}^2
\end{equation}
Using the double angle formula for cosines:
\begin{equation}
cos(\theta_1\pm\theta_2)=cos(\theta_1)cos(\theta_2)\mp sin(\theta_1)sin(\theta_2)
\end{equation}
And then expanding (because my x[n] is squared), and using alpha=2 pi n/m:
\begin{equation}
|Acos(\alpha+\phi)|^2=|A^2||cos(\alpha)cos(\phi)-sin(\alpha)sin(\phi)|^2
\end{equation}
Ignoring A for now,
\begin{equation}
|cos(\alpha)cos(\phi)-sin(\alpha)sin(\phi)|^2=|cos^2(\alpha)cos^2(\phi)+sin^2(\alpha)sin^2(\phi)-2sin(\alpha)sin(\phi)cos(\alpha)cos(\phi)|
\end{equation}
using sin^2(phi)=(1-cos^2(phi)), then factoring it our, I have a sum with three terms:
\begin{equation}
|A|^2 \frac{1}{M}\sum_{n=0}^{M-1}\cdots
\end{equation}
 
Last edited:
\begin{equation}
(1) \frac{|A|^2}{M}\sum_{n=0}^{M-1}|cos^2(\phi)(cos^2(\alpha)-sin^2(\alpha)|, or\cdots \frac{|A|^2}{M}cos^2(\phi)\sum_{n=0}^{M-1}|(cos^2(\alpha)-sin^2(\alpha)|
\end{equation}
\begin{equation}
(2) \frac{|A|^2}{M}\sum_{n=0}^{M-1}|sin^2(\alpha)|
\end{equation}
and,
\begin{equation}
(3) \frac{|A|^2}{M}\sum_{n=0}^{M-1}|-2sin(\alpha)sin(\phi)cos(\alpha)cos(\phi)|
\end{equation}
Tackling the first term, and using the ueler representation of sine and cosine
\begin{equation}
sin(\theta)=\frac{1}{2j}(e^{j\theta}-e^{-j\theta})
\end{equation}
\begin{equation}
cos(\theta)=\frac{1}{2}(e^{j\theta}+e^{-j\theta})
\end{equation}
\begin{equation}
sin^2(\theta)=\frac{-1}{4}(e^{j\theta}+e^{-j\theta}-2)
\end{equation}
\begin{equation}
cos^2(\theta)=\frac{1}{4}(e^{j\theta}+e^{-j\theta}+2)
\end{equation}
thus,
\begin{equation}
cos^2(\theta)-sin^2(\theta)=\frac{1}{4}(e^{j\theta}+e^{-j\theta}+2)+\frac{1}{4}(e^{j\theta}+e^{-j\theta}-2)
\end{equation}
combining some terms, then reinserting my 2 pi n/M
\begin{equation}
cos^2(\theta)-sin^2(\theta)=\frac{2}{4}(e^{\frac{2j2\pi n}{M}}+e^{-{\frac{2j2\pi n}{M}}})
\end{equation}
This is nearly the form of the sum of the roots of unity, when in the summation form:
\begin{equation}
\frac{|A|^2}{2M}\sum_{n=0}^{M-1}|e^{\frac{2j2\pi n}{M}}+e^{-{\frac{2j2\pi n}{M}}}|
\end{equation}
Knowing that e^ j pi is negative 1, regardless of the powers of 4 n/M, each e term will be plum-minus 1, and the absolute value of their sum, is 2, therefor the evaulation of this summation is 2M (the limits of summation are zero to M-1), thus the first term always equals:
\begin{equation}
\frac{|A|^2}{2M}cos^2(\phi)2 M = |A|^2cos^2(\phi)
\end{equation}
 
I'm not 100% sure that I have done this part correctly, my result is a two-case answer, where the period, M, is either and even or odd integer,
\begin{equation}
(2) \frac{|A|^2}{M}\sum_{n=0}^{M-1}|sin^2(\alpha)|
\end{equation}
The next term is somewhat simplified, since I already know what sin^2(theta) is:
\begin{equation}
sin^2(\theta)=\frac{-1}{4}(e^{j\theta}+e^{-j\theta}-2)
\end{equation}
\begin{equation}
\frac{|A|^2}{M}\sum_{n=0}^{M-1}|\frac{-1}{4}(e^{{\frac{2j2\pi n}{M}}}+e^{-{\frac{2j2\pi n}{M}}}-2)|
\end{equation}
or,
\begin{equation}
\frac{|A|^2}{M}\sum_{n=0}^{M-1}|\frac{1}{2}-\frac{-1}{4}(e^{{\frac{2j2\pi n}{M}}}+e^{-{\frac{2j2\pi n}{M}}})|
\end{equation}
using the same principle of e ^j pi = -1
\begin{equation}
\frac{|A|^2}{M}\sum_{n=0}^{M-1}|\frac{1}{2}-\frac{-1}{4}((-1)^{\frac{4n}{M}}+(-1)^{-\frac{4n}{M}})|
\end{equation}
Now, the terms inside the parenthesis are always a sum of plusminus 1, so the summation reduces to
\begin{equation}
\frac{|A|^2}{M}\sum_{n=0}^{M-1}|\frac{1}{2}-\frac{-1}{4} (\pm2)
\end{equation}
For M odd:
\begin{equation}
\sum_{n=0}^{M-1} = \frac{|A|^2}{M}(0) = 0
\end{equation}
For M even:
\begin{equation}
\sum_{n=0}^{M-1} = \frac{|A|^2}{M}(M/2) = \frac{|A|^2}{2}
\end{equation}
 
Done similarly,
\begin{equation}
(3) \frac{|A|^2}{M}\sum_{n=0}^{M-1}|-2sin(\alpha)sin(\phi)cos(\alpha)cos(\phi)|
\end{equation}
\begin{equation}
\frac{|A|^2}{M}sin(\phi)cos(\phi)\sum_{n=0}^{M-1}|-2sin(\alpha)cos(\alpha)|
\end{equation}
using the same polar defintiions of sine and cosine:
\begin{equation}
sin(\theta)cos(\theta)=\frac{1}{2j}(e^{j\theta}-e^{-j\theta})\frac{1}{2}(e^{j\theta}+e^{-j\theta})
\end{equation}
\begin{equation}
sin(\theta)cos(\theta)=\frac{1}{4j}(e^{j\theta}-e^{-j\theta})(e^{j\theta}+e^{-j\theta})
\end{equation}
This has no real parts, thus the absolute value of it is zero.
\begin{equation}
\frac{|A|^2}{M}sin(\phi)cos(\phi)\sum_{n=0}^{M-1}|\frac{1}{4j}(e^{j\theta}-e^{-j\theta})(e^{j\theta}+e^{-j\theta})|=0
\end{equation}
 
My final answer is then:

for M odd
\begin{equation}
P_x=\frac{1}{M}\sum_{n=0}^{M-1}{|Acos(\frac{2\pi n}{M}+\phi)|}^2=|A|^2cos^2(\phi)
\end{equation}

for M even
\begin{equation}
P_x=\frac{1}{M}\sum_{n=0}^{M-1}{|Acos(\frac{2\pi n}{M}+\phi)|}^2=|A|^2cos^2(\phi)+\frac{|A|^2}{2}
\end{equation}

Does this look correct/can fou find any errors?
 
Back
Top