# confusions regarding periodicity?

I have a sequence $$x[n]=\sin(\pi n+2)+\cos(2n/3 +1)$$ I want to find its period and I have also attached my working I have two confusions

1. Is there any effect of the constant term on period? constant"2"in bracket of sine and constant "1"in bracket of cos?

2)If period of sine term is a rational number,as shown in attached snapshot but period of cos term is irrational, what will be the overall period of composite signal x[n]? • The sum is not a periodic signal benches the second term is not periodic; only the first term is periodic. Mar 3 at 15:42

You need to work this from first principles. Strictly speaking, some $$x[n]$$ is periodic if, for some $$N$$, $$x[n] = x[n + N]$$ for all values of $$n$$. A looser definition would allow for "fractional $$n$$", i.e. someone might say that $$x[n] = \cos n$$ has a period over $$N = 2\pi$$ -- this would be correct and useful for some problems, and useless for others. If I were being strict, I'd say "quasi-periodic".

Since sine waves are periodic, periodicity of a sum of sines is easy to spot. Let $$x[n] = \cos \theta_1 n + \phi_1 + \cos \theta_2 n + \phi_2$$.

The first thing to note is that -- because the sine wave is periodic -- the $$\phi_k$$ don't matter. They're just phase shifts, but they don't change the period.

The second thing to note is that, in general, the first sine wave has a period of $$2\pi\theta_1$$, and the second has a period of $$2\pi\theta_2$$. So the overall $$x[n]$$ must repeat at the moment when both $$\cos \theta_1 n + \phi_1$$ and $$\cos \theta_2 n + \phi_2$$ repeat.

So does, and if so when does, it happen? (pause here and answer this yourself, if you can).

If you write out the problem as $$x[n] = x[n + N]$$ and solve for $$N$$, you'll be ahead, because you're out of wacky engineering and into high-school trigonometry. With DSP, you should always look for opportunities to reduce the problem to high-school math. They abound, and you can unconfuse yourself (at the cost of a lot of pencil lead) by doing so. Let

$$\cos \theta_1 n + \phi_1 + \cos \theta_2 n + \phi_2 = \cos \theta_1 (n + N) + \phi_1 + \cos \theta_2 (n + N) + \phi_2$$

Because this involves two distinct sine waves, you can separate the problem into two:

$$\cos \theta_1 n + \phi_1 = \cos \theta_1 (n + N) + \phi_1$$ $$\cos \theta_2 n + \phi_2 = \cos \theta_2 (n + N) + \phi_2$$

By inspection, the first is periodic if $$\theta_1 = 2 \pi \frac{p_1}{q_1}$$ -- because unless $$\theta_1$$ is a rational factor of $$\pi$$ then the phase will never return to exactly the same as it was. By the same token, $$\theta_2 = 2 \pi \frac{p_2}{q_2}$$.

To find the perodicity of the overall function, just find $$N$$ where $$\theta_1 (n + N) = \theta_2 (n + N) + 2 \pi k$$. Substitute in $$\theta_1 = 2 \pi \frac{p_1}{q_1}$$ and $$\theta_2 = 2 \pi \frac{p_2}{q_2}$$, and do the math.

• With DSP, you should always look for opportunities to reduce the problem to high-school math what..? ;-) Mar 3 at 16:24