This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Filtering After Upsampling — Interpolation

This example shows how to upsample a signal and apply a lowpass interpolation filter with interp. Upsampling by L inserts L - 1 zeros between every element of the original signal. Upsampling can create imaging artifacts. Lowpass filtering following upsampling can remove these imaging artifacts. In the time domain, lowpass filtering interpolates the zeros inserted by upsampling.

Create a discrete-time signal whose baseband spectral support is [-π/2,π/2]. Plot the magnitude spectrum.

F = [0 0.250 0.500 0.7500 1];
A = [1.0000 0.5000 0 0 0];
Order = 511;
B = fir2(Order,F,A);
[Hx,W] = freqz(B,1,8192,'whole');
Hx = [Hx(4098:end) ; Hx(1:4097)];
omega = -pi+(2*pi/8192):(2*pi)/8192:pi;

xlim([-pi pi])

Upsample the signal and apply a lowpass filter to remove the imaging artifacts. Plot the magnitude spectrum.

y = interp(B,2);
[Hy,W] = freqz(y,1,8192,'whole');
Hy = [Hy(4098:end) ; Hy(1:4097)];

hold on
legend('Original Signal','Upsampled Signal')

Upsampling still contracts the spectrum, but the imaging artifacts are removed by the lowpass filter.

See Also

| |