- #1
phoenixy
Hi,
Does anyone know how to design a 8x lagrange interpolation filter in matlab?
From what I understand, let say my input is
input = [1 2 3 4 3 2 1]
let say if I want to interpolate by 2, then I insert 0 between every
sample.
input_pad = [1 0 2 0 3 0 4 0 5 0 4 0 3 0 2 0 1]
then I apply the formula
y(kT)=1.0*x(kT) + 1.0*x(k-1)T
to get the output (assume this filter is 2tap). so a filter of [1 1]
is essentially a hold
input_interp = [1 1 2 2 3 3 4 4 5 5 4 4 3 3 2 2 1 1]
As for quadratic, it would be in the form of
y(kT)=a*x(kT) + b*x(k-1)T + c*x(k-2)T
where [a b c] is the filter coefficient that I have to determine. For
8x interpolation, I would inject 7 zeros between samples prior to
filtering.
So my question is, how do I determine these fixed coefficient [a b
c]? PS: I found [0.5 1 0.5] being the filter for linear interpolation, which works when I implemented it.
Thank you
Does anyone know how to design a 8x lagrange interpolation filter in matlab?
From what I understand, let say my input is
input = [1 2 3 4 3 2 1]
let say if I want to interpolate by 2, then I insert 0 between every
sample.
input_pad = [1 0 2 0 3 0 4 0 5 0 4 0 3 0 2 0 1]
then I apply the formula
y(kT)=1.0*x(kT) + 1.0*x(k-1)T
to get the output (assume this filter is 2tap). so a filter of [1 1]
is essentially a hold
input_interp = [1 1 2 2 3 3 4 4 5 5 4 4 3 3 2 2 1 1]
As for quadratic, it would be in the form of
y(kT)=a*x(kT) + b*x(k-1)T + c*x(k-2)T
where [a b c] is the filter coefficient that I have to determine. For
8x interpolation, I would inject 7 zeros between samples prior to
filtering.
So my question is, how do I determine these fixed coefficient [a b
c]? PS: I found [0.5 1 0.5] being the filter for linear interpolation, which works when I implemented it.
Thank you