# Downsampling( decimation) theory: additional frequency

I work on a simulation decimation filter: downsampling + filter.

My test environment: low data rate receiver, BPSK, square root raised cosine filter with cutoff frequency =0.5, transition bandwidth = 0.2, sampling frequency = 4 and 21 taps.

I am not an expert in signal processing but I have to know some stuff.

My question is about downsamplig step. Downsampling for me as software engineer means that I need discard N sample between two samples.

I implemented in this way decimation and got additional frequencies. Matlab simulation doesn’t give these frequencies.

If I sum up, it will work as in Matlab.

Example: ​ where o - sample i use, x samples I discard

I sum sample "o" and 3 samples "x" up if a downsampling factor is 4. Resultant is a new sample =^ "0"

This works in FPGA, but I cant understand it why it works...could someone gives me an explanation or if this operation exists how can I seach information about it?

• Did you apply lowpass filtering before downsampling? – ZR Han Jun 17 at 9:16
• @ZRHan yes, I did – LeeLeeYa Jun 17 at 9:19
• So i didn't quite understand what your question is. MATLAB and FPGA both work, where did you get the additional frequencies? – ZR Han Jun 17 at 9:22
• Since your downsampling factor is 4, the new sampling frequency is 1 and the Nyquist frequency is 0.5. You need a lowpass filter with lower cutoff frequency instead of 0.5. – ZR Han Jun 17 at 9:27
• @ZRHan In FPGA simulation I remove N-1 samples, where N is decimation factor. In this case I got additional frequencies. I fixed it by using summation , but It should be explained in theory...why do additional frequency appear if i remove samples? Why does addition fix it? – LeeLeeYa Jun 17 at 9:27

Doing the summation is the necessary low pass filter step prior to decimation, and an ideal decimation approach when the noise is white (evenly spread across frequency). What this does is ensure that every signal component of every sample is included while the noise gets reduced through averaging (summing is averaging just without the scaling by dividing by the number of samples): when you sum, the value for coherent values (the mean) goes up by the number of samples $$N$$, while the standard deviation of the noise component goes up by $$\sqrt{N}$$ .

So this would be the best and typical approach to decimation when there isn't a particularly strong interference present out of band: sum all samples over the decimation interval first, and then down-sample by selecting every Dth sample.

(Note that CIC decimating filters do this specifically).

I explain this further in the following slides showing decimation as the combination of requisite filtering with down-sampling:   A moving average filter of N taps places it's rejection nulls at the ideal location for a decimate by N operation! The numerical example of this for the case of decimate by four is the output samples $$m$$ are selected from the input samples $$n$$ as follows, with $$n$$ indexing at four times the rate of $$m$$, so for every four $$n$$ samples we get one $$m$$ sample:

Four point moving average:

$$y[n] = \frac{x[n]+x[n-1]+x[n-2]+x[n-3]}{4}$$

Select (down-sample) every fourth sample:

$$w[m] = y[4m]$$

The above shows the direct approach, but as suggested in the graphic the cascade-integrator-comb (CIC) decimator does this exact computation more efficiently. There are other posts here that further detail such decimation approaches.

• let say I have the following samples: s1, s2, s3, s4, ..., The decimation factor is 4. my first step d1 = s1+s2+s3+s4, d2 = s5+s6+s7+s8, ... d3=...., d4=.... d5, d6. The next step is d1,d5,d9....i.e Should I remove sums between ? – LeeLeeYa Jun 17 at 14:45
• @LeeLeeYa You want to do a moving sum of the sample with the previous 3 samples, and then remove every three samples of that result and keep the fourth. That said, you can simply sum every four samples and keep the result and then skip ahead four samples and repeat. It's the same result with less processing. – Dan Boschen Jun 17 at 15:02
• sorry...i cant understand it..."sum all samples over the decimation interval first, and then down-sample by selecting every Dth sample." Could you give a numerical or schematic example? – LeeLeeYa Jun 21 at 14:53
• Yes I will be happy to later when I am back at my computer – Dan Boschen Jun 21 at 14:58
• thank you in advance! – LeeLeeYa Jun 22 at 5:33