\documentclass[11pt]{article}
\topmargin-.5in
\textwidth6.6in
\textheight9in
\oddsidemargin0in

\def\ds{\displaystyle}
\def\d{\partial}

\begin{document}
\pagestyle{empty}

\centerline{\large \bf MA 574 -- PROJECT 1}

\bigskip
\noindent
{\bf Due: Friday, February 1}


\bigskip
\noindent
(1) In class, we linearized about the static velocity $u_0 = 0$.  For the 1-D case, derive Euler's equation, the continuity equation, and the equation of state if you linearize about $u_0 \neq 0$; i.e., consider perturbations $u(t,x) = u_0 + \hat{u}(t,x)$.  Can you derive a wave equation posed solely in terms of $\hat{p}$, $\hat{u}$ or a potential $\phi$?


\bigskip
\bigskip
\noindent
(2) Here we are going to investigate some of the principles associated with a noise
cancelling headset.  As detailed in the paper ``Engineering Silence: Active Noise Cancellation,''
headsets can eliminate low frequency noise by inverting acoustic waves measured
by a microphone on the headset.  This can be accomplished using a simple configuration of 
operational amplifiers (op-amps).  We are going to numerically simulate aspects of this
process.

Download the file \verb+noise_data.mat+ which contains a signal \verb+y+ sampled at a rate \verb+Fs+.
This signal is very familiar piece corrupted by noise comprised of two frequencies:
$$
  \mbox{\rm Noise} = A_1 \sin(\omega_1 t + \phi) + A_2 \sin(\omega_2 t + \phi).
$$
You need to determine the amplitudes $A_1, A_2$, frequencies $\omega_1, \omega_2$ and phase $\phi$,
and invert the signal to determine the piece which you can play using the command \verb+sound(y,Fs)+.

You should start by using the sample rate Fs to determine an appropriate time vector.  You
can then estimate the phase by plotting the initial signal as a function of time.  It is probably
easiest to next determine the frequencies which can be accomplished using the MATLAB \verb+fft+
command.  If you check the documentation for that command, you find the following example:
\begin{verbatim}
  t = 0:0.001:0.6;
  x = sin(2*pi*50*t)+sin(2*pi*120*t);
  y = x + 2*randn(size(t));
  plot(1000*t(1:50),y(1:50))
  title('Signal Corrupted with Zero-Mean Random Noise')
  xlabel('time (milliseconds)')

  Y = fft(y,512);
  Pyy = Y.* conj(Y)/512;
  f = 1000*(0:256)/512;
  figure(2)
  plot(f,Pyy(1:257))
  title('Frequency content of y')
  xlabel('frequency (Hz)')
\end{verbatim}

Here you are taking a 512-point FFT with a sample rate of 1000 (e.g., $dt = 0.001$).  You should
modify this for your sample rate \verb+Fs+ and determine the frequencies in your signal.  You may need
to numerically experiment to obtain the correct magnitudes $A_1,A_2$ associated with the frequencies $\omega_1,\omega_2$.
Once you have done so, you can invert the signals and play the piece.


\vfill\eject
\noindent
(3) We are all familiar with the Doppler effect in which the perceived frequency of sound
changes when the sound source or receiver are moving relative to the medium.  Here we assume 1-D
wave motion and let $f_o$ and $f_e$ respectively denote the observed and emitted frequencies. 
Let $u$ and $v$ denote the speed of the source and observer relative to the medium and $c=343$ m/s denote the speed of sound at 20 $^o$C.  The positions of the source and receiver (observer) are denoted by $S$ and $R$.

\medskip
\noindent
(a) Consider first the case when the receiver is stationary.  Let $S$ and $R$ denote
the positions of the source and receiver when both are fixed and let $S'$ denote the position of the
moving source.   Show that $SR - S'R = u \Delta t$ from which it follows that 
$\lambda_e f_e \Delta t - \lambda_o f_e \Delta t = u \Delta t$ where $\lambda_o$ and $\lambda_e$
are the observed and emitted wavelengths.  Use this to show that
$$
  f_o = f_e \lambda_e /\lambda_o = \frac{c}{c - u} f_e .
$$

\medskip
\noindent
(b) Use similar analysis to show that if the source is fixed and the receiver is moving
with velocity $v$, then
$$
  f_o = \frac{c-v}{c} f_e.
$$
When both are moving, the observed and emitted frequencies are related by the equation
$$
  f_o = \frac{c-v}{c-u} f_e.
$$

\medskip
\noindent
(c) At the winter olympics, you attend a ski jumping competition where you are able to observe from the end of the ramp.  While there, you note with your perfect pitch that one skier's scream changes from D above Middle C to B flat below Middle C as he goes off the jump.  How fast is he going if you take the speed of sound at -5 $^o$C to be 328.25 m/s?


\bigskip
\bigskip
\noindent
(4) Write a MATLAB script to play the first four measures of Beethoven's 5th symphony based on tones of the notes with the duration of each note dictated by the rhythm.  You can find the notes on Wikipedia. 

\end{document}

