(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:HW4ECE$38F13]]
+
[[Category:HW4ECE438F14]]
  
=Homework 4, [[ECE438]], Fall 2014, [[user:mboutin|Prof. Boutin]]=
+
=[[HW4ECE438F14|Homework 4]] Solution, [[2014_Fall_ECE_438_Boutin| ECE438 Fall 2014]], [[user:mboutin|Prof. Boutin]]=
  
 
----
 
----
==Question 1==
+
==Question 1 ==
 +
'''Conversion between analog and digital frequencies'''
 +
 
 
To prevent aliasing, the sampling rate should be higher or equal to twice of the highest frequency of the signal.
 
To prevent aliasing, the sampling rate should be higher or equal to twice of the highest frequency of the signal.
  
Line 13: Line 15:
 
So the sampling frequency should be greater than 5000Hz.
 
So the sampling frequency should be greater than 5000Hz.
  
We need a high pass filter that filters our everything below 60 Hz.  
+
We need a high pass filter that filters out signals below the frequency 60Hz.  
  
 
<math>\begin{align}
 
<math>\begin{align}
Line 19: Line 21:
 
\end{align}</math>
 
\end{align}</math>
  
[[Image: Hw6_1.jpg|900x320px]]  
+
[[Image: Hw6_1.jpg|700x250px]]  
  
 
==Question 2==
 
==Question 2==
 +
'''Conversion between analog and digital frequencies'''
  
 
We can think of the long term trend as low frequency component and annual cycle as high frequency component. In order to remove the annual cycle, we need a low pass filter.
 
We can think of the long term trend as low frequency component and annual cycle as high frequency component. In order to remove the annual cycle, we need a low pass filter.
 
The sampling rate <math>f_s=12</math>samples/year. The periodic component has frequency of <math>f_c=1</math>cycle/year.  
 
The sampling rate <math>f_s=12</math>samples/year. The periodic component has frequency of <math>f_c=1</math>cycle/year.  
  
\\
+
The cutoff frequency of the ideal LPF is
So the low pass filter has cutoff frequency of <math>\omega_c=\frac{2\pi \cdot 1}{12}=\frac{\pi}{6}</math>
+
 
 +
<math>\omega_c=\frac{2\pi \cdot 1}{12}=\frac{\pi}{6}</math>
 +
 
  
 
==Question 3==
 
==Question 3==
 +
'''Downsampling and upsampling'''
 +
 
<math>\text{a)} \;\; \text{General Relation for the decimation with a factor of } D \,\!</math>.
 
<math>\text{a)} \;\; \text{General Relation for the decimation with a factor of } D \,\!</math>.
  
Line 37: Line 44:
 
Y(w) &= \sum_{n=-\infty}^{\infty} y[n]e^{-jwn} = \sum_{n=-\infty}^{\infty} x[Dn]e^{-jwn} \\
 
Y(w) &= \sum_{n=-\infty}^{\infty} y[n]e^{-jwn} = \sum_{n=-\infty}^{\infty} x[Dn]e^{-jwn} \\
 
&= \sum_{m=-\infty, m=Dk}^{\infty} x[m]e^{-j\frac{wm}{D}} = \sum_{m=-\infty}^{\infty} x[m] \left( \sum_{k=-\infty}^{\infty} \delta[m-Dk] \right) e^{-j\frac{wm}{D}} \\
 
&= \sum_{m=-\infty, m=Dk}^{\infty} x[m]e^{-j\frac{wm}{D}} = \sum_{m=-\infty}^{\infty} x[m] \left( \sum_{k=-\infty}^{\infty} \delta[m-Dk] \right) e^{-j\frac{wm}{D}} \\
&= \sum_{m=-\infty}^{\infty} x[m] \left( \frac{1}{D} \sum_{k=0}^{D-1} e^{j\frac{2\pi}{D}km} \right) e^{-j\frac{wm}{D}} = \sum_{k=0}^{D-1} \frac{1}{D} \sum_{m=-\infty}^{\infty} x[m]e^{j\left(w-\frac{2\pi}{D}k\right)m} \\
+
&= \sum_{m=-\infty}^{\infty} x[m] \left( \frac{1}{D} \sum_{k=0}^{D-1} e^{j\frac{2\pi}{D}km} \right) e^{-j\frac{wm}{D}} = \sum_{k=0}^{D-1} \frac{1}{D} \sum_{m=-\infty}^{\infty} x[m]e^{j\left(\frac{w}{D}-\frac{2\pi}{D}k\right)m} \\
 
&= \sum_{k=0}^{D-1} \frac{1}{D} X\left(\frac{w-2\pi k}{D}\right) \\
 
&= \sum_{k=0}^{D-1} \frac{1}{D} X\left(\frac{w-2\pi k}{D}\right) \\
 
\end{align}</math>
 
\end{align}</math>
  
Replacing D with 5 would be the answer.
+
Replacing D with 4 would be the answer.
  
  
Line 55: Line 62:
 
Since <math>X(w)</math> is periodic with <math>2\pi</math>, <math>Z(w)=X(Lw)</math> is periodic with <math>2\pi/L</math>.
 
Since <math>X(w)</math> is periodic with <math>2\pi</math>, <math>Z(w)=X(Lw)</math> is periodic with <math>2\pi/L</math>.
  
Replaing L with 5 would be the answer.
+
Replaing L with 4 would be the answer.
 +
 
  
 
==Question 4==
 
==Question 4==
 +
'''Downsampling and upsampling'''
  
a) For <math>k=0,1,...,N-1</math>
+
Let x1[n] = x(Tn) be a sampling of a CT signal x(t). Let D be a positive integer.
  
<math>\begin{align}
+
a) Under what circumstances is the downsampling xD[n] = x1[Dn] equivalent to a resampling of the signal with a new period equal to DT (i.e. xD[n] = x(DTn))?
X_N(k) &= \sum_{k=0}^{N-1}x[n]e^{-\frac{j2\pi nk}{N}} \\
+
&= x[0]e^{-\frac{j2\pi 0\cdot k}{N}} \\
+
&= 1
+
\end{align}</math>
+
  
<math>
+
'''Solution'''
X_N(k)  </math> is periodic with N
+
  
*<span style="color:red">Instructor's comments: How about the other values of k? -pm </span>
+
<math>x_D[n]=x_1[Dn]=x(DnT)</math>
b) Using Euler Formula, we have
+
  
<math>\begin{align}
+
This is true for any integer D.
x[n] &= e^{\frac{j\pi n}{3}}(\frac{ e^{\frac{j\pi n}{6}} + e^{-\frac{j\pi n}{6}} }{2}) \\
+
&= \frac{1}{2}e^{\frac{j\pi n}{2}} + \frac{1}{2}e^{\frac{j\pi n}{6}}
+
\end{align}</math>
+
  
Observing that <math>x[n]</math> has fundamental period <math>N=12</math>. Using IDFT, we have
+
b) Under what circumstances is it possible to construct the sampling <math>x_3[n]= x(\frac{T}{D} n) </math> directly from <math>x_1[n]</math> (without reconstructing x(t))?
  
<math>\begin{align}
+
'''Solution'''
x[n] &= \frac{1}{N}\sum_{n=0}^{N-1}e^{\frac{j2\pi nk}{N}} \\
+
\frac{1}{2}e^{\frac{j\pi n}{2}} + \frac{1}{2}e^{\frac{j\pi n}{6}} &= \frac{1}{12}\sum_{n=0}^{11}e^{\frac{j2\pi nk}{12}}
+
\end{align}</math>
+
  
By comparison, we know for <math>k=0,1,...,11</math>
+
It is always possible.
  
<math class="inline">
 
X_{12}[k] = \left\{
 
\begin{array}{ll}
 
6, & k=1,3 \\
 
0, & otherwise.
 
\end{array}
 
\right.
 
</math>
 
 
<math class="inline">
 
X_{12}[k]  </math>  is periodic with 12.
 
 
*<span style="color:red">Instructor's comments: How about k=12, k=13, and all the other values of k? -pm </span>
 
 
c)
 
 
<math>x[n]=(\frac{1}{\sqrt 2} + j\frac{1}{\sqrt 2})^n = (e^{\frac{j\pi}{4}})^n</math>
 
 
Then <math>x[n]</math> has fundamental period <math>N=8</math>. Using IDFT, we have
 
 
<math>\begin{align}
 
x[n] &= \frac{1}{N}\sum_{n=0}^{N-1}e^{\frac{j2\pi nk}{N}} \\
 
e^{\frac{j\pi n}{4}} &= \frac{1}{8}\sum_{n=0}^{7}e^{\frac{j2\pi nk}{8}}
 
\end{align}</math>
 
 
By comparison, we know for <math>k=0,1,...,7</math>
 
 
<math class="inline">
 
X_{8}[k] = \left\{
 
\begin{array}{ll}
 
8, & k=1 \\
 
0, & otherwise.
 
\end{array}
 
\right.
 
</math>
 
 
<math class="inline">
 
X_{8}[k]  </math>  is periodic with 8.
 
 
*<span style="color:red">Instructor's comments: Don't forget to say that K[k} repeats periodically with period 8. THat way, all values of k are covered. -pm </span>
 
==Question 5==
 
 
Observing that <math>X(k)</math> has a fundamental period <math>N=4</math>
 
 
<math>\begin{align}
 
x[n] &= \frac{1}{N}\sum_{k=0}^{N-1}(e^{j \pi k }+e^{-j \frac{\pi}{2} k})e^{\frac{j2\pi nk}{N}} \\
 
&= \frac{1}{4}\sum_{k=0}^{3}(e^{\frac{j2\pi (n+2)k}{4}} + e^{\frac{j2\pi (n-1)k}{4}}) \\
 
&= \frac{1}{4}\sum_{k=0}^{3}(e^{\frac{j2\pi (n+2)k}{4}-j2\pi k} + e^{\frac{j2\pi (n-1)k}{4}}) \\
 
&= \frac{1}{4}\sum_{k=0}^{3}(e^{\frac{j2\pi (n-2)k}{4}} + e^{\frac{j2\pi (n-1)k}{4}}) \\
 
\end{align}</math>
 
 
when <math>n\neq 1 \text{ or } 2</math>, using geometric series summation formula we have
 
 
<math>x[n]=\frac{1}{4}( \frac{1-e^{j2\pi (n-2)}}{1-e^{\frac{j2\pi (n-2)}{4}}} + \frac{1-e^{j2\pi (n-1)}}{1-e^{\frac{j2\pi (n-1)}{4}}} ) = 0</math>
 
 
when <math>n=1 \text{ or } 2</math>
 
 
<math>x[n]=\sum_{k=0}^{3}1=4</math>
 
 
<math>x[n]</math> will be periodic with 4.
 
 
NOTE: In general, <math>X(k)</math> does not need to have a length equal to the fundamental period. Suppose N is an arbitrary number, we can still derive the IDFT using argument that is similar to the one described above.
 
  
 
----
 
----
 
[[ HW6ECE$38F13|Back to HW6ECE$38F13]]
 

Latest revision as of 05:24, 10 October 2014


Homework 4 Solution, ECE438 Fall 2014, Prof. Boutin


Question 1

Conversion between analog and digital frequencies

To prevent aliasing, the sampling rate should be higher or equal to twice of the highest frequency of the signal.

$ \begin{align} f_s=2 \cdot 2500=5000Hz \end{align} $

So the sampling frequency should be greater than 5000Hz.

We need a high pass filter that filters out signals below the frequency 60Hz.

$ \begin{align} \omega_c=\frac{2\pi \cdot f_c }{f_s}=\frac{2\pi \cdot 60 }{5000} \end{align} $

Hw6 1.jpg

Question 2

Conversion between analog and digital frequencies

We can think of the long term trend as low frequency component and annual cycle as high frequency component. In order to remove the annual cycle, we need a low pass filter. The sampling rate $ f_s=12 $samples/year. The periodic component has frequency of $ f_c=1 $cycle/year.

The cutoff frequency of the ideal LPF is

$ \omega_c=\frac{2\pi \cdot 1}{12}=\frac{\pi}{6} $


Question 3

Downsampling and upsampling

$ \text{a)} \;\; \text{General Relation for the decimation with a factor of } D \,\! $.

$ \text{Let } X(w) = \mathcal{F}(x[n]) $

$ \begin{align} Y(w) &= \sum_{n=-\infty}^{\infty} y[n]e^{-jwn} = \sum_{n=-\infty}^{\infty} x[Dn]e^{-jwn} \\ &= \sum_{m=-\infty, m=Dk}^{\infty} x[m]e^{-j\frac{wm}{D}} = \sum_{m=-\infty}^{\infty} x[m] \left( \sum_{k=-\infty}^{\infty} \delta[m-Dk] \right) e^{-j\frac{wm}{D}} \\ &= \sum_{m=-\infty}^{\infty} x[m] \left( \frac{1}{D} \sum_{k=0}^{D-1} e^{j\frac{2\pi}{D}km} \right) e^{-j\frac{wm}{D}} = \sum_{k=0}^{D-1} \frac{1}{D} \sum_{m=-\infty}^{\infty} x[m]e^{j\left(\frac{w}{D}-\frac{2\pi}{D}k\right)m} \\ &= \sum_{k=0}^{D-1} \frac{1}{D} X\left(\frac{w-2\pi k}{D}\right) \\ \end{align} $

Replacing D with 4 would be the answer.


$ \text{b)} \;\; \text{General Relation for the upsampling with a factor of } L \,\! $.

$ \begin{align} Z(w) &= \sum_{n=-\infty}^{\infty} z[n]e^{-jwn} \\ &= \sum_{n=-\infty}^{\infty} \left( \sum_{k=-\infty}^{\infty} x[k] \delta[n-kL] \right) e^{-jwn} \\ &= \sum_{k=-\infty}^{\infty} x[k] \sum_{n=-\infty}^{\infty} \delta[n-kL] e^{-jwn} = \sum_{k=-\infty}^{\infty} x[k] e^{-jwkL} \\ &= \sum_{k=-\infty}^{\infty} x[k] e^{-jLwk} = X(Lw) \\ &\end{align} $

Since $ X(w) $ is periodic with $ 2\pi $, $ Z(w)=X(Lw) $ is periodic with $ 2\pi/L $.

Replaing L with 4 would be the answer.


Question 4

Downsampling and upsampling

Let x1[n] = x(Tn) be a sampling of a CT signal x(t). Let D be a positive integer.

a) Under what circumstances is the downsampling xD[n] = x1[Dn] equivalent to a resampling of the signal with a new period equal to DT (i.e. xD[n] = x(DTn))?

Solution

$ x_D[n]=x_1[Dn]=x(DnT) $

This is true for any integer D.

b) Under what circumstances is it possible to construct the sampling $ x_3[n]= x(\frac{T}{D} n) $ directly from $ x_1[n] $ (without reconstructing x(t))?

Solution

It is always possible.



Alumni Liaison

BSEE 2004, current Ph.D. student researching signal and image processing.

Landis Huffman