# How can a filter impulse response be interpolated?

Started by August 21, 2017
```Hi,

I know how to interpolate a digital signal. It is first interpolated by
inserting 0's. For example, one can add 4 0's to each data for a 5 times
interpolation. Then, a low pass filtering to eliminate the aliasing frequency.

Now, I have a low pass filter from 0 to 10 MHz pass band with a sampling
rate of 40 MSPS. I want to get the same 0 to 10 MHz response (it is not a
flat pass band, for example a CIC compensation FIR filter) with a 50 MSPS
rate. I try to upsampling 5 of the FIR impulse response of 40 MSPS. Using a
low pass FIR filter to eliminate the aliasing frequency component, then
through a 4 decimation to get the desired 50 MSPS FIR impulse response.

To my surprise, the 5X interpolation curve looks strange that there is a
dip notch (the original FIR@40 MSPS is an even number taps type). An even
bigger surprise to me is that the following decimation 4 will result in non
symmetrical curve, which is not a typical linear phase FIR any more.

Could you tell me why the FIR impulse response cannot be manipulated as a
signal to expand the FIR sampling range?

I've tried to use mathematical interpolation (interp1 function in matlab).
There is a bump in the stop band. Though it is not perfect, it does look like
a similar frequency response FIR filter with 50 MSPS.

I remember that there is a FIR design method,sounds like frequency sampling
method. From the frequency resampling data, we get the time domain impulse
response. Do you have simple method to solve this FIR design problem?

```
```fl  <rxjwg98@gmail.com> wrote:

<snip>

I usually try a Lagrangian interpolator first.  Often, a 4-point
Lagrangian interpolator is good enough.  This interpolator is also
called a cubic interpolator.

S.
```
```On Tuesday, August 22, 2017 at 4:55:51 AM UTC+2, fl wrote:
> Hi,
>
> I know how to interpolate a digital signal. It is first interpolated by
> inserting 0's. For example, one can add 4 0's to each data for a 5 times
> interpolation. Then, a low pass filtering to eliminate the aliasing frequency.
>
> Now, I have a low pass filter from 0 to 10 MHz pass band with a sampling
> rate of 40 MSPS. I want to get the same 0 to 10 MHz response (it is not a
> flat pass band, for example a CIC compensation FIR filter) with a 50 MSPS
> rate. I try to upsampling 5 of the FIR impulse response of 40 MSPS. Using a
> low pass FIR filter to eliminate the aliasing frequency component, then
> through a 4 decimation to get the desired 50 MSPS FIR impulse response.

If it's possible I would try to directly compute the filter
coefficients in the same way it's been done for the 40 MHz case

> To my surprise, the 5X interpolation curve looks strange that there is a
> dip notch (the original FIR@40 MSPS is an even number taps type). An even
> bigger surprise to me is that the following decimation 4 will result in non
> symmetrical curve, which is not a typical linear phase FIR any more.
>
> Could you tell me why the FIR impulse response cannot be manipulated as a
> signal to expand the FIR sampling range?

It should be possible to preserve the symmetry. You may need to
interpolate by factor 10 and subsample by factor 8. There is some
freedom as to which samples to discard and which to keep: basically
8 different choices in this case.

Example:

lowpass_10_at_40 = ...;
tenXint = firls(100, [0 10 25 200]./200, [1 1 0 0], [1 100]);
lowpass_10_at_400 = upfirdn(lowpass_10_at_40, tenXint, 10, 1);
lowpass_10_at_50 = lowpass_10_at_400(n:8:end);

where n in the last line is a number between 1 and 8 so that
lowpass_10_at_50 is of the form

[... a b c d e f g h h g f e d c b a ... ]

The right number for n depends on where the "center" position in
lowpass_10_at_40 is.

The frequency parameters I used for firls should work for your case.

Also, I completely ignored any scaling effects. You have to compensate
for this.

I hope this helps.

Cheers!
SG
```
```On Monday, August 21, 2017 at 11:26:57 PM UTC-5, Steve Pope wrote:

> I usually try a Lagrangian interpolator first.  Often, a 4-point
> Lagrangian interpolator is good enough.  This interpolator is also
> called a cubic interpolator.

Neville's Algorithm will find the unique Lagrange polynomial that passes through all of the original points.
```
```On Tuesday, August 22, 2017 at 1:55:56 PM UTC-5, Greg Berchin wrote:

> Neville's Algorithm will find the unique Lagrange polynomial that passes =
through all of the original points.

I've just been brushing-up on Lagrange interpolation -- I had forgotten abo=
ut "Runge's example". Low-order Lagrange polynomials, used to interpolate b=
etween known points, can work pretty well. But finding the high-order Lagra=
nge polynomial that passes through all of the points tends to oscillate hor=
ribly between the points. Probably not a good idea in this case.

```
```On 2017-08-22 04:55, fl wrote:
> Hi,
>
> I know how to interpolate a digital signal. It is first interpolated by
> inserting 0's. For example, one can add 4 0's to each data for a 5 times
> interpolation. Then, a low pass filtering to eliminate the aliasing frequency.
>
> Now, I have a low pass filter from 0 to 10 MHz pass band with a sampling
> rate of 40 MSPS. I want to get the same 0 to 10 MHz response (it is not a
> flat pass band, for example a CIC compensation FIR filter) with a 50 MSPS
> rate. I try to upsampling 5 of the FIR impulse response of 40 MSPS. Using a
> low pass FIR filter to eliminate the aliasing frequency component, then
> through a 4 decimation to get the desired 50 MSPS FIR impulse response.
>
> To my surprise, the 5X interpolation curve looks strange that there is a
> dip notch (the original FIR@40 MSPS is an even number taps type). An even
> bigger surprise to me is that the following decimation 4 will result in non
> symmetrical curve, which is not a typical linear phase FIR any more.
>
> Could you tell me why the FIR impulse response cannot be manipulated as a
> signal to expand the FIR sampling range?
>
> I've tried to use mathematical interpolation (interp1 function in matlab).
> There is a bump in the stop band. Though it is not perfect, it does look like
> a similar frequency response FIR filter with 50 MSPS.
>
> I remember that there is a FIR design method,sounds like frequency sampling
> method. From the frequency resampling data, we get the time domain impulse
> response. Do you have simple method to solve this FIR design problem?

In general, considering that the FIR signal is
finite in length, you can low-pass it (after zero
insertion) using a zero phase filter.
This should keep symmetry, in theory at least.
In practice this should be confirmed.

Zero phase filtering is basically using the
filter, low-pass in this case, which could be
FIR or even IIR, forward *and* backward (there
is also a parallel method, but maybe not really
useful here).
This is possible if the signal to be filtered,
the original FIR impulse response still in this
case, is finite in length.

Hope this helps,

bye,

--

piergiorgio
```
```On Mon, 21 Aug 2017 19:55:46 -0700 (PDT), fl <rxjwg98@gmail.com>
wrote:

>Hi,
>
>I know how to interpolate a digital signal. It is first interpolated by
>inserting 0's. For example, one can add 4 0's to each data for a 5 times
>interpolation. Then, a low pass filtering to eliminate the aliasing frequency.
>
>Now, I have a low pass filter from 0 to 10 MHz pass band with a sampling
>rate of 40 MSPS. I want to get the same 0 to 10 MHz response (it is not a
>flat pass band, for example a CIC compensation FIR filter) with a 50 MSPS
>rate. I try to upsampling 5 of the FIR impulse response of 40 MSPS. Using a
>low pass FIR filter to eliminate the aliasing frequency component, then
>through a 4 decimation to get the desired 50 MSPS FIR impulse response.
>
>To my surprise, the 5X interpolation curve looks strange that there is a
>dip notch (the original FIR@40 MSPS is an even number taps type). An even
>bigger surprise to me is that the following decimation 4 will result in non
>symmetrical curve, which is not a typical linear phase FIR any more.
>
>Could you tell me why the FIR impulse response cannot be manipulated as a
>signal to expand the FIR sampling range?
>
>I've tried to use mathematical interpolation (interp1 function in matlab).
>There is a bump in the stop band. Though it is not perfect, it does look like
>a similar frequency response FIR filter with 50 MSPS.
>
>I remember that there is a FIR design method,sounds like frequency sampling
>method. From the frequency resampling data, we get the time domain impulse
>response. Do you have simple method to solve this FIR design problem?
>

A simple method I've used successfully in the past is to interpolate

Basically, forward DFT the impulse response, zero pad the result up to
the desired length (at the high frequencies, i.e., at both ends away
from DC), and then inverse-DFT the zero-padded vector.   If the
original impulse response was real-valued then the real component of
the output vector is the interpolated impulse response.

This technique often works, but not always.   The interpolated impulse
response should be checked for frequency response.   If the response
is not what is desired but close, then hand-tweaking the results may
be sufficient.

But apparently I'm a bit of a weirdo for hand-tweaking coefficients,
so YMMV.

```
```Greg Berchin  <gjberchin@charter.net> wrote:

>On Tuesday, August 22, 2017 at 1:55:56 PM UTC-5, Greg Berchin wrote:

>> Neville's Algorithm will find the unique Lagrange polynomial that
>> passes through all of the original points.

>I've just been brushing-up on Lagrange interpolation -- I had forgotten
>about "Runge's example". Low-order Lagrange polynomials, used to
>interpolate between known points, can work pretty well. But finding the
>high-order Lagrange polynomial that passes through all of the points
>tends to oscillate horribly between the points. Probably not a good idea
>in this case.

Yes, this is why I suggested a four-point Lagrangian as a first shot.

A good way of characterizing its performance for a given signal
and interpolation ratio is total harmonic distortion.  In actual
designs with real-world signals I have seen distortion products
anywhere from -40 dBc to -70 dBc.

There are possibly scenarios where you want to use something like
Neville's algorithm, but I haven't run across one.

Steve
```
```On Friday, August 25, 2017 at 3:15:00 PM UTC-4, Steve Pope wrote:
> Greg Berchin  <gjberchin@charter.net> wrote:
>
> >On Tuesday, August 22, 2017 at 1:55:56 PM UTC-5, Greg Berchin wrote:
>
> >> Neville's Algorithm will find the unique Lagrange polynomial that
> >> passes through all of the original points.
>
> >I've just been brushing-up on Lagrange interpolation -- I had forgotten
> >about "Runge's example". Low-order Lagrange polynomials, used to
> >interpolate between known points, can work pretty well. But finding the
> >high-order Lagrange polynomial that passes through all of the points
> >tends to oscillate horribly between the points. Probably not a good idea
> >in this case.
>
> Yes, this is why I suggested a four-point Lagrangian as a first shot.
>
> A good way of characterizing its performance for a given signal
> and interpolation ratio is total harmonic distortion.  In actual
> designs with real-world signals I have seen distortion products
> anywhere from -40 dBc to -70 dBc.
>
> There are possibly scenarios where you want to use something like
> Neville's algorithm, but I haven't run across one.
>

another polynomial interpolation family is Hermite polynomials.  the Lagrange polynomials only guarantee continuity to the zeroth derivative.  Hermite gives you more continuous derivatives.  a 3rd-order Hermite is continuous to the 0th and 1st derivative.  a 5th-order Hermite is continuous to the 2nd derivative.

r b-j
```
```Am Samstag, 26. August 2017 21:03:43 UTC+2 schrieb robert bristow-johnson:
>
> another polynomial interpolation family is Hermite polynomials.  the Lagrange polynomials only guarantee continuity to the zeroth derivative.  Hermite gives you more continuous derivatives.  a 3rd-order Hermite is continuous to the 0th and 1st derivative.  a 5th-order Hermite is continuous to the 2nd derivative.
>
> r b-j

When it's about smooth piece-wise polynomial interpolations, I'm quite
a fan B-splines.  There's a super efficient way of doing that in the
case of equidistant samples (like your usual digital signal):

http://bigwww.epfl.ch/publications/thevenaz9901.pdf

Cheers!
SG
```