(68 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:slecture]]
+
<br>
[[Category:ECE438Fall2014Boutin]]
+
<center>
[[Category:ECE]]
+
<font size="4">Downsampling </font>
[[Category:ECE438]]
+
[[Category:signal processing]] 
+
  
<center><font size= 4>
+
A [https://www.projectrhea.org/learning/slectures.php slecture] by [[ECE]] student Yerkebulan Yeshmukhanbetov
Downsampling
+
</font size>
+
  
A [https://www.projectrhea.org/learning/slectures.php slecture] by [[ECE]] student Yerkebulan Yeshmukhanbetov
+
Partly based on the [[2014 Fall ECE 438 Boutin|ECE438 Fall 2014 lecture]] material of [[User:Mboutin|Prof. Mireille Boutin]].
 +
</center>
 +
----
 +
----
 +
<br>
  
Partly based on the [[2014_Fall_ECE_438_Boutin|ECE438 Fall 2014 lecture]] material of [[user:mboutin|Prof. Mireille Boutin]].
+
== <font size="3"></font><font size="3"></font>Outline  ==
</center>
+
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3">
 +
#Introduction
 +
#Definition of Downsampling<br>
 +
#Derivation of DTFT&nbsp;of downsampled signal<br>
 +
#Example
 +
#Decimator
 +
#Conclusion<br>
  
 
----
 
----
<font size = 3>
+
 
==Outline==
+
== Introduction  ==
#Introduction
+
 
#Proof
+
This slecture provides definition of downsampling, derives DTFT of&nbsp; downsampled signal and demonstrates it in a frequency domain. Also, it explains process of decimation and why it needs a low-pass filter.
#Example
+
#Conclusion
+
#References
+
  
 
----
 
----
  
==Introduction==
+
== Definition of Downsampling<br>  ==
  
This slecture explains definition of downsampling and demonstrates downsampled signal in frequency domain. Also,  
+
Downsampling is an operation which involves throwing away samples from discrete-time signal. Let&nbsp; ''x[n]'' be a digital-time signal shown below: <br>
it explains process of decimation and why it needs a low-pass filter.  
+
 
 +
[[Image:Xofn.jpg]]<br>
 +
 
 +
&nbsp;then y[n] will be produced by downsampling ''x [n]''&nbsp; by factor ''D'' = 3. So, ''y [n] = x[Dn]''.
 +
 
 +
[[Image:Yofn.jpg]]<br>
 +
 
 +
As seen in above graph, ''y [n]'' is obtained by throwing away some samples from x [n]. So, ''y [n]'' is a downsampled signal from
 +
 
 +
''x [n]''.<br>
  
 
----
 
----
  
==Proof==
+
== Derivation of DTFT&nbsp;of downsampled signal  ==
  
Let the ideal sampling <math> x_s(t) \text{ of } x(t) </math> be defined as
+
Let ''x (t) ''be a continuous tim''e ''signal. Then ''x<sub>1</sub> [n] = x (T<sub>1</sub>n) ''and''&nbsp; x<sub>2</sub> [n] = x (T<sub>2</sub>n)''. And ratio of sampling periods would be
+
<math> x_s(t) := x(t)p_{\frac{1}{f_s}}(t) </math>,
+
  
where
+
D = T<sub>2</sub>/T<sub>1</sub>, &nbsp; which is an integer greater than 1. From these equations we obtain realtionship between ''x<sub>1</sub> [n]'' and ''x<sub>2</sub> [n]''. <br>
  
<math> p_{\frac{1}{f_s}}(t) = \sum_{k = -\infty}^\infty \delta(t-\frac{k}{f_s}) </math>.
+
<math>\begin{align}  
 +
x_2 [n] = x(T_2 n) = x(DT_1 n) = x_1 [nD]
 +
\end{align}</math>  
  
Nyquist Theorem: A signal <math> x(t) </math> that has the property <math> X(f) = 0 </math> for  <math> |f| \ge f_M </math>
+
Below we derive Discrete-Time Fourier Transform of ''x<sub>2</sub> [n]'' in terms of DTFT of ''x<sub>1</sub> [n]''.  
can be perfectly reconstructed from its sampling <math> x_s(t) </math> if sampled at a rate <math> f_s > 2f_M </math>.
+
  
To prove that perfect reconstruction is possible, we must find an expression for <math> x(t) </math> in terms of <math> x_s(t) </math>.
+
<br>  
  
Given that <math> \mathcal{F}(x(t)) = X(f) </math>, we can find <math> X_s(f) </math> using the convolution property.
+
<math>\begin{align}
 +
&\mathcal{X}_2(\omega)= \mathcal{F}(x_2 [n]) = \mathcal{F}(x_1 [Dn])\\
 +
&=  \sum_{n = -\infty}^\infty x_1[Dn] e^{-j \omega n} =  \sum_{m = -\infty}^\infty x_1[m] e^{-j \omega {\frac{m}{D}}}\\
 +
&=  \sum_{n = -\infty}^\infty s_D[m]* x_1 [m] e^{-j \omega {\frac{m}{D}}}\\
 +
\end{align}</math>  
  
<div style="margin-left: 3em;">
+
<br>  
<math>
+
\begin{align}
+
X_s(f) &= X(f)*\mathcal{F}(p_{\frac{1}{f_s}})\\
+
&= X(f)*\mathcal{F}(\sum_{k = -\infty}^\infty \delta(t-\frac{k}{f_s}))\\
+
&= X(f)*f_s\sum_{k = -\infty}^\infty \delta(f-kf_s)\\
+
&= f_s\sum_{k = -\infty}^\infty X(f)*\delta(t-\frac{k}{f_s})\\
+
&= f_s\sum_{k = -\infty}^\infty X(f-kf_s)\\
+
\end{align}
+
</math>
+
</div>
+
  
Without loss of generality, we can assume that the signal <math> x(t) </math> has the spectrum shown in the figure below. The shape of the graph of <math> X(f) </math> does not matter because the only important feature of <math> X(f) </math> is that <math> X(f) = 0 </math> for <math> |f| \ge f_M </math>.
+
where <br>  
  
[[Image:X1.png]]
+
<math>s_D [m]=\left\{ \begin{array}{ll}
 +
1,& \text{ if } n \text{ is a multiple of } D,\\
 +
0, & \text{ else}.  
 +
\end{array}\right. = {\frac{1}{D}} \sum_{k = -\infty}^{D-1} e^{jk {\frac{2 \pi}{D} m}}</math>
  
We would like to determine what <math> X_s(f) </math> looks like in order to find a way to reconstruct <math> x(t) </math>.
+
<br>  
  
Since we have sampled at a rate <math> f_s > 2f_M </math>, the following inequalities hold:
+
<math>\begin{align}
 +
&\mathcal{X}_2(\omega)= \sum_{m = -\infty}^\infty {\frac{1}{D}} \sum_{k = -\infty}^{D-1} e^{jk {\frac{2 \pi}{D} m}}  x_1[m] e^{-j \omega {\frac{m}{D}}}\\
 +
&= {\frac{1}{D}} \sum_{k = -\infty}^{D-1} \sum_{m = -\infty}^\infty  x_1[m] e^{-jm ({\frac{\omega - 2 \pi k}{D}})} =  \\
 +
&=  {\frac{1}{D}} \sum_{k = -\infty}^{D-1} \mathcal{X}_1 ({\frac{\omega - 2 \pi k}{D}}) \\
 +
\end{align}</math>  
  
<math> f_s > 2f_M \iff f_s - f_M > f_M \iff -f_s + f_M < f_M </math>.
+
----
  
Together, these inequalities, the graph of <math> X(f) </math>, and the expression for <math> X_s(f) </math> in terms of <math> X(f) </math> imply that <math> X_s(f) </math> will have the spectrum shown in the figure below.
+
== Example<br> ==
  
[[Image:Xs1.png]]
+
<br>
  
Notice that the spectrum of the ideal sampling of a signal is an amplitude scaled periodic repetition of the original spectrum. Since <math> x(t) </math> is bandlimited and we have sampled at a rate <math> f_s > 2f_M </math>, the periodic repetitions of <math> X(f) </math> do not overlap.  
+
Let's take a look&nbsp; at&nbsp; an original signal ''X<sub>1</sub> (w)'' and&nbsp;&nbsp;''X<sub>2</sub> (w)'' which is obtained after downsampling X<sub>1</sub>(w) by factor D = 2 in a frequency domain.  
  
All the information needed to reconstruct <math> X(f) </math> can be found in the portion of <math> X_s(f) </math> that corresponds to <math> X(f) </math> (shown in red). Therefore we can use a simple lowpass filter with gain <math> \tfrac{1}{f_s} </math> and cutoff frequency <math> \tfrac{f_s}{2} </math> to recover <math> X(f) </math> from <math> X_s(f) </math>.
+
[[Image:Downsamplegraph.jpg]]<br>  
  
 +
<br>
  
<math class="inline">
+
From two graphs it is seen that signal is stretched by D&nbsp; in frequency domain and&nbsp; decreased by D in a magnitude after downsampling. Both signals have the frequency of&nbsp;<math>\begin{align}  
X(f) = X_s(f)\left\{
+
2\pi
\begin{array}{ll}
+
\end{align}</math> .
\frac{1}{f_s}, & |f| \le \frac{f_s}{2}\\
+
0, & \text{else}
+
\end{array}
+
\right. </math>
+
  
<math> \iff x(t) = x_s(t)*\text{sinc}(f_st) </math>
+
== Decimator  ==
  
<math> \therefore </math> We can perfectly reconstruct <math> x(t) </math> from <math> x_s(t) </math>.
+
As seen in second graph, if&nbsp;<math>\begin{align}
 +
D2\pi T_1f_{max}
 +
\end{align}</math> is greater than <math>\begin{align}
 +
\pi
 +
\end{align}</math> aliasing occurs. Downsampler is a part of a decimator which also has a low-pass filter to&nbsp; prevent aliasing.&nbsp; LPF eliminates signal components which has&nbsp; frequencies higher than cutoff frequency, which can be found from graphs shown above.<br>
 +
 
 +
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <math>\begin{align}
 +
& D\omega_c = D 2 \pi T_1 f_{max} < \pi\\
 +
& {\frac{T_2}{T_1}} 2\pi T_1 f_{max} < \pi \\
 +
&  2\pi T_2f_{max} < \pi \\
 +
&f_{max} < {\frac{1}{2T_2}}
 +
\end{align}</math>  
 +
 
 +
Thereby, signal needs to be filtered before downsampling if f<sub>max</sub> &gt; 1/(2T<sub>2</sub>) . Complete block diagram of a decimator is shown below:<br>
 +
 
 +
<br>
 +
 
 +
[[Image:Decimator cutoff.jpg]]
 +
 
 +
<br>
 +
 
 +
<br>
  
 
----
 
----
  
==Example==
+
== Conclusion  ==
 +
</font>
  
Though the Nyquist theorem states that perfect reconstruction is possible if we satisfy the Nyquist condition <math> (f_s > 2f_M) </math>, it is important to note that this condition is not necessary. The following example demonstrates how perfect reconstruction is sometimes possible even when undersampling.
+
<font size="3"></font>  
  
Let the signal <math> x(t) </math> have a spectrum <math> X(f) </math> as seen in the figure below.
+
<font size="3"></font>  
  
[[Image:X2.png]]
+
<font size="3"></font>
  
The Nyquist condition states that we should sample at a rate <math> f_s > 2(2a) = 4a </math>. Instead, let us sample at <math> f_s = 2a </math>.
+
<font size="3"></font>  
  
As before, we have <math> x_s(t) = x(t)p_{\frac{1}{f_s}}(t) </math> and <math> X_s(f) = f_s\sum_{k = -\infty}^\infty X(f-kf_s) </math>
+
<font size="3"></font>  
  
<math> \implies X_s(f) = 2a\sum_{k = -\infty}^\infty X(f-2ka) </math>.
+
<font size="3"></font>  
  
Therefore, <math> X_s(f) </math> will have the spectrum shown in the figure below.
+
<font size="3"></font>  
  
[[Image:Xs2.png]]
+
<font size="3"></font>
  
Notice that there is no aliasing in <math> X_s(f) </math> even though <math> f_s < 4a </math>. In addition, the portion of <math> X_s(f) </math> that corresponds to <math> X(f) </math> (shown in red) can be recovered using a bandpass filter with gain <math> \tfrac{1}{2a} </math> and cutoff frequencies <math> a \text{ and } 2a </math>.
+
<font size="3"></font>  
  
----
+
<font size="3"></font>
  
==Conclusion==
+
<font size="3"></font>
  
To summarize, the Nyquist theorem states that any bandlimited signal can be perfectly reconstructed from its sampling if sampled at a rate greater than twice its bandwidth <math> (f_s > 2f_M) </math>. However, the Nyquist condition is not necessary for perfect reconstruction as shown in the example above.
+
<font size="3"></font>  
  
</font size>
+
<font size="3"></font>  
  
----
+
<font size="3"></font>
  
==References==
+
<font size="3"></font>
  
[1] John G. Proakis, Dimitris G. Manolakis, "Digital Signal Processing with Principles, Algorithms, and Applications" 4th Edition,2006
+
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3"></font>
 +
 
 +
<font size="3">To summarize, downsampling is a process of removing samples from signal. After downsampling,&nbsp; signal decreases by factor D in the magnitude and stretches by D in frequency domain.&nbsp; In order to downsample a signal, it first should be filtered by LPF to prevent aliasing.&nbsp; Both LPF and downsampler are parts of a decimator. </font>
 +
 
 +
<font size="3"></font>
  
 
----
 
----
 +
 +
<br>
 +
 
----
 
----
 +
 
----
 
----
  
==[[Nyquist_Miguel_Castellanos_ECE438_slecture_review|Questions and comments]]==
+
----
 +
 
 +
== [[Yeshmukhanbetov ECE438 slecture review|Questions and comments]] ==
 +
 
 +
If you have any questions, comments, etc. please post them on [[Yeshmukhanbetov ECE438 slecture review|this page]].
  
If you have any questions, comments, etc. please post them on [[Nyquist_Miguel_Castellanos_ECE438_slecture_review|this page]].
 
 
----
 
----
[[2014_Fall_ECE_438_Boutin|Back to ECE438, Fall 2014]]
+
[[2014_Fall_ECE_438_Boutin_digital_signal_processing_slectures|Back to ECE438 slectures, Fall 2014]]
 +
 
 +
[[Category:Slecture]] [[Category:ECE438Fall2014Boutin]] [[Category:ECE]] [[Category:ECE438]] [[Category:Signal_processing]]

Latest revision as of 18:07, 16 March 2015


Downsampling

A slecture by ECE student Yerkebulan Yeshmukhanbetov

Partly based on the ECE438 Fall 2014 lecture material of Prof. Mireille Boutin.




Outline

  1. Introduction
  2. Definition of Downsampling
  3. Derivation of DTFT of downsampled signal
  4. Example
  5. Decimator
  6. Conclusion

Introduction

This slecture provides definition of downsampling, derives DTFT of  downsampled signal and demonstrates it in a frequency domain. Also, it explains process of decimation and why it needs a low-pass filter.


Definition of Downsampling

Downsampling is an operation which involves throwing away samples from discrete-time signal. Let  x[n] be a digital-time signal shown below:

Xofn.jpg

 then y[n] will be produced by downsampling x [n]  by factor D = 3. So, y [n] = x[Dn].

Yofn.jpg

As seen in above graph, y [n] is obtained by throwing away some samples from x [n]. So, y [n] is a downsampled signal from

x [n].


Derivation of DTFT of downsampled signal

Let x (t) be a continuous time signal. Then x1 [n] = x (T1n) and  x2 [n] = x (T2n). And ratio of sampling periods would be

D = T2/T1,   which is an integer greater than 1. From these equations we obtain realtionship between x1 [n] and x2 [n].

$ \begin{align} x_2 [n] = x(T_2 n) = x(DT_1 n) = x_1 [nD] \end{align} $

Below we derive Discrete-Time Fourier Transform of x2 [n] in terms of DTFT of x1 [n].


$ \begin{align} &\mathcal{X}_2(\omega)= \mathcal{F}(x_2 [n]) = \mathcal{F}(x_1 [Dn])\\ &= \sum_{n = -\infty}^\infty x_1[Dn] e^{-j \omega n} = \sum_{m = -\infty}^\infty x_1[m] e^{-j \omega {\frac{m}{D}}}\\ &= \sum_{n = -\infty}^\infty s_D[m]* x_1 [m] e^{-j \omega {\frac{m}{D}}}\\ \end{align} $


where

$ s_D [m]=\left\{ \begin{array}{ll} 1,& \text{ if } n \text{ is a multiple of } D,\\ 0, & \text{ else}. \end{array}\right. = {\frac{1}{D}} \sum_{k = -\infty}^{D-1} e^{jk {\frac{2 \pi}{D} m}} $


$ \begin{align} &\mathcal{X}_2(\omega)= \sum_{m = -\infty}^\infty {\frac{1}{D}} \sum_{k = -\infty}^{D-1} e^{jk {\frac{2 \pi}{D} m}} x_1[m] e^{-j \omega {\frac{m}{D}}}\\ &= {\frac{1}{D}} \sum_{k = -\infty}^{D-1} \sum_{m = -\infty}^\infty x_1[m] e^{-jm ({\frac{\omega - 2 \pi k}{D}})} = \\ &= {\frac{1}{D}} \sum_{k = -\infty}^{D-1} \mathcal{X}_1 ({\frac{\omega - 2 \pi k}{D}}) \\ \end{align} $


Example


Let's take a look  at  an original signal X1 (w) and  X2 (w) which is obtained after downsampling X1(w) by factor D = 2 in a frequency domain.

Downsamplegraph.jpg


From two graphs it is seen that signal is stretched by D  in frequency domain and  decreased by D in a magnitude after downsampling. Both signals have the frequency of $ \begin{align} 2\pi \end{align} $ .

Decimator

As seen in second graph, if $ \begin{align} D2\pi T_1f_{max} \end{align} $ is greater than $ \begin{align} \pi \end{align} $ aliasing occurs. Downsampler is a part of a decimator which also has a low-pass filter to  prevent aliasing.  LPF eliminates signal components which has  frequencies higher than cutoff frequency, which can be found from graphs shown above.

                             $ \begin{align} & D\omega_c = D 2 \pi T_1 f_{max} < \pi\\ & {\frac{T_2}{T_1}} 2\pi T_1 f_{max} < \pi \\ & 2\pi T_2f_{max} < \pi \\ &f_{max} < {\frac{1}{2T_2}} \end{align} $

Thereby, signal needs to be filtered before downsampling if fmax > 1/(2T2) . Complete block diagram of a decimator is shown below:


Decimator cutoff.jpg




Conclusion

To summarize, downsampling is a process of removing samples from signal. After downsampling,  signal decreases by factor D in the magnitude and stretches by D in frequency domain.  In order to downsample a signal, it first should be filtered by LPF to prevent aliasing.  Both LPF and downsampler are parts of a decimator.






Questions and comments

If you have any questions, comments, etc. please post them on this page.


Back to ECE438 slectures, Fall 2014

Alumni Liaison

Questions/answers with a recent ECE grad

Ryne Rayburn