# Simplification after sampling an analog signal [closed]

$$80\textrm{ Hz}$$ Sampling rate produces the $$x[n] = 3\cos(5\pi n/4)$$ signal, the original analog signal is $$x(t) = 3\ cos(100\ π t)$$.

This is a solved problem used as an example. In the solution it's also mentioned that the resulting signal can be simplified for $$|f| ≤ 1/2$$ as, $$x[n] = 3 cos(5 π n / 4) = 3 cos[(8 – 3) π n / 4] = 3 cos(2 π n – 3 π n / 4) = 3 cos(3 π n / 4)$$.

I do not understand how $$3cos(2 π n – 3 π n / 4)$$ becomes $$cos(3 π n / 4)$$. I know that $$cos(2πn-3/4πn) = cos(2πn)cos(3/4 πn)+sin(2πn)sin(3/4πn)$$. And $$cos(2π) = 1$$ , $$sin(2π) = 0$$ if it wasn't for the "n" variable then yes i think it would equal $$cos(3 π/ 4)$$.

Why and how does this simplification happen?

• Hm, this reads like homework. What have you tried? In which context is this asked? Hint: It's aliasing, but you probably already know that from the topic of your book chapter or exercise sheet title. – Marcus Müller Jan 16 '17 at 23:06
• It is not homework, I am not a student. This is a solved problem used as an example. This is the solution that is given : The resulting signal can be simplified for |f| ≤ 1/2 as such, x[n] = 3 cos(5 π n / 4) = 3 cos[(8 – 3) π n / 4] = 3 cos(2 π n – 3 π n / 4) = 3 cos(3 π n / 4). I do not understand how 3cos(2 π n – 3 π n / 4) becomes cos(3 π n / 4). I know that cos(2πn-3/4πn) = cos(2πn)cos(3/4 πn)+sin(2πn)sin(3/4πn) And cos(2π) = 1 , sin(2π) = 0 if it wasn't for the "n" variable then yes i think it would equal cos(3 π/ 4). that's all i can think of. Thank you for your reply. – Hadoken Jan 17 '17 at 0:11
• That should be part of the question. Please edit your question to include this, @Hadoken! – Marcus Müller Jan 17 '17 at 10:02

Just for explanation: What you experience here, is aliasing. Look at this code and its output:

Fs = 80 # the sampling frequency
f = 50 # the frequency of the cos wave
t = np.arange(0, .1, 1./Fs)  # the sample times
t2 = np.arange(0, .1, 1./(10*Fs))  # higher sampling frequency illustration purposes

plt.stem(t, np.cos(2*np.pi*f*t), label='sampled points')  # plot sampled values
plt.plot(t2, np.cos(2*np.pi*f*t2), label='50Hz cos wave')
plt.plot(t2, np.cos(2*np.pi*(Fs-f)*t2), label='30Hz cos wave')
plt.legend() What I show is a 50Hz cos wave (blue) and the sampling points when sampling with a frequency of 80Hz (blue dots). I also draw a cos wave with frequency 30Hz on top of the diagram (green).

As you can see, at the sampling points the green and blue line intersect. I.e. when your sampled values do not differ, if you sample a 50Hz or 30Hz wave. This is the aliasing effect: You cannot distinguish between waves that have a different frequency, since the sampling rate $F_s$ is too low. In general, given a sampling frequency $F_s$, waves with frequencie $f$ and $F-f$ create the same sampled values.

• What i understand so far is when i have a discrete signal with $|f| > 1/2$, ($3cos(5πn/4)$) it is an alias of another discrete signal of a lower frequency ($3cos(3πn/4)$) with $|f| ≤ 1/2$. So i always have to simplify my results as much as possible until i get a signal with $|f| ≤ 1/2$. Then i reconstruct my analog signal and see that i get a different signal than the original due to aliasing. Sorry if i am not making sense, i am trying to learn DSP on my own and i am a bit confused at the moment. – Hadoken Jan 17 '17 at 13:42
• The reconstruction of an analog signal from a digital signal (i.e. discrete signal) is ambiguous, i.e. there are several analog signals that create the same sampled values (e.g. $cos(5/4 \pi n)$ and $cos(3/4 \pi n)$ create the same sample values. Note $cos(5/4 \pi n)=cos(2\pi (0.5+0.125) n)$ and $cos(3/4 \pi n)=cos(2*pi*(0.5-0.125) n)$. I.e. an analog cosine with frequency (1/2+x) has the same samples as an analog cosine with frequency (1/2-x). From digital samples you cannot tell, which cosine you recorded. That's why there are aliasing filters that remove all frequencies that are too high. – Maximilian Matthé Jan 17 '17 at 13:49

@Hadoken: Note that $n$ is an integer. So,

$$\cos(2 \pi n) = \cos(2 \pi) = 1,\quad\text{and}\quad\sin(2 \pi n) = sin(2 \pi) = 0.$$ Looking at your comment below the question, it seems that you get the rest.