# Physics 380, 2010: Fourier Analysis

## Homework (due Oct 8)

1. In class, we discussed the rate-distortion theorems, and in particular its Information Bottleneck form (Tishby et al, 2000), which, for a given distribution of a signal ${\displaystyle x}$ and the relevance variable ${\displaystyle y}$, ${\displaystyle P(x,y)}$, tries to compress ${\displaystyle x}$ into ${\displaystyle z}$, while preserving as much information in ${\displaystyle z}$ as possible about ${\displaystyle y}$. That is, the method maximizes ${\displaystyle L=I(z,y)-\lambda I(x,z)}$ over ${\displaystyle P(z|x)}$, and the parameter ${\displaystyle \lambda }$ controls the tradeoff between the strength of the compression and the amount of information retained about ${\displaystyle y}$. Let's explore this approach numerically.
• Download the following program bottle2.m, which takes on its input the joint distribution of ${\displaystyle x}$ and ${\displaystyle y}$, the suggested dimensionality of ${\displaystyle z}$, and the value of ${\displaystyle \beta =1/\lambda }$. The routine outputs ${\displaystyle P(z|x)}$ and ${\displaystyle P(y|z)}$.
• You will also need auxiliary functions llog2.m and unzero.m. Download them and place them into the same folder/directory as bottle2.m
• Recall the homework problem from the last week and, as ${\displaystyle P(x)}$, take a distribution that allows 1, 5, 10, 20 molecules with an equal probability of 0.25. Use the code you wrote the last time to generate ${\displaystyle P(x,y)}$, where ${\displaystyle y}$ is obtained by Poisson smearing of ${\displaystyle x}$.
• Run the Information bottleneck algorithm and plot ${\displaystyle I(y,z)}$ vs. ${\displaystyle I(x,z)}$ for different values of ${\displaystyle \beta }$ and for sizes of ${\displaystyle z}$ of 2, 3, 4, 5. How close do we come to recovering all of information about ${\displaystyle y}$ in ${\displaystyle z}$? That is, how close is ${\displaystyle I(y,z)/I(x,z)}$ to 1? How different are the plots for different sizes of ${\displaystyle z}$? Discuss.
2. Calculate Fourier coefficients for the following three functions defined for ${\displaystyle -1\leq t\leq 1}$. (a) ${\displaystyle x(t)=\left\{{\begin{array}{ll}-1,&t<0\\0,&t=0\\+1,&t>0\end{array}}\right.}$; (b) ${\displaystyle x(t)=\left\{{\begin{array}{ll}t+1,&t<0\\1,&t=0\\1-t,&t>0\end{array}}\right.}$; (c)${\displaystyle x(t)=(t-1)^{2}(t+1)^{2}}$. Plot the first ten partial sums of the Fourier series for all of these functions to observe how the sums converge. Use one figure per function (that is, plot the ten sums on the same figure). Note that the Fourier coefficients decrease the slowest for the function that is discontinuous, (a), and the fastest for the function that is smooth, (c).

## Homework (due Oct 15)

Let's play a bit today with Fourier transforms

1. Consider the following Langevin differential equation that we discussed in class: ${\displaystyle {\frac {dx}{dt}}=-kx+c\eta }$, where ${\displaystyle \eta }$ is a Wiener process, that is, it is a Gaussian variable with ${\displaystyle \langle \eta \rangle =0}$, ${\displaystyle \langle \eta (t)\eta (t')\rangle =\delta (t-t')}$.
• Write simple program that would solve this equation as a difference equation. That is, following our discussion in one of the previous homeworks, for a given ${\displaystyle k}$, ${\displaystyle c}$ and the temporal step size ${\displaystyle \Delta t}$, we can define ${\displaystyle x_{n}\equiv x(n\Delta t)}$, and then ${\displaystyle {\frac {x_{n+1}-x_{n}}{\Delta t}}=-kx_{n}+{\frac {c}{\sqrt {\Delta t}}}\nu }$, where ${\displaystyle \nu }$ is a Gaussian random variable with zero mean and unit variance. This then gives ${\displaystyle x_{n+1}=x_{n}-kx_{n}\Delta t+c{\sqrt {\Delta t}}\nu }$, which can be turned into a simple for-loop code for simulating a sequence of x's.
• Simulate ${\displaystyle N=1e5}$ steps of this dynamics of ${\displaystyle x}$. Plot ${\displaystyle x}$. Describe what you see.
• Take a Fourier transform of this ${\displaystyle x}$ using the Matlab build-in ${\displaystyle fft}$ function.
• Plot (in log-log scale) the power spectrum (that is ${\displaystyle \left|{\hat {x}}(\omega )\right|^{2}\equiv {\hat {x}}(\omega ){\hat {x}}({-\omega })}$.
• Using the expressions we derived in class, show that the power spectrum for this ${\displaystyle x}$ should look like ${\displaystyle \langle {\hat {x}}(\omega ){\hat {x}}({-\omega })\rangle ={\frac {c^{2}}{k^{2}+\omega ^{2}}}}$. Compare this to your plot. Do they look similar? Think about why or why not. (Hint -- they will be similar for about half of your plot).
2. For grad students only. Can you also calculate the power spectrum for ${\displaystyle x}$ that satisfies the following equations: ${\displaystyle {\begin{array}{l}{\frac {dx}{dt}}=-k_{xx}+k_{xy}y+c_{x}\eta _{x}\\{\frac {dy}{dt}}=-k_{yx}y+k_{yy}y+c_{y}\eta _{y}\end{array}}}$, where all ${\displaystyle k}$'s are positive, and ${\displaystyle \eta _{x},\eta _{y}}$ are uncorrelated noises in the two variables. Are there any special features in the power spectrum. How do you think ${\displaystyle x(t)}$ might look like given this spectrum?

For these problems, we wrote the following functions:

• JCondJ.m -- takes a conditional distribution ${\displaystyle Pzx=P(z|x)}$ and the joint distribution ${\displaystyle P(x,y)=pxy}$ as an input and produces the joint ${\displaystyle pzy=P(z,y)}$ on the output.
• FSerVal.m -- takes the vector of time, the zeros cosine coefficient, and the rest of the cosine and the sine coefficients and produces the values of the corresponding partial sums.