## Documentation Center |

Interpolation FIR filter design

`b = intfilt(l,p,alpha)b = intfilt(l,n,'Lagrange')`

`b = intfilt(l,p,alpha)` designs
a linear phase FIR filter that performs ideal bandlimited interpolation
using the nearest

alpha is inversely proportional to the transition bandwidth
of the filter and it also affects the bandwidth of the don't-care
regions in the stopband. Specifying alpha allows you to specify how
much of the Nyquist interval your input signal occupies. This is beneficial,
particularly for signals to be interpolated, because it allows you
to increase the transition bandwidth without affecting the interpolation
and results in better stopband attenuation for a given `l` and `p`.
If you set alpha to 1, your signal is assumed to occupy the entire
Nyquist interval. Setting alpha to less than one allows for don't-care
regions in the stopband. For example, if your input occupies half
the Nyquist interval, you could set alpha to 0.5.

`b = intfilt(l,n,'Lagrange')` designs
an FIR filter that performs

Both types of filters are basically lowpass and have a gain
of `l` in the passband..

Design a digital interpolation filter to upsample a signal by four, using the bandlimited method:

alpha = 0.5; % "Bandlimitedness" factor h1 = intfilt(4,2,alpha); % Bandlimited interpolation

The filter `h1` works best when the original
signal is bandlimited to alpha times the Nyquist frequency. Create
a bandlimited noise signal:

x = filter(fir1(40,0.5),1,randn(200,1)); % Bandlimit

Now zero pad the signal with three zeros between every sample.
The resulting sequence is four times the length of `x`:

xr = reshape([x zeros(length(x),3)]',4*length(x),1);

Interpolate using the `filter` command:

y = filter(h1,1,xr);

`y` is an interpolated version of `x`,
delayed by seven samples (the group-delay of the filter). Zoom in
on a section of one hundred samples to see this:

plot(100:200,y(100:200),7+(101:4:196),x(26:49),'o')

`intfilt` also performs Lagrange polynomial
interpolation of the original signal. For example, first-order polynomial
interpolation is just linear interpolation, which is accomplished
with a triangular filter:

h2 = intfilt(4,1,'l'); % Lagrange interpolation

`decimate` | `downsample` | `interp` | `resample` | `upsample`

Was this topic helpful?