3
$\begingroup$

I am confused about this Q&A : Interpolation by factor of 2

If my input signal $$ x[n]= x0,x1,x2,x3 $$ then according to the threads explaination my $v[n]$ will be

$$ v[n]=x0,0,x1,0,x2,0,x3,0 $$

$x[n] \rightarrow$ zeropad $\rightarrow v[n]$

$v[n]\rightarrow$ LPF $\rightarrow y[m]$

My $y[m]$ is the output of LPF which removes aliases. So basically LPF transfer function is given as

$$ y[m] = v[n]*h[n] $$

i,e. $y[m]=\displaystyle\sum_{n=0}^{\infty}h(m-n)v(n)$

So here $h[m]$ is my filter coefficients and $v[n]$ is my zero padded input signal... so, if I multiply zero with my filter coefficients, then my output will also be zero...

If I send 10 input samples, after zero padding I will get 20 samples, out of which 10 will be zero....

So what is the use of getting zero as my output? Correct me if am wrong (I know I am wrong, but please give me some idea how zero padding & LPF is helping in this regard).

For FIR filter: $y(n)=h(0)x(n)+h(1)x(n−1)+....+h(N−1)x(n−N+1)$, where $x(n)$ is the input signal, $y(n)$ is the output signal, $h(n)$ is the impulse response, and $N$ is the filter length.

For simplicity, I am taking order $N=4$,and some random numbers

    (time) n --> [ 0  1  2  3] 
         x[n]--> [ 2  4  6  8] 
         h[n]--> [.1 .2 .3 .4] 

what is $y[2.5]$???

                  n-->[0 0.5 1 1.5 2 2.5 3 3.5]  
               v[n]-->[2  0  4  0  6  0  8  0 ] (after zero padding)

Lets calculate for $y[2.5]=h(0)x(2.5)+h(1)x(1.5)+h(2)x(0.5)+h(3)x(-0.5)$

so here $x(2.5)=x(1.5)=x(0.5)=0$

Please answer this to clear my confusion???

$\endgroup$
5
$\begingroup$

The interpolation lowpass filter computes a weighted sum of input samples, which results in the zero input samples being interpolated using the non-zero samples of the input signal. The $*$ sign is NOT multiplication but convolution!

EDIT: I'm adding a simple example to clear things up a bit. Let's consider the impulse response $h = [0.5, 1, 0.5]$ and a zero-padded input signal $x=[1,0,3,0,5,0,3,0,1]$. The time index is denoted by $n$, and $n=0$ corresponds to the left-most values of $h$ and $x$. The output $y$ is the convolution of $(x*h)(n)$:

$$y(0) = h(0)x(0) = 0.5\\ y(1) = h(0)x(1) + h(1)x(0) = 1\\ y(2) = h(0)x(2) + h(1)x(1) + h(2)x(0) = 2\\ y(3) = h(0)x(3) + h(1)x(2) + h(2)x(1) = 3\\ y(4) = h(0)x(4) + h(1)x(3) + h(2)x(2) = 4\\ y(5) = h(0)x(5) + h(1)x(4) + h(2)x(3) = 5\\\vdots$$

This impulse response obviously performs linear interpolation of the zero-padded input signal.

$\endgroup$
  • $\begingroup$ yes, even in convolution it will look like this y[m]=(summation n->0 to infinity)h(m-n)v(n).... here v[n] will be a zero value $\endgroup$ – saggy Apr 25 '13 at 9:12
  • $\begingroup$ No, if the filter is FIR you get: $y(n) = h(0)x(n)+h(1)x(n-1)+\ldots +h(N-1)x(n-N+1)$, where $x(n)$ is the input signal, $y(n)$ is the output signal, $h(n)$ is the impulse response, and $N$ is the filter length. $\endgroup$ – Matt L. Apr 25 '13 at 9:23
  • $\begingroup$ ok, for simplicity, am taking order N=4, n --> [ 0 1 2 3] x[n]--> [ 2 4 6 8] h[n]--> [.1 .2 .3 .4] what is y[0.5]??? please answer this to clear my confusion $\endgroup$ – saggy Apr 25 '13 at 9:33
  • $\begingroup$ n--> [0 .5 1 1.5 2 2.5 3 3.5] after zero padding v[n]-->[2 0 4 0 6 0 8 0] Lets calculate for y[2.5].... y[2.5]=h(0)x(2.5)+h(1)x(1.5)+h(2)x(0.5)+h(3)x(-0.5) so here x(2.5)=x(1.5)=x(0.5)=0 so output should be zero right??? $\endgroup$ – saggy Apr 25 '13 at 9:40
  • $\begingroup$ No, you're getting confused about the indexing. If you use your index system of 0, 0.5, 1.0 etc. (which I wouldn't recommend because it IS confusing), then your impulse response has non-zero values for all indices, not only for the integer ones. So (in your notation): $y(2.5) = h(0)x(2.5) + h(0.5)x(2.0) + h(1)x(1.5) + h(1.5)x(1) \dots$. I'll add a better example to my answer above as soon as I have the time to do so. Hope this helps for the moment. $\endgroup$ – Matt L. Apr 25 '13 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.