# Decimation FFT Result

In my Signal Processing class we just learned decimation however after messing around in Matlab trying an example of decimation, I just can't understand what's happening.

I get the introducing twi zeros between samples and the after filtering steps however I don't get how the original signal comes to look like that in the decimated step(EDIT: M=3).

• axis labels would make this way easier. But anyway, this is very likely simply aliasing. – Marcus Müller Sep 10 '20 at 9:39

These are the frequency spectrums and the OP is seeing the effects of decimation (upper figure) and interpolation (lower figure). Note the frequency plots are the magnitude of the DFT result, so the left half of the spectrum represents the positive frequencies from $$0$$ (DC) to $$F_s/2$$ (where $$F_s$$ is the sampling rate) and the left half represents the negative frequencies from $$-F_s/2$$ to $$0$$ (nearly so, the bin at "0" only appears once as the first bin). We start with the spectrum in the upper left, which gets decimated to be the spectrum in the upper right. This decimated waveform is then interpolated as shown in the lower two plots recovering the original signal in the spectrum in the lower right. Imperfections in the interpolation filter result in the degraded noise floor in the final result (spectral leakage), suggesting the filter used was far from ideal for interpolation (especially given this isn't a log magnitude plot!).
Interpolation by I is first inserting $$I-1$$ zeros in between every sample which creates 2 image replicas of the spectrum in between the original images (which is what we see happen in the plot on the lower left), which must then be filtered to complete the full interpolation operation (the filter if done right will grow those zeros to the ideal interpolated sample). Interpolation without the filter operation is simply "Upsampling".