1. We wish to design an FIR differentiator which has the ideal frequency response:

H(ω) = jωe^{−jω \frac{M−1}{2}} , −π < ω ≤ π

(a) Take the inverse Fourier transform of H(ω) to how that:

h(n) = \{ \begin{matrix}\frac{cos[π(n− \frac{M−1}{2})]}{n− \frac{M−1}{2}} − \frac{sin[π(n− \frac{M−1}{2})]}{π(n− \frac{M−1}{2})^{2}} & n ≠ \frac{M−1}{2} \\ 0 & n = \frac{M−1}{2} \end{matrix}

(b) Use the above equation with a Hamming window to find h(n) for a differentiator where M = 20. Plot h(n).

(c) Plot the gain |H(ω)| and phase ^{}H̸(ω) of the filter.

(d) In MATLAB, generate a signal x(n) = cos(ω_{0}n), where ω_{0} = π/16. Find 101 terms for x(n):

        wo = pi/16;
        n = 0:100;
        x = cos(wo*n);

Use the above h(n) to filter the signal x(n): y = filter(h,1,x);. Use MATLAB to plot x(n). Over the top of this, plot y(n − 9.5). (Remember that the output was delayed by (M − 1)/2 samples.) Does y(n) look like the derivative of x(n)?

(e) Repeat Part (e) for w_{0} = π/4.

2. We wish to design a Hilbert transformer which has the ideal frequency response:

H(ω) = \{ \begin{matrix}−je^{−jω \frac{M−1}{2}} , & −π < ω ≤ 0 \\ je^{−jω \frac{M−1}{2}} , & 0 < ω ≤ π \end{matrix}

(a) Take the inverse Fourier transform of H(ω) to how that:

h(n) = \{ \begin{matrix}\frac{1−cos[π(n− \frac{M−1}{2})]}{π(n− \frac{M−1}{2})} & n ≠ \frac{M−1}{2} \\ 0 & n = \frac{M−1}{2} \end{matrix}

(b) Use the above equation with a Hamming window to find h(n) for a Hilbert transformer where M = 20. Plot h(n).

(c) Plot the gain |H(ω)| and phase ^{}H̸(ω) of the filter.

(d) In MATLAB, generate a signal x(n) = cos(ω_{0}n), where ω_{0} = π/16. Find 101 terms for x(n):

        wo = pi/16;
        n = 0:100;
        x = cos(wo*n);

Use the above h(n) to filter the signal x(n): y = filter(h,1,x);. Use MATLAB to plot x(n). Over the top of this, plot y(n − 9.5). (Remember that the output was delayed by (M − 1)/2 samples.) Does y(n) look like the ouput you would expect for a Hilbert transformer?

(e) Repeat Part (e) for w_{0} = π/4.