Thursday, 11 October 2012

Impulse Response: Is it just response to impulse

Hey All

After a long delay finally a post!! Today we will see why Impulse response is so important while rare cases are those where we will actually feed the impulse as input. We will take discreet LTI systems here for the understanding. While most of the things are true for continuous LTI systems too. There are some prerequisite for better understanding which I hope you all already know about. Here are they:
1. Discreet Time Fourier Transform $$X(e^{j\omega})$$
2. LTI - Linear Time Invariant Systems

Impulse Inputs and System's Response to it
Impulse are something which are just for a moment. Like You get hit by a ball while watching cricket in the stadium. Or the sudden breaks on the car. Fig 1 describes an impulse.  So Impulse is a signal which is one at a single time and zero everywhere else. We denote an Impulse by $$\delta[n]$$ . It means that it is one only when $$n=0$$. Similarily $$\delta[n-2]$$ represent an impulse which is one only at $$n=2$$.

 Fig 1 Impulse Input

Although its response may not be impulse. You can feel the pain for a long time. or the car slows down, wiggles for a few seconds and then maintains its speed again. This Fig 2 shows a typical response. Let us call it  $$h[n]$$.

 Fig 2 Impulse Response: system's response to impulse
Response (Output) of a system when an Impulse inputs is applied. Similarly a response to a step input is known as step response. Since system is LTI, it does not matter when or how you apply the impulse input. If it is given an impulse, it will always respond the same. and that is called impulse response which is a property of a system. But So is the step response. So why impulse response is treated in such an important fashion.

Response to a two rank input
Let us take an example with a response which is not impulse but looks like something shown in figure 3.

 Fig 3 rank 2 input x[n]

$$x[0]=1$$ $$x[1]=0.4$$
What is the response to this input? Well we know the system is linear , so why not break the input to linear combinations of some input (basis inputs if you call) for which we know the input. If you think, you will find out impulse are such a choice which are simpler to find. ( Think in terms of finding the coefficients of a point in n dimensional in standard basis).
Fig 4 shows such a break up. Easy.

 Fig 4 Breaking up the input into impulses
So we can say $$x[n]=1\delta[n]+0.4\delta[n-1]$$
We can also write this as $$x[n]=x[0]\delta[n]+x[1]\delta[n-1]$$
Now use the linearity property.

$$\delta[n]$$ results in $$h[n]$$.
$$\delta[n-1]$$ results in $$h[n-1]$$.
So $$1\delta[n]+0.4\delta[n-1]$$ results in $$1.h[n]+0.4h[n-1]$$.
Fig 5 describes it.
 Fig 5 Response to Each Impulse Add to Final Response
Woah!! So we can use impulse response even if the input is not impulse? Yes, the output is always an linear combination of impulse response.
Let us write the result in more generalized way
if $$x[n]$$ is $$x[0]\delta[n]+x[1]\delta[n-1]$$
Output (Response) is $$y[n]=x[0]h[n]+x[1]h[n-1]$$

Generalized Case:
What if the input have k+1 nonzero values at n=0,1,...,k. You can again write $$x[n]= x[0]\delta[n]+x[1]\delta[n-1]+...+x[k]\delta[n-k]$$
So the response is
$$y[n]=x[0]h[n]+x[1]h[n-1]+...+x[k]h[n-k]=\sum_{i=0}^{k}x[i]h[n-i]$$

So any response is a linear combination of shifted impulse responses with coefficients equal to signal values. That is why impulse response are so important and treated as basic property of a LTI system. If we know impulse response, we know  the response to any input.

Step Response
Let us try our findings on step input. For a step signal x[n] is always one for $$x\ge 0$$. So response (or step response because it is response to step input) is $$y[n]=\sum_{i=0}^{\infty}h[n-i]$$. Sum (or integration) of h[n].

How to get back the impulse response if we know the response for an arbitrary input
Now this is little tricky. If you observe the equation $$y[n]=\sum_{i=0}^{k}x[i]h[n-i]$$ closely, you will know it is the convolution of x[n] and h[n].$$y[n]=x[n]*h[n]$$.

So What do you do when you see convolution? Yes go to the fourier Domain. Let us denote DTFT of x[n],h[n] and y[n] as $$X(e^{j\omega}),H(e^{j\omega})$$ and $$Y(e^{j\omega})$$. Here again $$X(e^{j\omega})$$ is a system property because it is fixed and is known as Frequency response. So the earlier expression becomes $$Y(e^{j\omega})=X(e^{j\omega})H(e^{j\omega})$$ $$H(e^{j\omega})=\frac{Y(e^{j\omega})}{X(e^{j\omega})}$$. Remember that this function is constant regardless of what x[n] or y[n] you take if the system is LTI.