1 Introduction

In analog nuclear spectrometer systems, to improve the signal-to-noise ratio (SNR) of nuclear pulse processing, a CR–RC\(^m\) circuit is often used to filter the nuclear pulse signal and shape it into a quasi-Gaussian shape [1,2,3]. In digital nuclear spectrometer systems, based on a high-speed analog-to-digital converter (ADC) and a high-performance field-programmable gate array (FPGA), the filtering of a nuclear pulse signal is often realized using a digital algorithm. Triangular filters, trapezoidal filters, and cusp-like filters are widely used in digital nuclear pulse processing [4,5,6,7,8,9,10,11]. Owing to the simple implementation and high SNR of a Gaussian filter, it is an important digital filter shaping method. The method mainly includes a time domain based on the digital Sallen–Key [12,13,14,15,16] and a transfer function based on CR–RC\(^m\) [17]. The digital Gaussian filter based on CR–RC\(^m\) is often used in digital nuclear spectrometer systems, owing to its superior performance and simple shaping principle and method. Based on the basic principles of CR and RC circuits, a recursive model of the digital filter shaping algorithm is derived. Furthermore, the actual sampled nuclear signal is processed using the CR–RC\(^m\) filter, and the effect of the digital filter is analyzed based on the amplitude–frequency response characteristics. The performance is compared and analyzed in terms of the energy resolution and pulse count rate under different forming parameters.

2 Filter shaping principle of CR–RCm

The CR–RC\(^m\) filter shaping circuit used in nuclear energy spectrum measurement systems is shown in Fig. 1. In this figure, \(V_{\text {in}}\) is the input of the circuit, CR is the differential circuit (high-pass filter circuit), RC is the integral circuit (low-pass filter circuit), and \(V_{\text {out}}\) is the output of the circuit. The input nuclear pulse signal is shaped into a quasi-Gaussian shape by the circuit.

Fig. 1
figure 1

Circuit of a CR–RC\(^m\) filter

As shown in Fig. 1, R\(_1\)C\(_1\) = R\(_2\)C\(_2\) = R\(_m\)C\(_m\) = \(\tau\). \(V_{\text {in}}\) (as a function of the time t) is the input signal. When it is a step signal, it is represented by Eq. (1) in the time and complex frequency domains, where Q is a charge and \(C_i\) is an input capacitor.

$$\begin{aligned} V_{\text {in}}(t) = \frac{Q}{C_i} u(t) \Rightarrow V_{\text {in}}(s) = \frac{Q}{C_i} \cdot \frac{1}{S}. \end{aligned}$$
(1)

The transfer function of CR differential shaping is

$$\begin{aligned} H_{{\text {CR}}}(s) = \frac{S \tau }{1 + S \tau }. \end{aligned}$$
(2)

The transfer function of RC integral shaping is

$$\begin{aligned} H_{{\text {RC}}}(s) = \frac{1}{1 + S \tau }. \end{aligned}$$
(3)

From Eqs. (2) and (3), the output is

$$\begin{aligned} V_{\text {out}}(s)&= \frac{Q}{C_i} \frac{\tau }{(1+S\tau )^{m+1}} \nonumber \\ \Rightarrow V_{\text {out}}(t)&= \frac{Q}{C_i m!}\left( \frac{t}{\tau }\right) ^m e^{-\frac{t}{\tau }}. \end{aligned}$$
(4)

If the input signal \(V_{\text {in}}\) is a negative exponential signal, it is necessary to add a pole-zero cancelation circuit before the differential shaping to achieve Gaussian shaping of the nuclear pulse signal [18].

3 Derivation of algorithm of CR–RC\(^m\) digital filter

A CR–RC\(^m\) filter consists of a CR high-pass filter and m RC low-pass filters. To digitize the nuclear signal more effectively, the CR and RC circuits are separately digitized [19, 20].

  1. 1.

    The differential equation for CR high-pass circuits according to Kirchhoff’s current law (KCL) is shown in Eq. (5).

    $$\begin{aligned} \frac{{\mathrm {d}}V_{\mathrm{i}}(t)}{{\mathrm {d}}t} = \frac{V_{{\text {o}}}(t)}{\mathrm{CR}} + \frac{{\mathrm {d}}V_{{\text {o}}}(t)}{{\mathrm {d}}t}, \end{aligned}$$
    (5)

    where \(V_{{\text {i}}}(t)\) and \(V_{{\text {o}}}(t)\) are the input and output signals of the CR circuit, respectively. For the discrete signal sequence digitized by the high-speed ADC, \(V_{\text {i}}(t)\) is converted into a digital sequence X[n], and \(V_{{\text {o}}}(t)\) is converted into a digital sequence Y[n]. The derivation can yield the digital recursive formula shown in Eq. (6).

    $$\begin{aligned} Y[n]=k(X[n]-X[n-1])+k \cdot Y[n-1]. \end{aligned}$$
    (6)

As shown in Eq. (6), \(k = {\mathrm{CR}}/({\mathrm{CR}}+T)\), where T is the sampling period of the ADC. Thus, the transfer function in the z-domain of the CR high-pass filter and its frequency response function are [20, 21] expressed as follows:

$$\begin{aligned} H_{{\text {CR}}}(z)&=k \frac{1-z^{-1}}{1-k\cdot z^{-1}} \nonumber \\ \Rightarrow H_{{\text {CR}}}(e^{jw})&=k\frac{1-e^{-jw}}{1-ke^{-jw}}. \end{aligned}$$
(7)

In Eq. (7), w is the angular frequency of the component signal, and Euler’s formula transformation for Eq. (7) is shown in Eq. (8).

$$\begin{aligned} H_{{\text {CR}}}(e^{jw})=k\frac{1-\cos (w)+j \cdot \sin (w)}{1-k(\cos (w)+j \cdot \sin (w))}. \end{aligned}$$
(8)

The modulo of Eq. (8) is shown in Eq. (9).

$$\begin{aligned} |H_{{\text {CR}}}(e^{jw})| = k \frac{\sqrt{2-2 \cos (w)}}{\sqrt{1+k^2-2k\cdot \cos (w)}}. \end{aligned}$$
(9)
  1. 2.

    The digital recursive equation, frequency response function, and modes of the RC low-pass circuit according to the same principle are shown in Eqs. (10)–(12), respectively.

    $$\begin{aligned} Y[n]=(1-k)\cdot X[n]+k\cdot Y[n-1], \end{aligned}$$
    (10)
    $$\begin{aligned} H_{{\text {RC}}}(e^{jw})= \frac{1-k}{1-k\cdot \cos (w)+j\cdot k\cdot \sin (w)}, \end{aligned}$$
    (11)
    $$\begin{aligned} |H_{{\text {RC}}}(e^{jw})| = \frac{1-k}{\sqrt{1+k^2-2k\cdot \cos (w)}}. \end{aligned}$$
    (12)

As shown in Eq. (10), \(k ={\mathrm{RC}}/({\mathrm{RC}}+T)\), where T is the sampling period of the ADC.

According to Eqs. (8) and (11), the frequency response function of the CR–RC\(^m\) filter is shown in Eq. (13).

$$\begin{aligned} H(e^{jw}) = \frac{(1-k)^m \cdot k \cdot (1-k \cos (w)+j \cdot k \cdot \sin (w))}{1-k\cdot \cos (w)+j\cdot k\cdot \sin (w)}. \end{aligned}$$
(13)

The modulo of Eq. (13) is shown in Eq. (14).

$$\begin{aligned} |H(e^{jw})|= \frac{(1-k)^m\cdot k\cdot \sqrt{2-2\cos (w)}}{\left( \sqrt{1+k^2-2k\cdot \cos (w)} \right) ^{m+1}}. \end{aligned}$$
(14)

Based on the SNR coefficient of the CR–RC\(^m\) filter, \(F= \frac{m!e^m}{m^m} (2m-1)^{\frac{1}{4}} \left[ \frac{(2m-3)!!}{2(2m)!!} \right] ^{\frac{1}{2}}\), for \(m=1\), \(F=1.36\); for \(m=2\), \(F=1.22\); for \(m=3\), \(F=1.18\); for \(m=4\), \(F=1.17\); and for \(m=5\), \(F=1.16\). Thus, with the increase in the parameter m, the change in the parameter F is small, and the filtering system becomes more complicated. Therefore, in practical applications, the parameter m is generally 3 or 4. For the value of the parameter k, the sampling period of the high-speed ADC is generally 100 ns, 50 ns, and 20 ns in the digital nuclear energy spectrum. When \({\mathrm{RC}}=\tau ={1}\,{\upmu }{\hbox {s}}\), the corresponding k values are \(k=0.91\), \(k=0.95\), and \(k=0.98\). According to Eqs. (9) and (12), the frequency response curve of the CR and RC filters is shown in Fig. 2.

Fig. 2
figure 2

(Color online) Frequency response curve of CR and RC filters (different k values)

As shown in Fig. 2, the amplitude–frequency response curve of the CR filter shows an incremental increase in frequency. As the value of k increases, the response curve rises faster, and it approaches 1 sooner. The amplitude–frequency response curve of the RC filter shows a decline. As the value of k increases, the response curve falls faster, and it approaches zero sooner. When \(m=3\), \(k=0.91\), \(k=0.95\), and \(k=0.98\), the frequency response curve of CR–RC\(^m\) is shown in Fig. 3. When \(k=0.95\), \(m=2\), \(m=3\), and \(m=4\), the frequency response curve of CR–RC\(^m\) is shown in Fig. 4.

Fig. 3
figure 3

Frequency response curve of the CR–RC\(^3\) filter (different k values)

As shown in Figs. 3 and 4, the frequency response curve of the digitized CR–RC\(^m\) filter shows that it is a bandpass filter. The parameters m and k can be used to adjust the bandpass region of the filter, and the larger the values of m and k, the narrower is the bandpass region.

Fig. 4
figure 4

(Color online) Frequency response curve of the CR–RC\(^m\) filter (different m values)

4 Algorithm implementation

\(^{137}\)Cs is measured using the CH249-02 NaI detector (Hamamatsu). The high voltage is \(+\) 560 V, and the output pulse of the signal conditioning circuit is approximately 10 \(\upmu\)s. USB-5133 (National Instruments Corporation) is used to obtain the original nuclear pulse signal. (The sampling rate is 50 MHz.) According to the numerical recursive formula of the CR–RC\(^m\) filter, for \(m=3\), the CR–RC\(^m\) shaping results under different k values are as shown in Fig. 5.

Fig. 5
figure 5

(Color online) Actual nuclear pulse signal of CR–RC\(^m\) shaping

As shown in Fig. 5, with the increase of parameter k, the rising edge of the CR–RC\(^m\) is gentler, and the closer to a Gaussian shape, the lower the pulse amplitude; however, for longer pulse shaping time, the generalization of the pileup occurs, and the original signal is a negative exponentially decreasing signal. After CR differential shaping, a certain degree of zero-crossing signal is present. For a pulse with a small k value or for a long interval of the original pulse, there is no pulse pileup. The undershoot signal of zero has no effect on the subsequent pulse amplitude extraction. The k value is too large, and the longer the shaping time, the higher is the pileup probability. Furthermore, the undershoot of the zero crossing directly affects the amplitude extraction of subsequent adjacent pulses [22].

5 Test and analysis of CR–RCm filter performance

The LaBr\(_3\)(Ce) detector (Beijing Huakailong’s \(2^{\prime \prime }\times 2^{\prime \prime }\)) is used to measure the \(^{137}\)Cs energy spectrum. The ADC sampling rate is 20 MHz. For the same batch of sampling pulse data, when \(m=3\), \(k=0.91\), \(k=0.95\), and \(k=0.98\), the energy spectrum is shown in Fig. 6.

Fig. 6
figure 6

(Color online) Energy spectrum of \(^{137}\)Cs (partial channels)

As shown in Fig. 6, to demonstrate the energy spectrum results under different k values more clearly, the data of partial channels are displayed. Similarly, when \(k=0.95\), \(m=2\), \(m=3\), and \(m=4\), the statistical analysis of the energy resolution and the full energy peak area of the energy spectrum is shown in Table 1.

Table 1 Performance comparison of different shaping parameters

As shown in Table 1, for the same batch of pulses, after the CR–RC\(^m\) digital filter shaping process under different parameters, with the increase in k and m values, the energy resolution is increased. This is because the width of the shaping pulse is too large, and the full energy peak area of the energy spectrum is lowered owing to the pileup identification [23].

From Table 1, when \(m=3\) and \(k=0.91\), the energy resolution and the full energy peak area are, respectively, 3.8% and 7815; when \(m=3\) and \(k=0.95\), the energy resolution and the full energy peak area are, respectively, 3.6% and 7362; when \(m=3\) and \(k=0.98\), the energy resolution and the full energy peak area are, respectively, 3.5% and 6537; when \(k=0.95\) and \(m=2\), the energy resolution and pulse counting rates are, respectively, 3.7% and 7471; when \(k=0.95\) and \(m=4\), the energy resolution and the full energy peak area are, respectively, 3.6% and 6503.

6 Conclusion

CR–RC\(^m\) digital filters are widely used in digital nuclear energy spectrum measurement systems. The filter parameters directly affect the energy resolution and pulse count rate of the system. The numerical recursive algorithm of digital filtering of CR and RC is based on KCL. The measured signal is processed by the CR–RC\(^m\) digital filter, and the energy resolution and maximum pulse of the system are obtained under different k and m values in the energy spectrum of \(^{137}\)Cs. From the comparative analysis, combined with the above indicators, it is determined that if the system requires high energy resolution, the values of k and m can be larger. Moreover, when it requires a high count rate, the values of k and m can be smaller. When the system needs to balance the performance of both, the optimal parameters of the CR–RC\(^m\) digital filter are \(k = 0.95\) and \(m=3\). The relevant results can provide a design reference for further use of the CR–RC\(^m\) digital filter.