3

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???

Matt L.
  • 89,963
  • 9
  • 79
  • 179
saggy
  • 127
  • 1
  • 7

1 Answers1

5

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.

Matt L.
  • 89,963
  • 9
  • 79
  • 179
  • 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 – saggy Apr 25 '13 at 09:12
  • 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. – Matt L. Apr 25 '13 at 09:23
  • 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

    – saggy Apr 25 '13 at 09:33
  • 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???
    – saggy Apr 25 '13 at 09:40
  • 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. – Matt L. Apr 25 '13 at 10:18
  • now I have an another confusion. How to get h(0.5) or h(1.5). Because usually matlab returns indexes in-terms of 1.. – saggy Apr 25 '13 at 11:17
  • Don't use fractional indices. Use the indices as I did in my answer (linear interpolator example), and simply add 1, so they don't start at 0 but at 1. That simple. – Matt L. Apr 25 '13 at 11:20