Homework 6 -- Due We 11/2/2011

1. As background, spend some time experimenting with the properties of complex exponential sequences

x[n] = z^n

or in MATLAB terms

x = z.^n

where z is an arbitrary complex number, and n ranges over integers.

In the general case, we think of n as running from minus infinity to infinity, but obviously for explorations in MATLAB you'll look at specific finite sequences of values of n. I suggest that you focus on sequences like n = 1:100 and the like, though understanding the properties of other index ranges is fine as well.

Then write a MATLAB function whose inputs are a complex number z and a (finite) impulse response h, and whose output is the (complex) constant H(z) that is the "eigenvalue" for the complex exponential z^n and the shift-invariant linear system defined by h.

Here is a set of hints intended to point you in a plausible direction.

2. In the lecture notes, you're shown how to calculate the frequency response of an IIR filter with one pole corresponding to a complex root with amplitude 0.95 and frequency 0.5:

r = .95*exp(i*.5*pi);  % complex root at frequency .5, amplitude .95
A = poly([r r']);  % why is this the right thing to do? What is A?
impulse=zeros(256,1); impulse(15)=1;
impresp = filter([1 0 0], A, impulse);     
figure(1); plot(impresp);  % plot the impulse response
figure(2); lspecplot(fft(impresp),1);  % plot the amplitude spectrum in dB

(where you'll need to fetch or re-write lspecplot.m and mag.m)

2.a. In the frequency response plot above, the frequencies run from 0 to 1. Re-do the plot assuming a sampling rate of 11025 Hz.

2.b. Assuming the same sampling rate, construct an IIR filter for a pole at 2300 Hz. Show that it worked by calculating and plotting the frequency response.

2.c. For a (pair of) LPC polynomial roots at z = r*exp(±i*theta), the pole frequency F and 3-dB bandwidth B (in Hz) are

F = sfreq*theta/(2*pi)

and

B = -sfreq*ln(r)/pi

Create an LPC filter with pole frequencies 400, 2200, 2700, and bandwidths 50, 100, 150. Plot its frequency response using the same methods as before.

3. Fetch Xm11ah.wav and put it somewhere that Matlab or Octave can find it. Play it so that you know what it sounds like.

Then read it in with something like

[X, fs, bits] = wavread("Xm11ah.wav");

Based on a 30-msec-long stretch of audio starting at 0.2 seconds into the file, do linear regression to calculate the coefficients for predicting the next audio sample as a linear combination of the previous 10 samples.

What are the roots of this linear predictive model? What are their values in terms of frequency and bandwidth?