3.7. Exercises#

Exercise 3.1

For each of the following systems, what is its impulse response?

  1. y[n]=x[n]x[n1]

  2. y[n]=2x[n]+x[n2]

  3. y[n]=13(x[n2]+x[n3]+x[n4])

Exercise 3.2

If x is a signal of N=100 samples, an h is an impulse response of K=11 samples, how many samples does y=hx have in each of the following modes?

  1. Full

  2. Valid

  3. Same (centered)

Exercise 3.3

For each of the following systems, determine whether it is linear, shift-invariant, both, or neither.

  1. y[n]=x[n]

  2. y[n]=x[0]

  3. y[n]=12|x[n]+x[n1]|

  4. y[n]=20

  5. y[n]=n2

Exercise 3.4

Let h=[1/K,1/K,,1/K] (K times) denote a moving average filter so that if y=hx, then y[n] is the average of the previous K samples in x.

Using an input recording x of your choice (not more than 10 seconds), compute y for different values of K=1,4,16,64,256,1024 and listen to each one.

How does each y sound compared to the original signal? Do you notice any artifacts?

# Starter code for making a moving average filter
K = 8
h_K = 1/K * np.ones(K)