# Design and Test of Real-Time Detection System for Cleaning Loss of Rapeseed Harvester
## 2 Materials and Methods
### Signal Processing Circuit Design
#### 2.3.5 Energy Distinction Method to Identify Kernels and Impurities  
The core purpose of this signal processing circuit is to calculate the differences in energy between kernels and different impurities using a hardware integration method. According to the energy distinction of rapeseed kernels, carob shells and short stems, the voltage comparison circuit was designed to select the threshold value of signals of different energies and finally realize the recognition of kernels and impurities. The principle of the energy distinction method is that the original signals of the seeds and impurities (carob shells, short stems) are processed by the charge amplification and envelope detection components of the signal processing circuit and then enter the in-phase integral circuit for the integration calculation. The integration circuit calculates the integral (area) of the input envelope detection circuit and obtains the integral operation results (integral voltage values) of kernels and different impurities, respectively. The waveform diagrams of the original, amplified, detected and integrated signals of the three types of signals are shown in Figure 8.  
Figure 8a-c are the results obtained using an oscilloscope from the amplifier, envelope detection and integration parts of the circuit for the impact signals generated by carob shells, kernels and short stems, respectively. Among them, the signal results displayed by the four channels of the oscilloscope are, respectively, the original impact signals and the results obtained by the amplifier, envelope detection and integration of the three module circuits in turn, which are, respectively, displayed in orange, blue, purple and green.  
When the above three types of signals are processed using the integration circuit, different integral voltage values are obtained, and the integral voltage output by the integration circuit is used as the input signal of the triple voltage comparison. The triple voltage comparison converts the input signals into three types of pulse signals of different conditions, which are used as the final output signals of the signal processing circuit. The output waveform diagrams of the three different types of signals are shown in Figure 9.  
Figure 9a-c, respectively, show the output results of the integral output signals of the carob shell, the kernel and the short stem collected by the oscilloscope from the voltage comparison module of the circuit. Among them, the signal results displayed by the three channels of the oscilloscope are the following: The output results showing only the yellow pulse signal indicate that the input signal of the voltage comparison module is the carob shell impact signal processed by the integral circuit, and the output results showing the yellow and blue pulse signals indicate that the input signal of the voltage comparison module is the kernel impact signal processed by the integral circuit. The output results  
Figure 8: Processing waveform diagrams of three types of signals: (**a**) carob shell; (**b**) kernel; (**c**) short stem.  
showing the yellow, blue and purple pulse signals indicate that the input signal of the voltage comparison module is the short stem impact signal processed by the integral circuit.