An integrator is a very important filter that proves useful in implementation of many blocks of a communication receiver. In continuous-time case, an integrator finds the area under the curve of a signal amplitude. A discrete-time system deals with just the signal samples and hence a discrete-time integrator serves the purpose of collecting a running sum of past samples for an input signal. Looking at an infinitesimally small scale, this is the same as computing the area under the curve of a signal sampled at an extremely high rate. For the following discussion, we assume a normalized sample time $T_S =1$.

For an input $s[n]$ and output $r[n]$, there are three main methods to implement a discrete-time integrator.

[Forward difference] The forward difference integrator is realized through the following equation.

\begin{align}

r[n] &= \sum _{i=-\infty}^{n} s[i] \nonumber \\

&= \sum _{i=-\infty}^{n-1} s[i] + s[n] \nonumber \\

&= r[n-1] + s[n] \label{eqIntroductionForwardIntegrator}

\end{align}

For obvious reasons, the running sum $r[n-1]$ is a common component in all types of integrators; the differentiating factor is the term added to $r[n-1]$ as a replacement for area under the curve. For a forward difference integrator, this additional term is $s[n]$ — the current input. This is drawn in Figure below. Notice that the forward difference integrator computes its output after the arrival of the current sample, i.e., at time $n$.

The block diagram shown in the figure is used to implement a forward difference integrator in loop filter portion of a Phase Locked Loop (PLL) that is employed in carrier phase and symbol timing synchronization systems of a digital communication system.

[Backward difference] The backward difference integrator is realized through the following equation.

\begin{equation}\label{eqIntroductionBackwardIntegrator}

r[n] = r[n-1] + s[n-1]

\end{equation}

Here, the term added to $r[n-1]$ is the previous input $s[n-1]$. This is also illustrated in the Figure above. In contrast to the forward difference case, the backward difference integrator can compute its output after the last sample, i.e., at time $n-1$. This minor dissimilarity plays a huge role in analyzing the performance of the actual discrete-time system where the integrator is employed (refer to any DSP text to understand the role of poles and zeros of a system).

The block diagram shown in the figure is used to implement a backward difference integrator in a Numerically Controlled Oscillator (NCO) of a Phase Locked Loop (PLL).

[Average of a backward and forward difference] A third integrator can be implemented as

\begin{equation*}

r[n] = r[n-1] + \frac{1}{2}\left(s[n-1]+s[n]\right)

\end{equation*}

An integrator maintains a running sum of past samples. In time domain, the summation of a large number of values tends towards a mean value. When some numbers are small, some are large and some are in between, their running sum naturally pulls large variations towards the middle, thus smoothing them out. Large variations represent high frequencies and smoothing out such variations is the function of a lowpass filter.

To verify this fact in frequency domain, first consider that when an impulse is given as input to an integrator in time domain, it again forms a running sum of the impulse, which is a unit step signal. Hence, its impulse response is a unit step signal. The unit step signal is very wide in time domain, so it must be narrow in frequency domain. Consequently, it filters out the high frequency terms and passes only the low frequency content. We can say that it acts as a lowpass filter.

what software do you use to generate your plots and block diagram?

I’m using Matlab and Visio. However, Python has very powerful plotting libraries as well.