% -*- latex -*-
% FILE: "/home/evmik/jobs/wm/2011_fall_practical_computing_for_scientists/hw10/hw10.tex"
% LAST MODIFICATION: "Mon, 21 Nov 2011 12:46:57 -0500 (evmik)"
% (C) 2010 by Eugeniy Mikhailov, <evgmik@gmail.com>
% $Id:$
\documentclass[letter,12pt]{article}

%---------------------------------------------------------------
\usepackage{listings}
\usepackage{color}
\usepackage{fullpage}
%---------------------------------------------------------------

\begin{document}
\newcommand{\problem}[1]{%
	{\flushleft  \bf #1\\}
}
\newcommand{\subproblem}[1]{%
{\flushleft  {\bf Subproblem:} #1\\}
}
\newcommand{\hw}[1]{%
	\begin{center}
		\Large  \bf Homework #1%
	\end{center}%
}
\newcommand{\mat}[1]{% matlab code
{\color{blue}\texttt{#1}}%
}

%---------------------------------------------------------------
\hw{10}

\problem{Problem 1 (5 points)}
%---------------------------------------------------------------
Have a look at particular realization of the  $N$ point forward DFT.
\begin{eqnarray*}
	C_n=\sum_{k=1}^N y_k exp( -i 2 \pi  (k-1) n /N)
\end{eqnarray*}
here the normalization coefficient is omitted.

Analytically prove that forward discrete Fourier transform is  periodic i.e.
$c_{n+N}=c_{n}$.
Note: recall that $exp(\pm i 2 \pi)=1$.

Does it extends to the fact that $c_{-n} = c_{N-n}$?



\problem{Problem 2 (5 points)}
%---------------------------------------------------------------
Use proved in the previous problem relationships and show that,
for any sample set which has only real values (i.e. no complex part),
the following relationship holds
\begin{eqnarray*}
	c_n = c_{N-n}^*
\end{eqnarray*}
Where $^*$ depicts complex conjugation.

\problem{Problem 3 (15 points)}
%---------------------------------------------------------------
Load the data from the file 'hw\_data\_for\_filter.dat' provided at the class web page. 
It contains a table with $y$ vs
$t$ data points (first column is the time, second is $y$). These data points are
taken with the same sampling rate.


\subproblem{3a (2 points)}
What is the sampling rate?

\subproblem{3b (3 points)}
Calculate forward DFT of the data and find which 2 frequency component of
the spectrum (measured in Hz not rad$^-1$) are the largest. Note I refer to
the real frequency of the $\sin$ or $\cos$ component i.e. not to negative
frequencies. 

\subproblem{3c (2 points)}
What is the largest possible frequency (in Hz) in this data set which we
can scientifically discuss?

\subproblem{3d (5 points)}
We consider everything else but above 2 components as DFT of noise.
Construct a low pass filter  which will pass this two components. Plot it's
frequency representation (positive and negative frequency). Explain your
choice of the filter and its parameters.

\subproblem{3e (3 points)}
Apply the filter to the data Fourier representation and calculate inverse
DFT. Plot the resulting filtered data representation and  raw data points
at the same plot. Did it completely get rid of noise? If not why is so?


%---------------------------------------------------------------
\end{document}
%---------------------------------------------------------------
