Concatenation of interpolation and decimation doesn't work

2 views (last 30 days)
Ahmad ElMoslimany
Ahmad ElMoslimany on 25 Nov 2019
Answered: Kaashyap Pappu on 28 Nov 2019
I have a simple question, I have a random sequence that I am going to interpolate, process the upsampled version and then decimate. I have observed that matlab functions interp and decimate doesn't work as expected. For instance,
x = randn(1,100);
y = interp(x,4);
z = decimate(y,4);
u = abs(z-x)
I was expecting that u will be zeros but it is not. Anyone can explain this to me?

Answers (1)

Kaashyap Pappu
Kaashyap Pappu on 28 Nov 2019
Decimation is the process of downsampling, followed by filtering. The MATLAB function, by default, filters the input sequence using a lowpass Chebyshev Type I IIR filter as mentioned. This filtering alters the values of the sequence, which is why you notice the difference from the expected values.
The main motivation in theory is that decimation preserves the spectrum of the signal. If signal is just downsampled, the spectrum expands in the frequency domain. You can observe this by using the periodogram function. Decimate a sequence using a high ‘n’ order filter as shown in the documentation and observe the spectrum of the original sequence and decimated sequence.
Hope this helps!




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!