Broiler chicken sound signal filtering method and system integrating wavelet denoising and pulse extraction
The broiler sound signal is processed through wavelet noise cancellation and two-stage variable multi-threshold pulse extraction algorithms, which solves the problem of insufficient targeting of existing filtering methods, and realizes efficient filtering of broiler sound signals and retains effective signal components, improving signal quality and machine learning classification accuracy.
Patent Information
- Application Number
- CN202311371819.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-20
- Publication Date
- 2025-07-08
AI Technical Summary
The existing broiler sound signal filtering methods are not targeted, resulting in poor filtering effect, unable to effectively remove noise and retain effective signal components.
The method of fused wavelet noise cancellation and two-stage variable multi-threshold pulse extraction is adopted to process the broiler sound signal through wavelet noise cancellation and two-stage variable multi-threshold pulse extraction algorithm, and wavelet noise cancellation is performed using continuous differentiable threshold function and scale threshold, and the two-wheel pulse extraction is combined with precise extraction of useful pulses.
It significantly improves the filtering effect of broiler sound signals, removes widespread distribution and accidental noise, improves signal quality, and provides a better foundation for subsequent feature extraction and machine learning classification.
Smart Images

Figure CN120279922A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of sound signal processing, and particularly relates to a filtering method and system for broiler chicken sound signals. Background Art
[0002] Broiler chickens are a type of animal. They are the most commonly raised poultry by humans and are also an important source in the meat consumption market. The health status of broiler chickens directly determines the quality of chicken meat and has an important impact on the safety of meat food. At the same time, poultry diseases represented by broiler chickens are highly contagious and pose an important threat to human health. Therefore, it is crucial to monitor the health of broiler chickens during the breeding process. The health monitoring method based on sound signals has become the mainstream method or technology for current broiler chicken health monitoring due to its advantages such as non-invasive, non-contact, and weak interference.
[0003] Many scholars have carried out research on the health monitoring of broiler chickens based on sound signals. For example, Du et al. developed a monitoring system using a Kinects microphone array to automatically monitor the abnormal sounds emitted by broiler chickens during the experiment, which was used to feedback their abnormal behaviors and provide a reference for broiler chicken health monitoring. Voslarova et al. analyzed the noise levels of the sound signals emitted by broiler chickens at different fattening stages, obtained the changing trend of the body weights of broiler chickens, and roughly judged the health status of broiler chickens. Yang et al. analyzed the sound signals emitted by broiler chickens of different ages, determined the frequency ranges of six common sound categories, including bird vocalizations, fans, feeding systems, heaters, wing flapping, and bathing, and obtained the relationship between sound categories of different frequencies and ages. This is helpful for farm managers to continuously monitor the health and behaviors of broiler chickens. The rapid popularization and application of machine learning have brought new ideas to the research on broiler chicken health monitoring. The main problem solved by machine learning is the classification problem. By finding the attribute differences existing between the objects to be classified, using feature engineering to quantify the attribute differences and then constructing a feature data set, and training a suitable classifier to achieve the classification of feature data, the purpose of classifying different objects can be indirectly achieved. Specifically, there are acoustic property differences between the sound signals or sound categories emitted by healthy broiler chickens and diseased broiler chickens. The present invention can quantify these differences to construct a feature data set and train a classifier to achieve the classification of different sound signals or sound categories, and further achieve the identification of abnormal vocalizations and health monitoring. Many scholars have carried out related research. For example, Carpentier et al. identified the sneezing sound in the broiler chicken sound signal as the sound category emitted by diseased broiler chickens, and identified the other sound categories in the signal as those emitted by healthy broiler chickens. By extracting eight sound features to quantify the sound property differences between the two sound categories, the linear discriminator trained achieved a classification accuracy of 88.4%. Mahdavian et al. collected the sound signals emitted by healthy broiler chickens, as well as the sound signals emitted by broiler chickens suffering from bronchitis and Newcastle disease respectively. By extracting five sound features to quantify the sound property differences between the sound signals of healthy broiler chickens and the sound signals of the two diseased broiler chickens, the support vector machine trained achieved a classification accuracy of 83%. Cuan et al. collected the sound signals emitted by healthy broiler chickens and broiler chickens suffering from Newcastle disease. By extracting the Mel frequency cepstral coefficients to quantify the acoustic property differences between the two sound signals, the BiLSTM trained achieved a classification accuracy of more than 80%.
[0004] In previous studies, through signal detection technology, it was determined that the broiler chicken sound signals collected on-site mainly included four sound categories, namely crowing, coughing, grunting, and flapping. Among them, in the sound signals emitted by healthy broiler chickens, the coughing sound appeared at a relatively low frequency, and in most cases, only the other three sound categories were included. While in the sound signals emitted by diseased broiler chickens, the coughing sound appeared at a relatively high frequency, and in most cases, only the coughing sound and the grunting sound were included, and the crowing sound and the flapping sound were rarely included. Because the physical condition of diseased broiler chickens is relatively poor, it is difficult for them to engage in exciting or fighting behaviors. Therefore, accurately identifying the sound categories in a broiler chicken sound signal, counting the number of each sound category, and then obtaining the frequency of the coughing sound can be used as an important basis for judging the health status of broiler chickens. To achieve the above-mentioned health monitoring, it is necessary to identify the sound categories in the broiler chicken sound signal, which is essentially a classification of different sound categories and belongs to the classification problem of machine learning. In previous studies, the authors extracted sound features from four aspects: time domain, frequency domain, Mel-frequency cepstral coefficients, and sparse representation to quantify the acoustic characteristic differences between the four sound categories, trained seven classifiers, obtained the optimal k-nearest neighbor, and achieved the highest classification accuracy of 94.16%. In subsequent studies, the authors expected to further improve the superiority and stability of the classifier to ensure that it can still obtain reliable classification results when facing unfamiliar data in real application scenarios. The authors shifted the research focus from the classifier to the feature dataset and carried out a series of feature optimization studies, slightly improving the classification accuracy. In machine learning, the main factors affecting the classification performance of the classifier include the feature dataset, classification algorithm, and internal parameters. Training a classifier based on a suitable classification algorithm on a high-quality feature dataset and optimizing its internal parameters can obtain a classifier with good performance. This was also the content that the authors focused on before. However, the feature dataset is constructed based on the sound signal and is the source affecting the classification performance of the classifier. Usually, the better the quality of the sound signal, the higher the quality of the constructed feature dataset, and the more superior the performance of the classifier trained thereby. But the characteristics of the broiler chicken sound signal itself have not been noticed in previous studies.
[0005] During the signal acquisition process, the signal acquisition system or sensors placed in the broiler chicken breeding area will inevitably capture some on-site noises into the broiler chicken sound signals at the same time, including the sounds of mechanical equipment operation, the sounds of breeders walking, the sounds of natural phenomena such as wind, rain, thunder and lightning, etc. These noises will seriously interfere with the analysis of broiler chicken sound signals. Especially in the research on broiler chicken health monitoring based on sound signals and machine learning, these noises will damage the completeness of the feature data set, making there be some missing values or abnormal values in the feature data set. Therefore, filtering the broiler chicken sound signals to retain the effective signal components therein provides a guarantee for the subsequent construction of the feature data set and the training of the classifier. However, there is still very little research on the filtering of broiler chicken sound signals at present. For example, in the research of Carpentier et al., they processed the broiler chicken sound signals using the basic spectral subtraction method, but did not give detailed processing results. In the research of Cuan et al., they newly proposed an improved spectral subtraction method based on multi-window spectral estimation and combined it with high-pass filtering to reduce the noise in the broiler chicken sound signals, but also did not give reference processing results. Sun et al. processed the broiler chicken sound signals using four signal filtering algorithms respectively, including: basic spectral subtraction, improved spectral subtraction, Wiener filtering, and sparse decomposition, and gave the evaluation results of the signal-to-noise ratio and the root mean square error, and obtained that Wiener filtering achieved the best filtering effect.
[0006] It can be seen that there is still relatively little research on the filtering of existing broiler chicken sound signals, and existing research all uses some traditional and general signal filtering methods to process the entire broiler chicken sound signal, filtering out obvious and strong noises in the entire signal space, not noticing the noises in the form of pulses in the signal, nor deeply analyzing the dedicated signal characteristics, and selecting applicable signal filtering methods on this basis. Those unobvious and stubborn noises either overlap with the effective signal components in the broiler chicken sound signals or appear as pulses similar to the effective signal components. Since the traditional signal filtering method processes the entire broiler chicken sound signal, in this way, during the processing, if they implement a relatively loose filtering policy, it will hardly work on these stubborn noises. But if a relatively strict filtering policy is adopted, it will damage both the effective signal components and the noises at the same time. The existing filtering effect is not ideal, so it is necessary to analyze the signal characteristics of the broiler chicken sound signals, especially the effective signal components, in order to find out the differences between the effective signal components and the noises, and map them to a higher-order spatial domain for decomposition, so as to achieve the purpose of removing the noises and reconstructing the effective signal components. Summary of the Invention
[0007] The present invention aims to solve the problem that when filtering broiler chicken sound signals using the existing sound signal filtering methods, the filtering effect is poor due to the lack of pertinence.
[0008] A filtering method for broiler sound signals that combines wavelet denoising and pulse extraction. For broiler sound signals, first perform wavelet denoising, and then use a two-stage variable multi-threshold pulse extraction algorithm for pulse extraction;
[0009] During the process of wavelet denoising, the threshold function used is as follows:
[0010]
[0011] Among them, λ(x) represents the threshold function, x represents the independent variable, and T represents the threshold;
[0012] During the process of using the two-stage variable multi-threshold pulse extraction algorithm for pulse extraction, two rounds of pulse extraction are carried out. In the first round of pulse extraction, the peak energy threshold is used to find the peaks of useful pulses, and at the same time, the first endpoint energy threshold and the first endpoint zero-crossing rate threshold are used to find the starting point and ending point of useful pulses; in the second round of pulse extraction, based on the results of the first round of pulse extraction, the second endpoint energy threshold and the second endpoint zero-crossing rate threshold are used to accurately find the starting point and ending point of useful pulses again.
[0013] Furthermore, the threshold T adopts an adaptive scale threshold, and the calculation process is as follows:
[0014]
[0015] Among them, σ is the standard deviation of the noise, N represents the number of sampling points in the sound signal, and i is the wavelet decomposition scale.
[0016] Furthermore, the specific process of wavelet denoising includes the following steps:
[0017] First, perform wavelet decomposition on the noisy broiler sound signal to obtain a set of wavelet coefficients; then perform threshold quantization processing on the high-frequency coefficients of each layer of the wavelet decomposition to obtain the estimated values of the wavelet coefficients; then perform inverse wavelet transform on the wavelet coefficients after threshold quantization processing to reconstruct the sound signal and obtain the denoised sound signal.
[0018] Furthermore, the process of the first round of pulse extraction includes the following steps:
[0019] S101: Calculate the average energy and average zero-crossing rate of the entire sound signal, denoted as E a and Z a , calculate the standard deviation of the energy and the standard deviation of the zero-crossing rate of the entire sound signal, denoted as σ E and σ z ; set the peak energy threshold as E p =E a +3σ E , set the first endpoint energy threshold as Ebe_1 = E a + σ E Set the zero-crossing rate threshold of the first endpoint to Z be_1 = z a + σ Z ;
[0020] S102: Frame the voice signal and calculate the energy and zero-crossing rate of each frame signal;
[0021] S103: Starting from the first frame signal, compare the energy of each frame signal with E p ; When the energy of a certain frame signal is greater than E p , starting from this frame signal, continue to compare the energy of each subsequent frame signal with E p until the energy of a certain frame signal is less than E p ; Find the frame signal with the maximum energy among these frame signals and identify it as the peak of the current useful pulse; Obtain the time of this frame signal, which is called the peak time t of the current useful pulse p ;
[0022] S104: Using the peak time t of the useful pulse currently extracted in S103 p as the starting point, compare the energy of each frame signal with E be_1 respectively forward and backward until it is found that the energy of a certain frame signal is less than E be_1 in both directions; Identify the previous frame signal of each of these two frame signals as the first candidate start frame signal and the first candidate end frame signal of the current useful pulse respectively; Obtain the times of these two frame signals, which are called the first candidate start time t b_f1 and the first candidate end time t e_f1 ;
[0023] S105: Using the peak time t of the useful pulse currently extracted in S103 p as the starting point, compare the zero-crossing rate of each frame signal with Z be_1 respectively forward and backward until it is found that the zero-crossing rate of a certain frame signal is less than Z be_1 in both directions; Identify the previous frame signal of each of these two frame signals as the first candidate start frame signal and the first candidate end frame signal of the current useful pulse respectively; Obtain the times of these two frame signals, which are called the first candidate start time t b_f2 and the first candidate end time t e_f2 ;
[0024] S106: Compare the first candidate start time one and the first start time two, and identify the larger one as the final start time t b_1; Compare the first candidate termination moment 1 and the first termination moment 2, and determine the smaller one as the final termination moment t e_1 ;
[0025] S107: Taking the next frame signal of the larger first candidate termination moment in S106 as the new starting point, repeat S103 to S106 to extract the second useful pulse; and so on until the last frame signal of the sound signal is searched, and the extraction of the first round of useful pulses is completed;
[0026] S108: Calculate the difference between the termination moment and the starting moment of each useful pulse to obtain the duration of each useful pulse; based on the duration threshold T t , remove the useful pulses with a duration greater than the duration threshold, and retain the remaining useful pulses for the second round of pulse extraction.
[0027] Further, the process of the second round of pulse extraction includes the following steps:
[0028] S201: Set the second endpoint energy threshold to E be_2 = E a + 2σ E , set the second endpoint zero-crossing rate threshold to Z be_2 = Z a + 2σ Z ;
[0029] S202: Starting from the first useful pulse retained in S108, taking the spike moment t p of the current useful pulse as the starting point, compare the energy of each frame signal with E be_2 respectively forward and backward until it is found that the energy of a certain frame signal is less than E be_2 in both directions; respectively determine the previous frame signal of these two frame signals as the second candidate starting frame signal and the second candidate termination frame signal of the current useful pulse; obtain the time of these two frame signals, which is called the second candidate starting moment 1 t b_s1 of the current useful pulse and the second candidate termination moment 1 t e_s1 ;
[0030] S203: Starting from the first useful pulse retained in the first round of pulse extraction, taking the spike moment t p of the current useful pulse as the starting point, compare the zero-crossing rate of each frame signal with Z be_2 respectively forward and backward until it is found that the zero-crossing rate of a certain frame signal is less than Z be_2 in both directions; respectively determine the previous frame signal of these two frame signals as the second candidate starting frame signal and the second candidate termination frame signal of the current useful pulse; obtain the time of these two frame signals, which is called the second candidate starting moment 2 tb_s2 and the second candidate termination time 2t e_s2 ;
[0031] S204: Compare the first candidate termination time and the second candidate termination time, and determine the smaller one as the final termination time t e_2 ;
[0032] S205: Starting from the second useful pulse retained in the first-round pulse extraction, repeat the processing steps of S202 to S204; and so on until all the retained useful pulses in the first-round pulse extraction are processed;
[0033] S206: Calculate the difference between the termination time and the starting time of each processed useful pulse to obtain the duration of each processed useful pulse; calculate the ratio of the duration of each processed useful pulse to the duration of the corresponding useful pulse before processing in S108; if the ratio is greater than or equal to the ratio threshold, then the final starting time t b_1 and the final termination time t e_1 are determined as the true final starting time t b and the true final termination time t e of the current useful pulse; if the ratio is less than the ratio threshold, then the final starting time t b_1 in S106 and the final termination time t e_2 in S204 are determined as the true final starting time t b and the true final termination time t e of the current useful pulse;
[0034] S207: Retain the useful pulses after S206 processing to complete the extraction of the second-round useful pulses.
[0035] A broiler sound signal filtering system integrating wavelet denoising and pulse extraction, the system includes a wavelet denoising unit and a two-stage variable multi-threshold pulse extraction unit;
[0036] Wavelet denoising unit: Perform wavelet denoising on the broiler sound signal;
[0037] During the wavelet denoising process, the threshold function used is as follows:
[0038]
[0039] where λ(x) represents the threshold function, x represents the independent variable, and T represents the threshold;
[0040] Two - stage variable multi - threshold pulse extraction unit: The two - stage variable multi - threshold pulse extraction algorithm is used for pulse extraction. During the process of using the two - stage variable multi - threshold pulse extraction algorithm for pulse extraction, two rounds of pulse extraction are carried out. In the first round of pulse extraction, the peak energy threshold is used to find the peaks of useful pulses, and at the same time, the first endpoint energy threshold and the first endpoint zero - crossing rate threshold are used to find the starting point and ending point of useful pulses. In the second round of pulse extraction, based on the results of the first round of pulse extraction, the second endpoint energy threshold and the second endpoint zero - crossing rate threshold are used to accurately find the starting point and ending point of useful pulses again.
[0041] Further, the threshold T adopts an adaptive scale threshold, and the calculation process is as follows:
[0042]
[0043] Where σ is the standard deviation of the noise, N represents the number of sampling points in the sound signal, and i is the wavelet decomposition scale.
[0044] Further, the specific process of wavelet denoising by the wavelet denoising unit includes the following steps:
[0045] First, the noisy broiler sound signal is decomposed by wavelet to obtain a set of wavelet coefficients; then, the high - frequency coefficients of each layer of the wavelet decomposition are subjected to threshold quantization processing to obtain the estimated values of the wavelet coefficients; then, the wavelet coefficients after threshold quantization processing are subjected to inverse wavelet transform to reconstruct the sound signal, and the denoised sound signal is obtained.
[0046] Further, the process of the first round of pulse extraction in the two - stage variable multi - threshold pulse extraction unit includes the following steps:
[0047] S101: Calculate the average energy and average zero - crossing rate of the entire sound signal, denoted as E a and Z a , calculate the standard deviation of the energy and the standard deviation of the zero - crossing rate of the entire sound signal, denoted as σ E and σ z ; Set the peak energy threshold as E p = E a +3σ E , set the first endpoint energy threshold as E be_1 = E a +σ E , set the first endpoint zero - crossing rate threshold as Z be_1 = Z a +σ Z ;
[0048] S102: Frame the sound signal and calculate the energy and zero - crossing rate of each frame signal;
[0049] S103: Starting from the first frame signal, compare the energy of each frame signal with E in sequence p ; When the energy of a certain frame signal is greater than E p , starting from this frame signal, continue to compare the energy of each subsequent frame signal with E p , until the energy of a certain frame signal is less than E p ; Find the frame signal with the maximum energy among these frame signals and identify it as the peak of the current useful pulse; Obtain the time of this frame signal, which is called the peak time t of the current useful pulse p ;
[0050] S104: Taking the peak time t of the useful pulse currently extracted in S103 p as the starting point, compare the energy of each frame signal with E respectively forward and backward be_1 , until it is found that the energy of a certain frame signal is less than E in both directions be_1 ; Respectively identify the previous frame signal of these two frame signals as the first candidate start frame signal and the first candidate end frame signal of the current useful pulse; Obtain the time of these two frame signals, which is called the first candidate start time t of the current useful pulse b_f1 and the first candidate end time t e_f1 ;
[0051] S105: Taking the peak time t of the useful pulse currently extracted in S103 p as the starting point, compare the zero-crossing rate of each frame signal with Z respectively forward and backward be_1 , until it is found that the zero-crossing rate of a certain frame signal is less than Z in both directions be_1 ; Respectively identify the previous frame signal of these two frame signals as the first candidate start frame signal and the first candidate end frame signal of the current useful pulse; Obtain the time of these two frame signals, which is called the first candidate start time t of the current useful pulse b_f2 and the first candidate end time t e_f2 ;
[0052] S106: Compare the first candidate start time one and the first start time two, and identify the larger one as the final start time t b_1 ; Compare the first candidate end time one and the first end time two, and identify the smaller one as the final end time t e_1 ;
[0053] S107: Taking the next frame signal after the larger first candidate end time in S106 as the new starting point, repeat S103 to S106 to extract the second useful pulse; and so on, until the last frame signal of the sound signal is searched, and the extraction of the first round of useful pulses is completed;
[0054] S108: Calculate the difference between the end time and the start time of each useful pulse to obtain the duration of each useful pulse; based on the duration threshold T t , remove the useful pulses with a duration greater than the duration threshold, and retain the remaining useful pulses for the second-round pulse extraction.
[0055] Further, the process of the second-round pulse extraction by the two-stage variable multi-threshold pulse extraction unit includes the following steps:
[0056] S201: Set the second endpoint energy threshold to E be_2 = E a + 2σ E , set the second endpoint zero-crossing rate threshold to Z be_2 = Z a + 2σ Z ;
[0057] S202: Starting from the first useful pulse retained in S108, obtain the spike time t p of the current useful pulse as the starting point, and compare the energy of each frame signal with E be_2 respectively forward and backward until it is found that the energy of a certain frame signal is less than E be_2 in both directions; respectively identify the previous frame signal of these two frame signals as the second candidate start frame signal and the second candidate end frame signal of the current useful pulse; obtain the times of these two frame signals, which are called the second candidate start time -t b_s1 and the second candidate end time -t e_s1 of the current useful pulse;
[0058] S203: Starting from the first useful pulse retained in the first-round pulse extraction, obtain the spike time t p of the current useful pulse as the starting point, and compare the zero-crossing rate of each frame signal with Z be_2 respectively forward and backward until it is found that the zero-crossing rate of a certain frame signal is less than Z be_2 in both directions; respectively identify the previous frame signal of these two frame signals as the second candidate start frame signal and the second candidate end frame signal of the current useful pulse; obtain the times of these two frame signals, which are called the second candidate start time -t b_s2 and the second candidate end time -t e_s2 of the current useful pulse;
[0059] S204: Compare the second candidate end time -t and the second candidate end time -t, and identify the smaller one as the final end time t e_2 ;
[0060] S205: Starting from the second useful pulse retained from the first-round pulses, repeat the processing steps of S202 to S204; and so on until all the retained useful pulses in the first-round pulses are processed;
[0061] S206: Calculate the difference between the termination moment and the starting moment of each processed useful pulse to obtain the duration of each processed useful pulse; calculate the ratio of the duration of each processed useful pulse to the duration of the corresponding useful pulse before processing in S108; if the ratio is greater than or equal to the proportional threshold, then regard the final starting moment t b_1 and the final termination moment t e_1 in S106 as the true final starting moment t b and the true final termination moment t e of the current useful pulse; if the ratio is less than the proportional threshold, then regard the final starting moment t b_1 in S106 and the final termination moment t e_2 in S204 as the true final starting moment t b and the true final termination moment t e of the current useful pulse;
[0062] S207: Retain the useful pulses after S206 processing to complete the extraction of the second-round useful pulses.
[0063] The beneficial effects of the present invention are as follows:
[0064] There is still relatively little research on filtering of broiler sound signals, and the research is not specific and in-depth enough. Filtering details or results are not given, or a targeted and feasible filtering scheme for broiler sound signals is not provided by paying attention to proprietary signal characteristics. The present invention first considers the signal filtering problem in the research on broiler health monitoring based on sound signals, and develops a filtering method for broiler sound signals specifically, improving the filtering effect on broiler sound signals. The special processing of the present invention is mainly reflected in the following aspects:
[0065] (1) Existing hard threshold, soft threshold, semi-soft threshold functions, etc. have problems such as discontinuity in the real number domain, compression deviation of wavelet coefficients, poor smoothness of the signal after denoising, and unclear threshold selection rules, reducing the signal filtering effect of the wavelet threshold method. The present invention proposes a wavelet denoising algorithm based on a continuously differentiable threshold function and a scale threshold, which can effectively solve the above problems.
[0066] (2) The existing three-threshold pulse extraction algorithm and two-threshold pulse extraction algorithm have problems such as unclear and unstable threshold setting criteria, inaccurate extraction of useful pulses, and inability to process continuous multi-pulses, and cannot extract useful pulses of effective signal components reliably and stably. The present invention proposes a two-stage variable multi-threshold pulse extraction algorithm, which can not only effectively solve the above problems, but also be more targeted at broiler sound signals and can effectively improve the processing effect.
[0067] In addition, the filtering method of the present invention evaluates the signal by the classification accuracy in the field of machine learning. In the research on signal classification based on machine learning, the sound signal is converted into feature data, a feature data set is constructed and a classifier is trained. Therefore, the filtering method of the present invention can make the signal better suit machine learning, thereby improving the effect of classifying broiler sound signals using machine learning methods. Description of the Drawings
[0068] Figure 1 It is a schematic diagram of the three-threshold pulse extraction algorithm.
[0069] Figure 2 It is a schematic diagram of the two-threshold pulse extraction algorithm.
[0070] Figure 3 It is a continuous and differentiable threshold function.
[0071] Figure 4 It is a schematic diagram of the continuous multi-pulse problem.
[0072] Figure 5 It is a schematic diagram of the two-stage variable multi-threshold extraction algorithm.
[0073] Figure 6 It is a schematic flow diagram of the two-stage variable multi-threshold extraction algorithm.
[0074] Figure 7 It is the denoising effect obtained by the wavelet threshold method using different threshold functions.
[0075] Figure 8 It is a physical picture of the No. 3 breeding shed.
[0076] Figure 9 It is a waveform diagram of three sound categories and (burst) noise.
[0077] Figure 10 It is a waveform diagram (partial) of the broiler sound signal processed by the two-stage variable multi-threshold pulse extraction algorithm.
[0078] Figure 11 It is the ten-fold cross-validation result obtained by the random forest on five feature data sets.
[0079] Figure 12Waveform diagrams of four sound categories before and after signal filtering.
[0080] Figure 13 F1 scores obtained by the random forest on the feature data of each label in five feature datasets. Detailed implementation manners
[0081] In view of the problems in the existing research on broiler chicken sound signal filtering, such as less research content, lack of specific and in-depth research details, and failure to deeply analyze dedicated signal characteristics, the present invention newly proposes a broiler chicken sound signal filtering method integrating wavelet denoising and pulse extraction. This method processes the noise in the broiler chicken sound signal from two aspects. On the one hand, for the widely distributed noise mixed with the effective signal components, the present invention newly proposes a wavelet denoising algorithm based on a continuously differentiable threshold function and a scale threshold, which is used to decompose the entire broiler chicken sound signal, especially the noise in the overlapping signals, and reconstruct the broiler chicken sound signal. Specifically, in view of the defects of the commonly used threshold functions in the existing wavelet threshold methods, a high-order differentiable threshold function is designed, which can infinitely approximate or be equal to the original wavelet coefficients. In view of the deficiencies in the threshold selection methods in the existing wavelet threshold methods, a scale threshold is designed, which can adaptively change according to the decomposition scale to conform to the characteristic that the amplitude of the wavelet coefficients decreases with the increase of the decomposition scale. On the other hand, for the occasionally occurring noise in the form of discrete pulses, the present invention newly proposes a two-stage variable multi-threshold pulse extraction algorithm, which is used to extract the useful pulses of the effective signal components in the broiler chicken sound signal, and discard the pulses of the noise and the zero pulses. Specifically, in view of the problem of unclear setting criteria for the threshold in the existing pulse extraction algorithms, referring to the 3σ principle of the normal distribution, multiple threshold values with theoretical basis are set to ensure the feasibility and stability of the extraction of useful pulses. In view of the problem of continuous multi-pulses in the existing pulse extraction algorithms, a two-round useful pulse extraction scheme of first rough checking and then fine checking is set, and different threshold values are set in the two-round pulse extraction schemes respectively to ensure the accuracy of the extraction of useful pulses. At the same time, the present invention comprehensively evaluates the proposed signal filtering method from two perspectives to highlight its feasibility, practicability and superiority. The first perspective is the signal-to-noise ratio and root mean square error commonly used in the field of signal detection. The second perspective is the classification accuracy in the field of machine learning newly proposed by the present invention, which is used to evaluate its effect on the quality of subsequent feature datasets, and this is quantified as the classification accuracy obtained by the classifier trained on the feature datasets. The following is an explanation in combination with the specific implementation manners. Specific implementation manner 1:
[0083] This implementation manner is a broiler chicken sound signal filtering method integrating wavelet denoising and pulse extraction. Before specific description, some basic processing is first explained.
[0084] A. Wavelet denoising:
[0085] The noisy voice signal can be expressed as:
[0086] f(t) = s(t) + n(t) (1)
[0087] Wherein, s(t) represents the original voice signal, that is, the aforementioned effective signal component, and n(t) represents noise.
[0088] After wavelet decomposition of the noisy voice signal, the amplitude of the wavelet coefficient of the effective signal component is larger, and the amplitude of the wavelet coefficient of the noise is smaller. As the wavelet decomposition scale increases, the amplitude of the wavelet coefficient of the effective signal component basically remains unchanged, and the amplitude of the wavelet coefficient of the noise rapidly decays to 0. Therefore, a suitable threshold function can be set to decompose the effective signal component and the noise to achieve wavelet denoising:
[0089] Step A1: Perform wavelet decomposition on the noisy voice signal: Select a wavelet basis and a decomposition scale, and perform wavelet decomposition to obtain a set of wavelet coefficients.
[0090] Step A2: Perform threshold quantization processing on the high-frequency coefficients of each layer of the wavelet decomposition to obtain an estimated value of the wavelet coefficient.
[0091] Step A3: Perform inverse wavelet transform on the wavelet coefficient after threshold quantization processing to reconstruct the voice signal, and obtain the denoised voice signal.
[0092] In the wavelet threshold method, the most commonly used threshold functions for threshold quantization processing of wavelet coefficients include the hard threshold, soft threshold, and semi-soft threshold functions. Among them, the definition of the hard threshold function is as follows:
[0093]
[0094] The definition of the soft threshold function is as follows:
[0095]
[0096] The definition of the semi-soft threshold function is as follows:
[0097]
[0098] It should be noted that, according to the characteristics of the effective signal components and noise, the hard threshold and soft threshold functions perform threshold processing on the high-frequency wavelet coefficients. The hard threshold function is discontinuous in the real number domain, changing from continuous to step near the thresholds -T and T, resulting in the appearance of pseudo-Gibbs phenomenon in the denoised sound signal. Although the soft threshold function is continuous in the real number domain and the denoised sound signal is relatively smooth, it compresses the wavelet coefficients, introducing a deviation between the wavelet coefficients of the denoised sound signal and the original sound signal, reducing the similarity between the denoised sound signal and the original sound signal. In contrast, the semi-soft threshold function retains the larger wavelet coefficients and is continuous, being a compromise choice between the hard threshold and soft threshold functions, overcoming the defects of the hard threshold and soft threshold functions to a certain extent. However, the semi-soft threshold function requires determining two thresholds, T1 and T2, increasing the computational complexity of the algorithm. This leads to a transition band where there is a straight line between the effective signal components and the noise, resulting in poor smoothness of the denoised sound signal. At the same time, the selection of the two thresholds directly determines the quality of the reconstructed sound signal, and how to select appropriate thresholds is crucial. Currently, there is no clear and reliable selection rule given in the literature.
[0099] The selection of the threshold will directly affect the denoising effect of the sound signal. If the selected threshold is too small, the wavelet coefficients corresponding to the noise will be retained, resulting in incomplete denoising of the sound signal. If the selected threshold is too large, the wavelet coefficients corresponding to the effective signal components will be removed, causing distortion of the denoised sound signal. Therefore, the appropriate threshold selection rule is to ensure that the selected threshold is greater than the highest level of the wavelet coefficients corresponding to the noise but lower than the lowest level of the wavelet coefficients corresponding to the vast majority of the effective signal components. Commonly used threshold selection methods include: unbiased likelihood estimation criterion, fixed threshold criterion, heuristic threshold criterion, and minimax principle criterion. Among them, the unbiased likelihood estimation criterion and the minimax principle criterion are relatively conservative. When the noise is less distributed in the high-frequency band of the sound signal, the denoising effect of these two threshold criteria is better, and weak sound signals can be extracted. The fixed threshold criterion and the heuristic threshold criterion perform more thorough denoising and can more effectively remove noise, but they are also prone to misidentifying the effective signal components distributed in the high-frequency band as noise and removing them. Specifically, the hard threshold and soft threshold functions use the fixed threshold criterion and select a general threshold T, which is defined as follows:
[0100]
[0101] where σ represents the standard deviation of the noise, that is, the noise intensity, and N represents the number of sampling points in the (discrete) sound signal. In fact, σ is often unknown and can be estimated based on the wavelet coefficients, and its definition is as follows:
[0102]
[0103] where d kis the wavelet coefficient with scale k, and median() is the median function.
[0104] It can be seen that the magnitudes and characteristics of wavelet coefficients at different scales are different. Among them, the amplitude of the wavelet coefficient of noise decreases with the increase of the decomposition scale. Using the general threshold T for denoising cannot correctly reflect this variation law of noise, lacks self - adaptability and accuracy, and will inevitably remove some wavelet coefficients of the corresponding effective signal components at the same time.
[0105] B. Pulse extraction for the sound signal after wavelet denoising:
[0106] B1. Pulse extraction is performed using the three - threshold pulse extraction algorithm. Figure 1 The schematic diagram is given, and its specific implementation steps are as follows:
[0107] Step B101: Calculate the average energy of the entire sound signal, denoted as E a , which is called the reference threshold. On this basis, set the spike threshold E p and the endpoint threshold E be . In fact, these three thresholds are the three thresholds in the algorithm name. After a large number of experimental analyses, the spike threshold is recommended to be set as E p = 3E a , and the endpoint threshold is recommended to be set as E be = 1.1E a .
[0108] Step B102: Perform the first frame - splitting process on the sound signal, set the duration of each frame signal Δt1 = 100 μs, and calculate the energy of each frame signal.
[0109] Step B103: Starting from the first frame signal, compare the energy of each frame signal with E p in turn. When the energy of a certain frame signal is greater than E p , it indicates that the maximum frame signal of the current useful pulse is about to appear. Starting from this frame signal, continue to compare the energy of each subsequent frame signal with E p until the energy of a certain frame signal is less than E p . Find the frame signal with the maximum energy among these frame signals and identify it as the spike of the current useful pulse. Obtain the time of this frame signal, which is called the spike time t p of the current useful pulse.
[0110] Step B104: Perform the second frame - splitting process on the sound signal, set the duration of each frame signal Δt2 = 50 μs, and recalculate the energy of each frame signal.
[0111] Step B105: Using the spike time t of the useful pulse currently extracted in step threep Starting from this point, compare the energy of each frame signal with E respectively forward and backward be , until it is found that the energy of a certain frame signal is less than E in both directions be . Respectively identify the frame signal immediately preceding these two frame signals as the starting frame signal and the ending frame signal of the current useful pulse. Obtain the times of these two frame signals, which are called the starting time t b and the ending time t e .
[0112] Step B106: Using the frame signal immediately following the ending time t e of the currently extracted useful pulse in Step Five as the new starting point, repeat Steps Two to Five to extract the second useful pulse. And so on, until the last frame signal of the sound signal is searched, and the extraction of all useful pulses is completed.
[0113] B2 uses a dual-threshold pulse extraction algorithm for pulse extraction. Based on the triple-threshold pulse extraction algorithm, by comprehensively considering the characteristics of the energy and zero-crossing rate of the sound signal, appropriate energy threshold values and zero-crossing rate threshold values are set, which is called the dual-threshold pulse extraction algorithm. It is also widely used in the field of speech signal processing. Figure 2 The schematic diagram of the dual-threshold pulse extraction algorithm is given, and its specific implementation steps are as follows:
[0114] Step B211: Calculate the average energy and average zero-crossing rate of the entire sound signal, which are respectively represented as E a and Z a , which are respectively called the reference energy threshold value and the reference zero-crossing rate threshold value. On this basis, set the endpoint energy threshold value E be and the endpoint zero-crossing rate threshold value Z be . After a large number of experimental analyses, the endpoint energy threshold value is recommended to be set as E be = 1.1E a , and the endpoint zero-crossing rate threshold value is recommended to be set as Z be = 2Z a .
[0115] Step B212: Perform frame processing on the sound signal, set the duration of each frame signal Δt = 50 μs, and calculate the energy and zero-crossing rate of each frame signal.
[0116] Step B213: Starting from the first frame signal, compare the energy of each frame signal with E be in turn. When the energy of a certain frame signal is greater than E be , identify this frame signal as the candidate starting frame signal of the current useful pulse. Obtain the time of this frame signal, which is called the candidate starting time one t b_c1Starting from this frame signal, continue to compare the energy of each subsequent frame signal with E be until the energy of a certain frame signal is less than E be At this point, this frame signal is determined as the candidate termination frame signal of the current useful pulse. Obtain the time of this frame signal, which is called the candidate termination moment t e_c1 。
[0117] Step B214: Starting from the first frame signal, sequentially compare the zero-crossing rate of each frame signal with Z be When the zero-crossing rate of a certain frame signal is greater than Z be At this time, this frame signal is determined as the candidate starting frame signal of the current useful pulse. Obtain the time of this frame signal, which is called the candidate starting moment t b_c2 Starting from this frame signal, continue to compare the zero-crossing rate of each subsequent frame signal with Z be until the zero-crossing rate of a certain frame signal is less than Z be At this time, this frame signal is determined as the candidate termination frame signal of the current useful pulse. Obtain the time of this frame signal, which is called the candidate termination moment t e_c2 。
[0118] Step B215: Compare the candidate starting moments one and two, and determine the larger one as the final starting moment t b Compare the candidate termination moments one and two, and determine the smaller one as the final termination moment t e 。
[0119] Step B216: Taking the next frame signal after the larger candidate termination moment in step five as the new starting point, repeat steps three to five to extract the second useful pulse. And so on, until the last frame signal of the sound signal is searched, and the extraction of all useful pulses is completed.
[0120] C. Sound feature selection:
[0121] In machine learning, a classifier cannot directly classify the input sound signal. Instead, the sound signal needs to be transformed into interpretable feature data. Feature extraction is a commonly used transformation method. Feature extraction refers to calculating the numerical values of sound features in multiple domains based on useful pulses, constructing a feature vector, and thus obtaining feature data. Feature extraction is also an important means of quantifying the differences in acoustic characteristics between different sound classes. Each useful pulse in the broiler sound signal corresponds to a sound class, and there are differences in the data distribution of the feature numerical values calculated on the useful pulses corresponding to different sound classes. In fact, the classifier trained on the feature dataset also classifies the feature data with different labels by sensitively capturing this data distribution difference. In previous studies, 60 sound features were mainly extracted from four aspects: time domain, frequency domain, Mel-frequency cepstral coefficients, and sparse representation. The present invention newly proposes a linear-nonlinear fusion feature selection method, and selects 41 sound features that have a greater impact on the classification performance of the classifier to form the final feature dataset. Table 1 lists these sound features. Among them, the sound features numbered 1 to 5 come from the time domain, the sound features numbered 6 to 9 come from the frequency domain, the sound features numbered 10 to 33 come from Mel-frequency cepstral coefficients, and the sound features numbered 34 to 41 come from sparse representation.
[0122] Table 1 41 Sound Features
[0123]
[0124] In addition, the feature dataset constructed from the 41 extracted sound features is also used to evaluate the signal filtering method proposed in the present invention. The present invention comprehensively evaluates the proposed signal filtering method from two perspectives. The first perspective is the signal-to-noise ratio and root mean square error commonly used in the field of signal detection. These two evaluation indicators directly evaluate the quality of the sound signal before and after signal filtering. The second perspective is the classification accuracy in the field of machine learning. It is used to indirectly evaluate the quality of the sound signal before and after signal filtering. Their specific descriptions are as follows.
[0125] Suppose the noisy sound signal is f(t) = s(t) + n(t), where s(t) and n(t) represent the effective signal component and noise respectively. The signal-to-noise ratio refers to the ratio of the effective signal component to the noise in a sound signal. Its calculation process is shown in formula (7). If the signal-to-noise ratio of the sound signal after signal filtering is greater than that of the sound signal before signal filtering, it indicates that the noise in the original sound signal is eliminated and the effective signal component is highlighted. At the same time, for the same original sound signal, if different signal filtering methods are used for processing, the signal filtering method corresponding to the sound signal with the largest signal-to-noise ratio is the optimal one.
[0126]
[0127] Among them, N represents the number of sampling points in the (discrete) sound signal, represents the energy of the effective signal component, represents the energy of the noise.
[0128] The root mean square error refers to the root mean square of the variance between the sound signals before and after signal filtering. Its calculation process is shown in formula (8). If the root mean square error of the sound signal after signal filtering is less than that of the sound signal before signal filtering, it indicates that the noise in the original sound signal is eliminated and the effective signal component is highlighted. At the same time, for the same original sound signal, if different signal filtering methods are used for processing, the signal filtering method corresponding to the sound signal with the smallest root mean square error is the optimal one.
[0129]
[0130] Among them, f(t) is the noisy sound signal before signal filtering, that is, the above-mentioned original sound signal, and x(t) is the sound signal after signal filtering.
[0131] If evaluated from the perspective of the classification accuracy in the field of machine learning, the present invention extracts 41 sound features shown in Table 1 from the sound signals before and after signal filtering respectively, and constructs two feature data sets, called the original feature data set and the filtered feature data set. The present invention trains the same classifier on the two feature data sets respectively, keeps their parameter settings consistent, and tests the classification accuracy obtained on the test set. At this time, if the classification accuracy obtained by the classifier trained on the filtered feature data set is higher, it represents that the quality of the filtered feature data set is better, and also represents that the quality of the sound signal for constructing the filtered feature data set is higher. This indicates that the noise in the original sound signal is eliminated and the effective signal component is highlighted. At the same time, for the same original sound signal, if different signal filtering methods are used for processing, the quality of the feature data set with the highest classification accuracy obtained by the classifier is the best, the quality of the corresponding sound signal is the best, and the corresponding signal filtering method is the optimal one. The definition of classification accuracy is as follows.
[0132] Assume that the feature data set is D = {(x1, y1), (x2, y2), …, (x n , y n )}, where y i is the true label of the feature data x i , and R(x i ) is the predicted label given by the classifier R. The classification accuracy is expressed as the ratio of the number of feature data with correct label prediction to the total number of feature data. Its calculation process is as follows:
[0133]
[0134] Among them, I is an indicator function. When R(x i ) = y i , I(R(x i ) = y i ) = 1.
[0135] In the previous research on broiler sound signal recognition carried out by the present invention, mainly four sound categories were classified, and the corresponding constructed feature dataset was the feature data containing four labels. In machine learning, a four-classification problem is a combination of multiple binary-classification problems. In a binary-classification problem, Precision, Recall, and F1-score are used to evaluate the classification performance of a classifier on the feature data of a certain label. Among them, Precision represents the proportion of samples predicted as positive classes that are truly positive classes. Recall represents the proportion of positive-class samples in the samples that are correctly predicted. The F1-score is an organic combination of the two and is the most appropriate and widely used evaluation metric. Table 2 shows the confusion matrix of the binary-classification results. On this basis, the calculation formulas for Precision, Recall, and F1-score are as follows respectively.
[0136]
[0137]
[0138]
[0139] Table 2 Confusion matrix of binary-classification results
[0140]
[0141] The filtering method for broiler chicken sound signals integrating wavelet denoising and pulse extraction described in this embodiment includes two parts, which are also two stages of the filtering process, namely wavelet denoising processing and useful pulse extraction. In the first stage, the present invention newly proposes a wavelet denoising algorithm based on a continuously differentiable threshold function and a scale threshold to eliminate the noise in the entire broiler chicken sound signal, especially the noise overlapping with the effective signal components. Moreover, the proposed wavelet denoising algorithm effectively overcomes the shortcomings of the classical hard threshold, soft threshold, and semi-soft threshold functions and updates the scale function. In fact, in this stage, the present invention mainly solves the continuous noise existing in the broiler chicken sound signal, such as the continuous natural wind sound in the environment or the continuous wind sound emitted by the blower, the sound of the continuously operating conveyor belt, etc. They appear relatively uniformly in the entire broiler chicken sound signal. For some sudden and sharp noises, which appear as an independent pulse like the effective signal components, the proposed wavelet denoising algorithm can only perform signal filtering to a slight extent and cannot completely eliminate them. Therefore, in the second stage, the present invention newly proposes a two-stage variable multi-threshold pulse extraction algorithm to eliminate the noises that appear as independent pulses in the broiler chicken sound signal. Moreover, the proposed pulse extraction algorithm effectively overcomes the deficiencies of the existing three-threshold and two-threshold pulse extraction algorithms and captures useful pulses more accurately. In fact, in this stage, the present invention solves the sudden and sharp noises existing in the broiler chicken sound signal, such as the intermittent working sound of the water pump, the regularly operating sound of the manure removal machine, etc. They appear randomly and uncertainly in the broiler chicken sound signal. In addition, in this stage, the present invention effectively solves the problem of continuous multi-pulses, which actually solves the problem of effective separation of sound categories. As mentioned above, each useful pulse corresponds to a sound category. If a useful pulse is a combination of multiple useful pulses, the corresponding multiple sound categories are regarded as one sound category. This has a great impact on subsequent feature extraction. To sum up, through the processing of these two stages, the widely distributed and occasionally appearing noises in the broiler chicken sound signal can be well removed, greatly improving the signal quality and providing an important guarantee for subsequent feature extraction. Next, the present invention will describe in detail the filtering method for broiler chicken sound signals proposed, starting with the improved wavelet denoising algorithm.
[0142] To improve the filtering performance of the wavelet denoising algorithm (the wavelet threshold method specifically selected in the present invention), the design of the threshold function must meet the following three principles:
[0143] One is to ensure the continuity of wavelet coefficients. The second is that the difference between the wavelet coefficients after being processed by the threshold function and the wavelet coefficients of the original signal decreases rapidly, approaching or equal to the original wavelet coefficients infinitely. The third is that the threshold function has high-order differentiability.
[0144] Therefore, when designing the threshold function, while maintaining continuity and differentiability, the difference from the original wavelet coefficients should be minimized as much as possible. Based on the above principles, the present invention proposes a continuous and highly differentiable threshold function, as Figure 3 shown. Its detailed definition is as follows:
[0145]
[0146] where λ(x) represents the threshold function, x represents the independent variable, and T represents the threshold;
[0147] Next, the present invention analyzes its continuity, asymptotics, and differentiability respectively. It can be seen from formula (13) that when |x| > T, it rapidly approaches the original wavelet coefficients. First, the present invention analyzes its continuity, and the analysis process is as follows:
[0148]
[0149]
[0150] It can be seen from formula (14) and formula (15) that the threshold function λ(x) is continuous at the thresholds -T and T. Therefore, the threshold function is continuous over the entire real number domain, thus overcoming the defect of the discontinuity of the threshold function λ1(x). Next, the present invention analyzes its asymptotics, and the analysis process is as follows:
[0151]
[0152]
[0153] It can be seen from formula (16) and formula (17) that when the independent variable x → ∞, the threshold function λ(x) infinitely approaches x, and the threshold function λ(x) has λ(x) = x as its asymptote, thus overcoming the defect that there is a constant deviation between the soft threshold function λ2(x) and x. Finally, the present invention analyzes its differentiability, including the differentiability at the thresholds -T and T, and the differentiability in the continuous interval. The analysis process of the differentiability at the thresholds -T and T is as follows:
[0154]
[0155]
[0156] As can be seen from Formula (18) and Formula (19), the threshold function λ(x) is differentiable at the point -T, and the derivative is 0. According to the same analysis process, it can be obtained that the threshold function λ(x) is differentiable at the point T, and the derivative is also 0. The analysis process of the differentiability of the continuous interval is as follows. In fact, as can be seen from Formula (13), the threshold function λ(x) is highly differentiable everywhere when x≠±T. Therefore, the threshold function is continuously differentiable over the entire real number domain, which is convenient for further mathematical analysis. To sum up, the improved threshold function proposed by the present invention is not only continuous, but also quickly approximates the original wavelet coefficients, and can better overcome the defects of the existing hard threshold, soft threshold and semi-soft threshold functions. As mentioned above, the semi-soft threshold function is a compromise choice between the hard threshold and the soft threshold functions, and it has the disadvantages of both the hard threshold and the soft threshold functions. In addition, the improved threshold function has good mathematical properties of high-order continuous differentiability, which is convenient for mathematical processing.
[0157] The selection of the threshold T is crucial. The present invention also uses the fixed threshold criterion and improves it on the basis of the general threshold shown in Formula (5). Specifically, in order to improve the adaptability and accuracy of the threshold, combining the idea of the general threshold and the law that the noise intensity decreases with the increase of the decomposition scale, the present invention newly proposes an adaptive scale threshold, and its calculation process is as follows:
[0158]
[0159] where σ is the standard deviation of the noise, N represents the number of sampling points in the (discrete) sound signal, and i is the wavelet decomposition scale. The threshold T corresponding to each layer of wavelet coefficients i shows a slow decreasing trend with the decomposition scale i, which conforms to the characteristic that the amplitude of the wavelet coefficients decreases with the increase of the decomposition scale.
[0160] So far, the design of the first stage of the broiler sound signal filtering method proposed by the present invention is completed. Next, the present invention continues to describe in detail the newly proposed pulse extraction algorithm in the second stage. In the three-threshold pulse extraction algorithm, the average energy of the entire sound signal is used as the reference threshold, which is actually the only basis for judgment. And this basis for judgment is selected based on experience given by a large number of experiments and has no theoretical basis. On this basis, the spike threshold and the end-point threshold are set. Thus, the three thresholds in the three-threshold pulse extraction algorithm are determined. During the extraction of useful pulses, the three-threshold pulse extraction algorithm first finds the spike of each useful pulse, and then finds the start frame signal and the end frame signal of each useful pulse. It should be noted that the spike threshold is much larger than the reference threshold, so the amplitude of the useful pulses extracted is relatively large. Those pulses with relatively small amplitudes will be filtered out, which means that some useful pulses with small energy and noise after wavelet denoising will be removed. That is to say, the three-threshold pulse extraction algorithm has great advantages in finding the spikes of useful pulses, which means that the useful pulses it extracts are more likely to be real useful pulses, although it will lose some weaker useful pulses.
[0161] In the dual-threshold pulse extraction algorithm, the average energy and average zero-crossing rate of the entire sound signal are respectively used as the reference energy threshold and the reference zero-crossing rate threshold, actually using two judgment bases. Similarly, these two judgment bases are also selected empirically. On this basis, the endpoint energy threshold and the endpoint zero-crossing rate threshold are set. Thus, the two threshold values in the dual-threshold pulse extraction algorithm are determined. During the extraction of useful pulses, the dual-threshold pulse extraction algorithm first uses the endpoint energy threshold to find the start frame signal and the end frame signal of each useful pulse, and then uses the endpoint zero-crossing rate threshold to find the start frame signal and the end frame signal of each useful pulse. The final start frame signal and the final end frame signal of the useful pulse are determined through the comprehensive analysis of the two start frame signals and the end frame signals. It is also worth noting that both the endpoint energy threshold and the endpoint zero-crossing rate threshold are slightly greater than the reference energy threshold and the reference zero-crossing rate threshold. Therefore, the amplitude of the extracted useful pulse itself is also slightly higher than the average level, and the amplitudes of each useful pulse are uneven. This may retain the noise with relatively small energy removed in the triple-threshold pulse extraction algorithm. However, relatively speaking, in the dual-threshold pulse extraction algorithm, because both energy and zero-crossing rate are used to find the start frame signal and the end frame signal, the determination of the start point and the end point of each useful pulse is relatively reliable, and no extra zero pulses will be extracted. As is well known, in the field of signal detection, the zero-crossing rate has superior performance in endpoint detection. That is to say, the dual-threshold pulse extraction algorithm has great advantages in finding the start point and the end point of useful pulses, which means that the main body of the useful pulses it extracts are basically meaningful frame signals, not zero pulses.
[0162] In addition, continuous multi-pulse problems may occur during the processing of the above two pulse extraction algorithms, such as Figure 4 shown. In the triple-threshold pulse extraction algorithm, when the spike threshold of the present invention is used to find the spike of the first useful pulse, the end frame signal of the useful pulse found through the endpoint threshold E be may be the end frame signal of the next useful pulse, rather than the real end frame signal of the current useful pulse, as shown by the red box in the figure. The reason is that the signal attenuation between these two useful pulses does not reach the set endpoint threshold. Similarly, in the dual-threshold pulse extraction algorithm, because the set endpoint energy threshold E beIt is the same as the endpoint threshold in the three-threshold pulse extraction algorithm. During the pulse extraction based on energy, it will also regard the two useful pulses shown in the red box as one useful pulse. When comprehensively analyzing the pulse extraction results based on energy and zero-crossing rate, this phenomenon may be luckily avoided when the zero-crossing rate plays a dominant role. However, when energy plays a dominant role, the problem of consecutive multiple pulses is inevitable. Therefore, the problem of consecutive multiple pulses needs to be taken seriously and considered in the design process of the new pulse extraction algorithm. It should be noted that for the purpose of visual display, Figure 4 the continuous analog signals shown in it, but in fact these broiler sound signals should all be discrete digital signals. The present invention can regard the Figure 4 continuous curve in it as the connection of multiple dense discrete points.
[0163] In summary, the present invention combines the advantages and disadvantages of the three-threshold pulse extraction algorithm and the two-threshold pulse extraction algorithm, and at the same time pays attention to the problem of consecutive multiple pulses, and thus proposes a two-stage variable multi-threshold pulse extraction algorithm. In this algorithm, the present invention performs two rounds of pulse extraction, and uses multiple threshold values in each round to achieve different purposes. In the first round of pulse extraction, the purpose of the present invention is to extract the pulses in the broiler sound signals that are most likely to be real useful pulses, and ensure that the main body of each useful pulse is a meaningful frame signal. At the same time, the present invention needs to consider removing the noise pulses in the broiler sound signals to ensure that the useful pulses for subsequent feature extraction are all valid signal components. Therefore, during the pulse extraction process in this round, the present invention first sets a spike energy threshold to find the spikes of the useful pulses, and then simultaneously uses the endpoint energy threshold and the endpoint zero-crossing rate threshold to find the starting point and the ending point of the useful pulses. Additionally, the present invention detects the duration of the useful pulses to determine whether it is a valid signal component or noise. In the second round of pulse extraction, the purpose of the present invention is to solve the problem of consecutive multiple pulses that may exist in the results of the first round of pulse extraction, and ensure that the extracted useful pulses are all independent individuals, rather than a combination of two pulses, that is, a combination of two sound categories. Therefore, during the pulse extraction process in this round, the present invention refers to the results of the first round of pulse extraction and sets new endpoint energy thresholds and endpoint zero-crossing rate thresholds to accurately find the starting point and the ending point of the useful pulses again. After two rounds of pulse extraction, the independent useful pulses corresponding to the valid signal components in the broiler sound signals are extracted, and the independent pulses corresponding to the noise are filtered out. On this basis, subsequent construction of the feature dataset, training of the classifier, and data classification can be realized.
[0164] In addition, the settings of the endpoint energy threshold and the endpoint zero-crossing rate threshold are no longer based on empirical selection, but refer to the 3σ principle in the normal distribution. From the 3σ principle of the normal distribution, it can be known that the probability that the numerical distribution is within [μ - σ, μ + σ] is 68.27%, and the probability that the numerical distribution is within [μ - 3σ, μ + 3σ] is 99.73%. In other words, the data with a value exceeding μ + 3σ is regarded as an outlier, that is, the value is particularly large, while the data hovering around μ + σ is regarded as a valid value. This part of the rule can provide a reference for the present invention. Specifically, E a is the average energy of the entire sound signal, and Z a is the average zero-crossing rate of the entire sound signal, that is, the above-mentioned μ. The present invention calculates the standard deviation of the energy of the entire sound signal and the standard deviation of the zero-crossing rate, denoted as σ E and σ Z , that is, the above-mentioned σ. In this way, there is a high probability that the spike of the current useful pulse will appear in the frame signal with an energy higher than E a +3σ E , while the frame signal hovering around E a +σ E or the zero-crossing rate hovering around Z a +σ Z is probably the starting point or the ending point of the current useful pulse. Therefore, the present invention can set the spike energy threshold, the endpoint energy threshold, and the endpoint zero-crossing rate threshold accordingly. Figure 5 Figure 22 shows a schematic diagram of the two-stage variable multi-threshold pulse extraction algorithm, and its specific implementation steps are as follows:
[0165] Step 1: Calculate the average energy and the average zero-crossing rate of the entire sound signal, denoted as E a and Z a respectively, and calculate the standard deviation of the energy of the entire sound signal and the standard deviation of the zero-crossing rate, denoted as σ E and σ Z respectively. On this basis, the present invention sets a suitable spike energy threshold as E p =E a +3σ E , sets a suitable endpoint energy threshold as E be_1 =E a +σ E , and sets a suitable endpoint zero-crossing rate threshold as Z be_1 =Z a +σ z .
[0166] Step 2: Perform frame processing on the sound signal, set the duration of each frame signal Δt = 50 μs, and calculate the energy and zero-crossing rate of each frame signal.
[0167] Step 3: Starting from the first frame signal, compare the energy of each frame signal with E in sequence. p When the energy of a certain frame signal is greater than E p , it indicates that the maximum frame signal of the current useful pulse is about to appear. Starting from this frame signal, continue to compare the energy of each subsequent frame signal with E p until the energy of a certain frame signal is less than E p . Find the frame signal with the maximum energy among these frame signals and identify it as the peak of the current useful pulse. Obtain the time of this frame signal, which is called the peak time t p of the current useful pulse.
[0168] Step 4: Taking the peak time t p of the currently extracted useful pulse in Step 3 as the starting point, compare the energy of each frame signal with E be_1 forward and backward respectively until it is found in both directions that the energy of a certain frame signal is less than E be_1 . Respectively identify the previous frame signal of these two frame signals as the candidate starting frame signal and the candidate ending frame signal of the current useful pulse. Obtain the times of these two frame signals, which are called the candidate starting time t b_f1 and the candidate ending time t e_f1 of the current useful pulse.
[0169] Step 5: Taking the peak time t p of the currently extracted useful pulse in Step 3 as the starting point, compare the zero-crossing rate of each frame signal with Z be_1 forward and backward respectively until it is found in both directions that the zero-crossing rate of a certain frame signal is less than Z be_1 . Respectively identify the previous frame signal of these two frame signals as the candidate starting frame signal and the candidate ending frame signal of the current useful pulse. Obtain the times of these two frame signals, which are called the candidate starting time t b_f2 and the candidate ending time t e_f2 of the current useful pulse.
[0170] Step 6: Compare the candidate starting times one and two and identify the larger one as the final starting time t b_1 . Compare the candidate ending times one and two and identify the smaller one as the final ending time t e_1 .
[0171] Step 7: Taking the next frame signal after the larger candidate ending time in Step 6 as the new starting point, repeat Steps 3 to 6 to extract the second useful pulse. And so on until the last frame signal of the sound signal is searched, completing the extraction of the first-round useful pulses.
[0172] Step 8: Calculate the difference between the termination time and the start time of each useful pulse to obtain the duration of each useful pulse. Refer to the set duration threshold T t , remove the useful pulses with a duration greater than the duration threshold, and retain the remaining useful pulses for the second round of pulse extraction.
[0173] Step 9: The present invention sets a suitable endpoint energy threshold value to be E be_2 = E a + 2σ E , and sets a suitable endpoint zero-crossing rate threshold value to be Z be_2 = Z a + 2σ Z .
[0174] Step 10: Starting from the first useful pulse retained in Step 8, take the spike time t p of the current useful pulse as the starting point, and compare the energy of each frame signal with E be_2 respectively forward and backward until it is found that the energy of a certain frame signal is less than E be_2 in both directions. Respectively identify the previous frame signal of these two frame signals as the candidate start frame signal and the candidate end frame signal of the current useful pulse. Obtain the times of these two frame signals, which are called the candidate start time one t b_s1 and the candidate end time one t e_s1 of the current useful pulse.
[0175] Step 11: Starting from the first useful pulse retained in Step 8, take the spike time t p of the current useful pulse as the starting point, and compare the zero-crossing rate of each frame signal with Z be_2 respectively forward and backward until it is found that the zero-crossing rate of a certain frame signal is less than Z be_2 in both directions. Respectively identify the previous frame signal of these two frame signals as the candidate start frame signal and the candidate end frame signal of the current useful pulse. Obtain the times of these two frame signals, which are called the candidate start time two t b_s2 and the candidate end time two t e_s2 of the current useful pulse.
[0176] Step 12: Compare the new candidate start times one and two, and identify the larger one as the final start time t b_2 . Compare the new candidate end times one and two, and identify the smaller one as the final end time t e_2 .
[0177] Step 13: Starting from the second useful pulse retained in Step 8, repeat the processing steps of Step 10 to Step 12. And so on until all the useful pulses retained in Step 8 are processed.
[0178] Step Fourteen: Calculate the difference between the termination time and the starting time of each processed useful pulse to obtain the duration of each processed useful pulse. Calculate the ratio of the duration of each processed useful pulse to the duration of the corresponding useful pulse before processing in Step Eight. If the ratio is greater than or equal to 68%, then the final starting time t b_1 and the final termination time t e_1 in Step Six are recognized as the true final starting time t b and the true final termination time t e of the current useful pulse. If the ratio is less than 68%, then the final starting time t b_1 in Step Six and the final termination time t e_2 in Step Twelve are recognized as the true final starting time t b and the true final termination time t e .
[0179] Step Fifteen: Retain the useful pulses processed in Step Fourteen to complete the extraction of the second round of useful pulses, that is, the extraction of useful pulses from the entire sound signal is completed.
[0180] So far, the design of the second stage of the broiler sound signal filtering method proposed by the present invention is completed, and the design of the entire method is also completed. The above design process is as Figure 6 shown.
[0181] Based on the above broiler sound signal filtering method that combines wavelet denoising and pulse extraction, in the second specific embodiment, a corresponding broiler sound signal filtering system that combines wavelet denoising and pulse extraction is developed to execute the broiler sound signal filtering method that combines wavelet denoising and pulse extraction, so as to realize the filtering of broiler sound signals.
[0182] The signal filtering method proposed by the present invention can effectively remove the widely distributed and occasionally occurring noises in the broiler sound signal, achieving the effect of signal filtering. Moreover, the pulse extraction algorithm in the proposed signal filtering method can extract useful pulses more accurately, laying a foundation for subsequent feature extraction. The problem of continuous multiple pulses that may occur in the previous pulse extraction algorithm is also well solved, ensuring that each extracted useful pulse is an independent sound category. Figure 4 The continuous multiple pulses shown in Figure 5 have been removed. Next, the present invention will verify the broiler sound signal filtering method proposed by the present invention.
[0183] Embodiment
[0184] The broiler chicken sound signals were collected inside the No. 3 breeding shed of Huixing Breeding Farm (Linkou County, Mudanjiang City, Heilongjiang Province, 44°91’N, 130°02’E, Heilongjiang Province), as Figure 8 shown. This experiment has been approved by the Animal Ethics Committee of Heilongjiang University. The approval number is 20220811007, and the approval date is August 18, 2022.
[0185] The specific breed of broiler chickens raised in Huixing Breeding Farm is Arbor Acres broilers. Their hatching period is about 3 weeks, and their growth period is about 8 weeks. The broiler chickens were all purchased in the same batch, and their growth period was about 4 weeks when the experiment was carried out. In this invention, 60 broiler chickens were randomly selected from the No. 3 breeding shed as experimental samples, and their weights were all around 1.6 kg. Among the 60 broiler chicken samples, there were 40 healthy broiler chickens and 20 diseased broiler chickens. The sounds made by healthy broiler chickens include crowing sounds, grunting sounds, flapping sounds, and feeding sounds. The sounds made by diseased broiler chickens include coughing sounds, grunting sounds, and feeding sounds. Among them, the crowing sound is short and sharp, the coughing sound is low and long, the grunting sound is low and undulating, and the flapping sound has a large amplitude and a long duration. The feeding sound is the sound made when the broiler chicken's beak collides with the feeder during feeding. During the experiment, this invention avoided the feeding time of the broiler chickens because there were more interference signals generated during this stage, which was not conducive to signal collection. Therefore, the broiler chicken sound signals collected in this invention mainly include crowing sounds, coughing sounds, grunting sounds, and flapping sounds, that is, four sound categories.
[0186] The basic situation of the No. 3 breeding shed is as follows: It runs from east to west, with a length of 122.0 m, a width of 18.8 m, a roof height of 4.6 m, and it is single-layer. There are 35 strip-shaped breeding areas and 4 aisles in the shed. Among them, each strip-shaped breeding area is 3.2 m long and 16.0 m wide. Each aisle is 2.5 m long and 16.0 m wide. There is a remaining reserved space with a length of 122.0 m and a width of 2.8 m at the west entrance of the No. 3 breeding shed, which is used for breeders to walk and place sundries such as feed. In the reserved space at the west entrance of the No. 3 breeding shed of the present invention, an experimental area with a length of 1.2 m and a width of 2.0 m, and two candidate areas with a length of 4.0 m and a width of 2.0 m are enclosed by fences, and 80 mm thick wood chips are laid as bedding for the three areas. The experimental area and the candidate areas are both approximately 2.0 m away from the nearest strip-shaped breeding area. This not only ensures the adaptability of the broiler samples to the environment but also ensures the authenticity of the broiler sound signals collected. The signal acquisition system is fixed on the fence of the experimental area by a cloth belt, and the color of the cloth belt is the same as that of the fence itself. The signal acquisition system does not make noise, generate heat, or emit light during operation and will not affect the normal growth of broilers. The signal acquisition system selects a chassis from National Instruments Corporation of the United States, with the specific model being PXI-1050, the model of the internal controller being PXI-8196, the model of the sound acquisition card being NI4472B (8-channel synchronous acquisition, 24-bit resolution, sampling frequency of 102.4 kS / s), the sound sensor being MPA201 (Beijing Shengwang Acoustoelectronic Technology Co., Ltd., response frequency from 20 Hz to 20 kHz, sensitivity of 50 mV / Pa), and the sound recording software selects NI Sound and Vibration Assistant 2016, with a sampling frequency of 32 kHz, a sampling accuracy of 16 bit, and single-channel acquisition.
[0187] During the experiment, the breeding staff first placed 60 broiler samples in candidate area 1. Each time, the breeding staff selected one broiler from candidate area 1 and placed it in the experimental area to collect a segment of broiler sound signal. After the collection was completed, they were then placed in candidate area 2 in sequence. The duration of each collected broiler sound signal was 5 minutes, and there was a 5-minute interval between two collections. After a round of broiler sound signal collection was completed, the collection of the next round of broiler sound signals continued. At this time, the breeding staff selected broilers from candidate area 2 and placed them in the experimental area, and then placed them in candidate area 1 after the collection was completed. Through this repeatable cycle mode, multiple segments of broiler sound signals were collected. It can be seen that the broiler sound signals obtained through the above operations all contain pure sound categories, which is conducive to the initial development of the present invention. If the present invention directly collected broiler sound signals in the strip-shaped breeding area of No. 3 breeding shed, there might be some overlapping signals. After screening, the present invention selected 10 segments of healthy broiler sound signals and 10 segments of diseased broiler sound signals for the present invention. At the same time, the present invention separately copied these 20 segments of broiler sound signals and used the GoldWave audio editing software to clip out multiple sound segments representing different sound categories from these broiler sound signals. In addition, the present invention invited experienced breeding staff to listen to these 20 segments of broiler sound signals in sequence, and marked the sound categories of each sound segment that appeared in sequence in each segment of broiler sound signal, as well as the sound categories of each clipped sound segment.
[0188] The selected 20 segments of broiler sound signals were processed using the broiler sound signal filtering method of the present invention. First was the first stage, wavelet denoising processing. The present invention used the newly proposed wavelet denoising algorithm based on a continuously differentiable threshold function and scale threshold to process the 20 segments of broiler sound signals respectively, and obtained the broiler sound signals after wavelet denoising processing. As mentioned before, when performing wavelet denoising processing, the selection of the decomposition scale is very important. The larger the decomposition scale, the more obvious the different signal characteristics of the effective signal component and the noise, and the more conducive to the separation of the two. However, the larger the decomposition scale, the greater the distortion rate of the sound signal after denoising processing. Therefore, a suitable decomposition scale should be selected. Usually, low signal-to-noise ratio sound signals require a larger decomposition scale to further separate the effective signal component and the noise, while high signal-to-noise ratio sound signals only require a smaller decomposition scale to achieve a good denoising effect. In the present invention, considering that the broiler sound signals were collected in a separately built experimental area and the feeding time of the broilers was avoided, the quality of the broiler sound signals collected in the present invention was relatively high, and their signal-to-noise ratio performance was good. Therefore, in the present invention, the present invention set the level of wavelet decomposition to 4, that is, the wavelet basis sym4 was used. This is a suitable decomposition scale between a larger and a smaller decomposition scale. Figure 7The wavelet denoising effects obtained by wavelet thresholding methods using different threshold functions on a segment of broiler sound signals are presented. For the sake of the control variable method, they all use the wavelet basis sym4.
[0189] Figure 7 It can be seen from [the relevant content] that, compared with the original broiler sound signals, the quality of the four segments of broiler sound signals after wavelet denoising processing has been improved to varying degrees. Among them, the wavelet thresholding method using the hard threshold function has the worst denoising effect. It only removes some DC components on the basis of the original broiler sound signals, hardly outlines the contours of the effective signal components, and most of the effective signal components are still mixed with the noise, with some burrs. In contrast, the wavelet thresholding methods using the soft threshold and semi-soft threshold functions have better denoising effects. They not only greatly remove the DC components but also effectively filter out the noise on each useful pulse, and the waveform looks smoother. However, there are still some useful pulses or local waveforms with insignificant denoising effects. The wavelet denoising method based on the continuously differentiable threshold function and scale threshold proposed by the present invention has the best denoising effect. It removes most of the DC components in the original broiler sound signals, especially the DC components in the middle part of the broiler sound signals where there are multiple consecutive useful pulses. In addition, it effectively outlines the contours of almost all useful pulses, and each useful pulse is effectively distinguished from the connected DC components or adjacent useful pulses. Similarly, in the middle part of the broiler sound signals where there are multiple consecutive useful pulses, each useful pulse is clearly redrawn, and the concentrated DC components are effectively removed to display the main body of the useful pulses. This proves the reliability and superiority of the wavelet denoising algorithm proposed by the present invention.
[0190] Next, the present invention calculates the signal-to-noise ratio (SNR) and root mean square error (RMSE) of 20 segments of broiler sound signals processed by wavelet thresholding methods using different threshold functions to quantify their denoising effects and further highlight the superiority of the wavelet denoising algorithm proposed by the present invention, as shown in Table 3 and Table 4 respectively. At the same time, the present invention also calculates the SNR and RMSE of 20 segments of original broiler sound signals for comparison.
[0191] Table 3 Signal-to-noise ratio of broiler sound signals processed by different methods
[0192]
[0193]
[0194] Table 4 Root mean square error of broiler sound signals processed by different methods
[0195]
[0196]
[0197] As can be seen from the table, the signal-to-noise ratio of the broiler chicken sound signals of 20 segments processed by the wavelet denoising method based on the continuously differentiable threshold function and the scale threshold proposed by the present invention is the largest, and the root mean square error obtained is the smallest. After calculation, the average signal-to-noise ratio obtained is 8.7126, and the average root mean square error obtained is 0.4015. Compared with the average signal-to-noise ratio of 6.5863 and the average root mean square error of 0.8872 of the 20 segments of the original broiler chicken sound signals, they are increased by 2.1263 and decreased by 0.4857 respectively, and the increase or decrease amplitude is obvious. In addition, the average signal-to-noise ratio of the broiler chicken sound signals of 20 segments processed by the wavelet threshold method using the hard threshold function is 7.2099, and the average root mean square error obtained is 0.7359, both of which have a small increase or decrease, indicating that it has a certain denoising effect, but the increase amplitude is limited. This is consistent with Figure 7 the display effect. The average signal-to-noise ratios of the broiler chicken sound signals of 20 segments processed by the wavelet threshold method using the soft threshold function and the broiler chicken sound signals of 20 segments processed by the wavelet threshold method using the semi-soft threshold function are not much different, which are 7.5337 and 7.5575 respectively, and the root mean square errors obtained are also close, which are 0.6050 and 0.5989 respectively. Among them, the average signal-to-noise ratio obtained by the latter is slightly larger than that of the former, and the average root mean square error obtained is also slightly smaller than that of the former, indicating that the wavelet threshold method using the semi-soft threshold function is better than the wavelet threshold method using the soft threshold function. This is consistent with Figure 7 the analysis results. Generally speaking, the average signal-to-noise ratio and the average root mean square error of the broiler chicken sound signals of 20 segments processed by the wavelet denoising method based on the continuously differentiable threshold function and the scale threshold proposed by the present invention are 1.1685 higher and 0.1974 lower respectively than those of the broiler chicken sound signals of 20 segments processed by the wavelet threshold method using the semi-soft threshold function. These two differences are still relatively obvious. This once again shows the superiority of the wavelet denoising algorithm proposed by the present invention.
[0198] Based on the broiler chicken sound signals of 20 segments processed by the wavelet denoising method proposed by the present invention, the present invention uses the newly proposed two-stage variable multi-threshold pulse extraction algorithm for processing again to complete the second stage of processing of the broiler chicken sound signal filtering method proposed by the present invention, and obtains 20 segments of broiler chicken sound signals after complete signal filtering. It should be noted that referring to step eight of the two-stage variable multi-threshold pulse extraction algorithm given in Section 3, the present invention needs to set the duration threshold T t , and according to the time threshold T tRemove noise pulses. As mentioned above, the broiler sound signal mainly includes four sound categories: chirping, coughing, snoring and flapping. Among them, chirping is a short-lived sound category with a short duration, while the other three sound categories have a relatively long duration. In addition, in the broiler breeding greenhouse, the intermittent operation of the water pump or the manure remover will produce sudden and sharp noises, which appear as independent pulses, similar to the useful pulses of the effective signal components. The duration of these noise pulses is also relatively long. Figure 9 Waveform diagrams of three sound categories and (burst) noise are given.
[0199] It can be seen from the figure that the duration of the noise pulse is one order of magnitude longer than that of the other three sound categories. Therefore, the present invention only needs to use the longest duration of the three sound categories as a reference to set the duration threshold T t , the noise pulse can be effectively removed. Specifically, the duration of the flapping sound is the longest, lasting about 23,000 sampling points. Considering that the sampling frequency of the signal acquisition system used in the present invention is 32kHz, the duration of the flapping sound is about 1÷32000×23000=0.71875 seconds. Therefore, the present invention sets the time threshold T t =0.72s. Figure 10 The waveform diagram (partial) of a broiler sound signal processed by a two-stage variable multi-threshold pulse extraction algorithm is shown.
[0200] Figure 10 The vertical lines appearing in time sequence in the figure are grouped into two, corresponding to the start and end time of a useful pulse (actually Figure 10 The red and yellow vertical lines in the figure respectively represent the starting time and the ending time of the useful pulse). It can be seen from the figure that the useful pulses of each sound category are accurately extracted, and the noise pulses are ignored. In addition, it can be seen from the figure that even if multiple useful pulses appear continuously and densely, the two-stage variable multi-threshold pulse extraction algorithm proposed in the present invention still accurately extracts each useful pulse, and there is no problem of multiple pulses. This fully illustrates the feasibility and accuracy of the proposed two-stage variable multi-threshold pulse extraction algorithm. So far, the present invention obtains 20 segments of broiler sound signals after complete signal filtering, and calculates their signal-to-noise ratio and root mean square error respectively, and obtains the average signal-to-noise ratio and average root mean square error, as shown in Table 5.
[0201] Table 5 Average signal-to-noise ratio and average root mean square error obtained at different stages of signal filtering
[0202]
[0203]
[0204] As can be seen from the table, after pulse extraction processing, the average signal-to-noise ratio of the 20 segments of broiler chicken sound signals has increased by a certain margin, and the average root mean square error has decreased by a certain margin, which are 0.0122 and 0.0029 respectively. This indicates the necessity of pulse extraction. Although the improvement or reduction seems to be relatively small, after careful analysis, it is found that when the pulses of the noise are removed, the length of the effective signal components of the pulses originally containing noise is reduced by a part, and at the same time, the total length of the Gaussian white noise in the broiler chicken sound signals is also reduced by the same part. Referring to formula (7), it can be known that when the numerator and denominator are reduced by the same value at the same time, the overall reduction is not very obvious. In contrast, keeping the numerator unchanged and reducing the denominator will bring obvious changes. The same analysis results can be obtained from formula (8). Generally speaking, compared with the average signal-to-noise ratio of 6.5863 and the average root mean square error of 0.8872 obtained from the 20 segments of the original broiler chicken sound signals, the average signal-to-noise ratio of the 20 segments of broiler chicken sound signals processed by the signal filtering method proposed in the present invention has increased by 2.1385, and the average root mean square error has decreased by 0.4886, and the improvement and reduction amplitudes are obvious. This fully demonstrates the superiority of the signal filtering method proposed in the present invention.
[0205] Finally, from the perspective of classification accuracy in machine learning, the signal filtering method proposed in the present invention is verified again. For 20 segments of original broiler sound signals, the present invention calculates the values of 41 sound features shown in Table 1 on each useful pulse respectively, and constructs multiple feature vectors. Referring to the sound category recognition results given by experienced breeders, that is, the recognition results of useful pulses, labels are added to the feature vectors to obtain multiple pieces of feature data, and a feature dataset is constructed, which is called the original feature dataset. Similarly, for 20 segments of broiler sound signals processed by the wavelet threshold method using the hard threshold function, 20 segments of broiler sound signals processed by the wavelet threshold method using the soft threshold function, 20 segments of broiler sound signals processed by the wavelet threshold method using the semi-soft threshold function, and 20 segments of broiler sound signals processed by the signal filtering method proposed in the present invention, the present invention constructs four feature datasets through the same processing process, which are respectively called the hard threshold feature dataset, the soft threshold feature dataset, the semi-soft threshold feature dataset, and the new feature dataset. It should be noted that there are noisy pulses in the original broiler sound signals and the broiler sound signals not processed by the signal filtering method proposed in the present invention, and experienced breeders will identify them. Therefore, during the construction of the feature dataset, the values of sound features are not calculated for these pulses and they are discarded artificially. This is actually similar to the pulse extraction stage in the signal filtering method proposed in the present invention. In addition, for the consideration of article length and description of similar content, the specific information of each feature dataset is not listed here, and only the new feature dataset is shown, as shown in Table 6. The total number of feature data in the other four feature datasets, as well as the number of feature data with four labels, are all similar to it. In addition, the number of feature data with four labels in the five feature datasets is approximately equal to ensure that there is no data imbalance problem.
[0206] Table 6 Specific description of the new feature dataset
[0207]
[0208] In previous studies of the present invention, the random forest was determined to be the classifier with the best classification performance, and its main parameter configuration is shown in Table 7, and the remaining parameters are kept at the default configuration. Therefore, in the present invention, it is used to perform ten-fold cross-validation on the five feature datasets respectively, and ten classification accuracies are obtained respectively, as Figure 11 shown.
[0209] Table 7 Main parameter configuration of the random forest
[0210]
[0211] From Figure 11It can be seen that the classification accuracy achieved by the random forest on the other four feature datasets is higher than that on the original feature dataset, indicating the necessity of signal filtering. Among them, the random forest achieves the highest classification accuracy on the new feature dataset, representing the highest quality of the 20 segments of broiler chicken sound signals used to establish it, that is, the best filtering effect of the signal filtering method proposed in the present invention. The classification accuracy achieved by the random forest on the hard threshold feature dataset is the lowest, representing the general filtering effect of the wavelet threshold method using the hard threshold function. The classification accuracies achieved by the random forest on the soft threshold feature dataset and the semi-soft threshold feature dataset are both significantly higher than that on the hard threshold feature dataset and significantly lower than that on the new feature dataset, and there is a relatively obvious overlapping phenomenon between the two. This is consistent with the results of quantitative analysis using the signal-to-noise ratio and root mean square error. After calculation, the average classification accuracies achieved by the random forest on the original feature dataset, the hard threshold feature dataset, the soft threshold feature dataset, the semi-soft threshold feature dataset, and the new feature dataset are 77.60%, 80.45%, 84.65%, 85.40%, and 91.93% respectively. Therefore, from the perspective of classification accuracy in the field of machine learning, the present invention once again verifies the superiority of the signal filtering method proposed in the present invention. Considering the three evaluation indicators of signal-to-noise ratio, root mean square error, and classification accuracy, the feasibility, practicability, and superiority of the signal filtering method proposed in the present invention are widely verified.
[0212] Sound category analysis: The present invention transfers the analysis object from the entire sound signal to the sound segment, that is, the sound category. For the 20 segments of original broiler chicken sound signals, the present invention clips out multiple sound segments from them, corresponding to multiple sound categories, and the identification results of each sound segment are given by experienced breeders. The present invention uses the broiler chicken sound signal filtering method proposed in the present invention to process these sound segments to obtain multiple processed sound segments. It should be noted that since the sound segment is actually an independent useful pulse, when extracting the pulse, in fact, the zero pulses in the front section before the start and end of the sound segment are removed. Figure 12 Waveform diagrams of four representative sound categories before and after signal filtering are given, where (a), (b), (c), and (d) correspond to crowing, coughing, grunting, and flapping sounds respectively.
[0213] From Figure 12It can be seen that the quality of the four sound categories processed by the signal filtering method proposed in the present invention has been significantly improved, further proving its feasibility and practicality. On this basis, the present invention calculates the signal-to-noise ratio and root mean square error of each sound segment. According to the sound category corresponding to the sound segment, the present invention calculates the average signal-to-noise ratio and average root mean square error of multiple sound segments belonging to the same sound category. At the same time, in order to compare with other wavelet threshold methods, the present invention uses the wavelet threshold method with a hard threshold function, the wavelet threshold method with a soft threshold function, and the wavelet threshold method with a semi-soft threshold function to process the original sound segments, obtaining three sets of processed sound segments. Similarly, in each set of sound segments, the present invention calculates the average signal-to-noise ratio and average root mean square error of multiple sound segments belonging to the same sound category. At the same time, the present invention also calculates the signal-to-noise ratio and root mean square error of the original sound segments, corresponding to obtaining the average signal-to-noise ratio and average root mean square error of each sound category. Table 8 gives the summary information of these average signal-to-noise ratios and average root mean square errors.
[0214] Table 8 Summary information of the average signal-to-noise ratio and average root mean square error of the four sound categories
[0215]
[0216]
[0217] It can be seen from the table that in the set of sound segments processed by the signal filtering method proposed in the present invention, the average signal-to-noise ratio calculated for the four sound categories is the largest, and the average root mean square error is the smallest. Still, in the set of sound segments processed by the wavelet threshold method with a hard threshold function, the average signal-to-noise ratio calculated for the four sound categories is the smallest, and the average root mean square error is the largest. In the sets of sound segments processed by the wavelet threshold method with a soft threshold function and the wavelet threshold method with a semi-soft threshold function respectively, the average signal-to-noise ratio and average root mean square error calculated for the four sound categories are similar and between the aforementioned best and worst. These analysis results are consistent with the analysis results in Table 3 and Table 4, indicating that the effects of different signal filtering methods on the entire broiler sound signal or a single sound category are synchronous, and the signal filtering method proposed in the present invention is the best.
[0218] Referring to the above verification steps, next, the present invention should verify the signal filtering method proposed by the present invention from the perspective of classification accuracy in the field of machine learning. That is, the present invention needs to calculate the values of 41 voice features shown in Table 1 for each voice segment in the set of original voice segments, and construct a feature vector. By adding the recognition results given by experienced breeders as labels, an original feature data set is established. Each voice segment is actually a voice category, a useful pulse. Through the same processing steps, a feature data set can be established for each of the set of voice segments processed by the wavelet threshold method using the hard threshold function, the set of voice segments processed by the wavelet threshold method using the soft threshold function, the set of voice segments processed by the wavelet threshold method using the semi-soft threshold function, and the set of voice segments processed by the signal filtering method proposed by the present invention, for a total of four feature data sets. By comparing which feature data set gives the best ten-fold cross-validation result for the random forest, it is proved that the quality of this feature data set is the best, and the signal filtering method for the corresponding set of voice segments is the best. Does it seem familiar? Indeed, the processing steps here are exactly the same as the verification in the last part of Section 4.2. Therefore, the verification of this part will not be elaborated here. Instead, the present invention evaluates the classification effect obtained by the random forest on the feature data of each label in each feature data set here, by using the F1 score as the evaluation metric. Similarly, for ease of description, the present invention names the above five feature data sets as the original feature data set, the hard threshold feature data set, the soft threshold feature data set, the semi-soft threshold feature data set, and the new feature data set respectively. Figure 13 The F1 scores obtained by the random forest on the feature data of each label in the five feature data sets are given.
[0219] As can be seen from the figure, the F1 scores obtained by the random forest on the feature data of the four labels in the new feature data set are all the highest. This shows that when the voice segment is used as the analysis object, the superiority of the signal filtering method proposed by the present invention can also be proved. The F1 scores obtained by the random forest on the feature data of the four labels in the semi-soft threshold feature data set, the soft threshold feature data set, and the hard threshold feature data set decrease in turn, which is consistent with the results of quantitative analysis using the signal-to-noise ratio and the root mean square error. In addition, it is worth noting that the F1 scores obtained by the random forest on the feature data of the four labels in each feature data set are relatively balanced, which indicates that the number of feature data of the four labels in the five feature data sets is also balanced. To sum up, when the voice segment is used as the analysis object, considering the three evaluation metrics of signal-to-noise ratio, root mean square error, and classification accuracy, the feasibility, practicability, and superiority of the signal filtering method proposed by the present invention are also widely verified.
[0220] Comparison experiment of different filtering methods
[0221] As described in the introduction of the present invention, some scholars have also carried out research on the filtering method of broiler chicken sound signals, mainly including the basic spectral subtraction method used by Carpentier et al., the combined filtering method of improved spectral subtraction and high-pass filtering used by Cuan et al., and the Wiener filtering with the best performance used by Sun et al. Therefore, in this subsection, the present invention designed the programs of the above basic spectral subtraction, improved spectral subtraction + high-pass filtering, and Wiener filtering, and processed 20 segments of original broiler chicken sound signals respectively, obtaining 20 segments of broiler chicken sound signals processed by each filtering method. On this basis, the present invention calculated their signal-to-noise ratios and root mean square errors respectively, as shown in Table 9 and Table 10. The present invention listed the signal-to-noise ratios and root mean square errors obtained by the signal filtering method proposed by the present invention in the last column of the two tables for comparison.
[0222] Table 9 Signal-to-noise ratios of broiler chicken sound signals processed by different signal filtering methods
[0223]
[0224] Table 10 Root mean square errors of broiler chicken sound signals processed by different signal filtering methods
[0225]
[0226]
[0227] As can be clearly seen from Table 9 and Table 10, the signal-to-noise ratio of the broiler sound signals processed by the 20-segment signal filtering method proposed in the present invention is the largest, and the root mean square error obtained is the smallest. Specifically, the average signal-to-noise ratio obtained is 8.7126, and the average root mean square error obtained is 0.4015. The signal-to-noise ratio and root mean square error of the broiler sound signals processed by Wiener filtering for 20 segments are sub-optimal, indicating that among the basic spectral subtraction, improved spectral subtraction + high-pass filtering, and Wiener filtering, Wiener filtering is the best performer. Specifically, the average signal-to-noise ratio obtained is 7.2936, and the average root mean square error obtained is 0.6842. This is consistent with the research results of Sun et al. The signal-to-noise ratio of the broiler sound signals processed by the basic spectral subtraction for 20 segments is the smallest, and the root mean square error obtained is the largest, indicating that it achieves a relatively average filtering effect. Specifically, the average signal-to-noise ratio obtained is 7.0886, and the average root mean square error obtained is 0.7973. In contrast, the signal-to-noise ratio of the broiler sound signals processed by the improved spectral subtraction + high-pass filtering for 20 segments is slightly increased, and the root mean square error obtained is slightly decreased, which is also consistent with the research results of Sun et al. Specifically, the average signal-to-noise ratio obtained is 7.1854, and the average root mean square error obtained is 0.7499. At the same time, referring to Table 4 and Table 5, it can be seen that the average signal-to-noise ratio obtained by the wavelet threshold method using the hard threshold function for 20 segments is 7.2099, and the average root mean square error obtained is 0.7359. Among them, the average signal-to-noise ratio obtained is better than that of the broiler sound signals processed by the basic spectral subtraction for 20 segments and the broiler sound signals processed by the improved spectral subtraction + high-pass filtering for 20 segments, and the average root mean square error obtained is better than that of the broiler sound signals processed by the basic spectral subtraction for 20 segments, and slightly lower than that of the broiler sound signals processed by the improved spectral subtraction + high-pass filtering for 20 segments. However, the average signal-to-noise ratio obtained by the wavelet threshold method using the soft threshold function for 20 segments is 7.5337, and the average root mean square error obtained is 0.6050. It can be seen that both the average signal-to-noise ratio and the average root mean square error are significantly better than those of the broiler sound signals processed by the basic spectral subtraction for 20 segments, the broiler sound signals processed by the improved spectral subtraction + high-pass filtering for 20 segments, and the broiler sound signals processed by Wiener filtering for 20 segments. Not to mention the average signal-to-noise ratio and average root mean square error obtained by the wavelet threshold method using the semi-soft threshold function for 20 segments. The above analysis results indicate that it is crucial to conduct in-depth analysis of the signal characteristics of the effective signal components and noise to carry out the research on broiler sound signal filtering, which effectively demonstrates the rationality of developing the present invention.
[0228] The above numerical examples of the present invention are only for explaining in detail the calculation model and calculation process of the present invention, rather than limiting the implementation manners of the present invention. For those of ordinary skill in the art, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation manners here. Any obvious changes or modifications derived from the technical solutions of the present invention still fall within the protection scope of the present invention.
Claims
1. A filtering method for broiler sound signals that integrates wavelet denoising and pulse extraction, characterized in that, For the sound signal of broiler chickens, wavelet denoising is first performed, and then a two-stage variable multi-threshold pulse extraction algorithm is used to extract pulses; In the process of wavelet denoising, the threshold function used is as follows: Among them, λ(x) represents the threshold function, x represents the independent variable, and T represents the threshold; In the process of using the two-stage variable multi-threshold pulse extraction algorithm to extract pulses, two rounds of pulse extraction are carried out. In the first round of pulse extraction, the peak energy threshold is used to find the peaks of useful pulses, and at the same time, the first endpoint energy threshold and the first endpoint zero-crossing rate threshold are used to find the starting point and ending point of useful pulses; in the second round of pulse extraction, based on the results of the first round of pulse extraction, the second endpoint energy threshold and the second endpoint zero-crossing rate threshold are used to accurately find the starting point and ending point of useful pulses again.
2. The filtering method for broiler chicken sound signals by integrating wavelet denoising and pulse extraction according to claim 1, wherein, The threshold T adopts an adaptive scale threshold, and the calculation process is as follows: Among them, σ is the standard deviation of the noise, N represents the number of sampling points in the sound signal, and i is the wavelet decomposition scale.
3. The filtering method for broiler chicken sound signals by fusing wavelet denoising and pulse extraction according to claim 2, characterized in that, The specific process of wavelet denoising includes the following steps: First, the noisy sound signal of broiler chickens is wavelet decomposed to obtain a set of wavelet coefficients; then, the high-frequency coefficients of each layer of the wavelet decomposition are subjected to threshold quantization processing to obtain the estimated values of the wavelet coefficients; then, the wavelet coefficients after threshold quantization processing are subjected to inverse wavelet transform to reconstruct the sound signal, and the denoised sound signal is obtained.
4. The filtering method for broiler chicken sound signals by fusing wavelet denoising and pulse extraction according to claim 1, 2 or 3, characterized in that, The process of the first round of pulse extraction includes the following steps: S101: Calculate the average energy and average zero-crossing rate of the entire sound signal, denoted as E a and Z a , calculate the standard deviation of the energy and the standard deviation of the zero-crossing rate of the entire sound signal, denoted as σ E and σ Z ; Set the spike energy threshold to E p = E a + 3σ E , set the first endpoint energy threshold to E be_1 = E e + σ E , set the first endpoint zero-crossing rate threshold to Z be_1 = Z a + σ Z ; S102: Frame the sound signal and calculate the energy and zero-crossing rate of each frame signal; S103: Starting from the first frame signal, compare the energy of each frame signal with E in sequence p ; When the energy of a certain frame signal is greater than E p , starting from this frame signal, continue to compare the energy of each subsequent frame signal with E p , until the energy of a certain frame signal is less than E p ; Find the frame signal with the maximum energy among these frame signals, and identify it as the peak of the current useful pulse; Obtain the time of this frame signal, which is called the peak time t of the current useful pulse p ; S104: Using the spike time t of the currently extracted useful pulse in S103 as the starting point, compare the energy of each frame signal with E respectively forward and backward p until the energy of a certain frame signal is found to be less than E in both directions be_1 ; respectively determine the previous frame signal of these two frame signals as the first candidate starting frame signal and the first candidate ending frame signal of the current useful pulse; obtain the times of these two frame signals, which are called the first candidate starting time t be_1 of the current useful pulse and the first candidate ending time t b_f1 ; e_f1 S105: Using the spike time t of the currently extracted useful pulse in S103 as the starting point, compare the zero-crossing rate of each frame signal with Z respectively forward and backward p until the zero-crossing rate of a certain frame signal is found to be less than Z in both directions be_1 ; respectively determine the previous frame signals of these two frame signals as the first candidate start frame signal and the first candidate end frame signal of the current useful pulse; obtain the times of these two frame signals, called the first candidate start time t of the current useful pulse be_1 and the first candidate end time t b_f2 ; e_f2 ; S106: Compare the first candidate start time 1 and the first start time 2, and determine the larger one as the final start time t b_1 ; Compare the first candidate end time 1 and the first end time 2, and determine the smaller one as the final end time t e_1 ; S107: Using the next frame signal after the larger first candidate termination moment in S106 as the new starting point, repeat S103 to S106 to extract the second useful pulse; and so on, until the last frame signal of the sound signal is searched, and the extraction of the useful pulses in the first round is completed; S108: Calculate the difference between the termination time and the start time of each useful pulse to obtain the duration of each useful pulse; based on the duration threshold T t , remove the useful pulses with a duration greater than the duration threshold, and retain the remaining useful pulses for the second-round pulse extraction.
5. The filtering method for broiler chicken sound signals by integrating wavelet denoising and pulse extraction according to claim 4, characterized in that, The process of the second round of pulse extraction includes the following steps: S201: Set the second endpoint energy threshold to E be_2 = E a + 2σ E and set the second endpoint zero crossing rate threshold to Z be_2 = Z a + 2σ z ; S202: Starting from the first useful pulse retained in S108, obtain the spike time t of the current useful pulse p as the starting point, compare the energy of each frame signal with E be_2 respectively forward and backward until it is found that the energy of a certain frame signal is less than E be_2 in both directions; respectively identify the previous frame signals of these two frame signals as the second candidate starting frame signal and the second candidate ending frame signal of the current useful pulse; obtain the times of these two frame signals, called the second candidate starting time - t b_s1 and the second candidate ending time - t e_s1 ; S203: Starting from the first useful pulse retained from the first-round pulses, obtain the spike time t of the current useful pulse p as the starting point, and compare the zero-crossing rate of each frame signal with Z be_ respectively forward and backward until the zero-crossing rate of a certain frame signal is found to be less than Z be_ in both directions; respectively identify the previous frame signals of these two frame signals as the second candidate starting frame signal and the second candidate ending frame signal of the current useful pulse; obtain the times of these two frame signals, which are called the second candidate starting time t of the current useful pulse b_s2 and the second candidate ending time t e_s2 ; S204: Compare the first second-candidate termination time and the second second-candidate termination time, and determine the smaller one as the final termination time t e_2 ; S205: Starting from the second useful pulse retained in the first round of pulse extraction, repeat the processing steps of S202 to S204; and so on, until all the useful pulses retained in the first round of pulse extraction are processed; S206: Calculate the difference between the termination time and the start time of each processed useful pulse to obtain the duration of each processed useful pulse; calculate the ratio of the duration of each processed useful pulse to the duration of the corresponding useful pulse before processing in S108; if the ratio is greater than or equal to the ratio threshold, then the final start time t b_1 and the final termination time t e_1 are recognized as the true final start time t b and the true final termination time t e of the current useful pulse; if the ratio is less than the ratio threshold, then the final start time t b_1 in S106 and the final termination time t e_2 in S204 are recognized as the true final start time t b and the true final termination time t e of the current useful pulse; S207: Retain the useful pulses after the processing of S206 to complete the extraction of the useful pulses in the second round.
6. A broiler chicken sound signal filtering system that integrates wavelet denoising and impulse extraction, characterized in that, The system includes a wavelet denoising unit and a two-stage variable multi-threshold pulse extraction unit; Wavelet denoising unit: Perform wavelet denoising on the sound signal of broiler chickens; In the process of wavelet denoising, the threshold function used is as follows: Among them, λ(x) represents the threshold function, x represents the independent variable, and T represents the threshold; Two-stage variable multi-threshold pulse extraction unit: The two-stage variable multi-threshold pulse extraction algorithm is used for pulse extraction; during the process of using the two-stage variable multi-threshold pulse extraction algorithm for pulse extraction, two rounds of pulse extraction are carried out. In the first round of pulse extraction, the peak energy threshold is used to find the peaks of useful pulses, and at the same time, the first endpoint energy threshold and the first endpoint zero-crossing rate threshold are used to find the starting point and ending point of useful pulses; in the second round of pulse extraction, based on the results of the first round of pulse extraction, the second endpoint energy threshold and the second endpoint zero-crossing rate threshold are used to accurately find the starting point and ending point of useful pulses again.
7. The filtering system for broiler chicken sound signals integrating wavelet denoising and pulse extraction according to claim 6, wherein The threshold T adopts an adaptive scale threshold, and the calculation process is as follows: where σ is the standard deviation of the noise, N represents the number of sampling points in the sound signal, and i is the wavelet decomposition scale.
8. The filtering system for broiler chicken sound signals that integrates wavelet denoising and pulse extraction according to claim 7, characterized in that, The specific process of wavelet denoising by the wavelet denoising unit includes the following steps: First, the noisy broiler sound signal is wavelet decomposed to obtain a set of wavelet coefficients; then, the high-frequency coefficients of each layer of the wavelet decomposition are subjected to threshold quantization processing to obtain the estimated values of the wavelet coefficients; then, the wavelet coefficients after threshold quantization processing are subjected to inverse wavelet transform to reconstruct the sound signal to obtain the denoised sound signal.
9. The filtering system for broiler chicken sound signals integrating wavelet denoising and pulse extraction according to claim 6, 7 or 8, characterized in that, The process of the first round of pulse extraction in the two-stage variable multi-threshold pulse extraction unit includes the following steps: S101: Calculate the average energy and average zero-crossing rate of the entire sound signal, denoted as E a and Z a , calculate the standard deviation of the energy and the standard deviation of the zero-crossing rate of the entire sound signal, denoted as σ E and σ Z ; Set the peak energy threshold to E p = E a + 3σ E , set the first endpoint energy threshold to E be_1 = E a + σ E , set the first endpoint zero-crossing rate threshold to Z be_1 = Z a + σ Z ; S102: Frame the sound signal and calculate the energy and zero-crossing rate of each frame signal; S103: Starting from the first frame signal, compare the energy of each frame signal with E in sequence p ; When the energy of a certain frame signal is greater than E p , starting from this frame signal, continue to compare the energy of each subsequent frame signal with E p , until the energy of a certain frame signal is less than E p ; Find the frame signal with the maximum energy among these frame signals and identify it as the peak of the current useful pulse; Obtain the time of this frame signal, which is called the peak time t of the current useful pulse p ; S104: Using the spike time t of the currently extracted useful pulse in S103 as the starting point, compare the energy of each frame signal with E respectively forward and backward p until the energy of a certain frame signal is found to be less than E in both directions be_1 ; respectively determine the previous frame signals of these two frame signals as the first candidate starting frame signal and the first candidate ending frame signal of the current useful pulse; obtain the times of these two frame signals, called the first candidate starting time t of the current useful pulse be_1 and the first candidate ending time t b_f1 ; e_f1 ; S105: Using the spike time t of the currently extracted useful pulse in S103 as the starting point, compare the zero-crossing rate of each frame signal with Z respectively forward and backward p until the zero-crossing rate of a certain frame signal is found to be less than Z in both directions be_1 ; respectively identify the previous frame signals of these two frame signals as the first candidate start frame signal and the first candidate end frame signal of the current useful pulse; obtain the times of these two frame signals, which are called the first candidate start time t of the current useful pulse be_1 and the first candidate end time t b_f2 ; e_f2 S106: Compare the first candidate start time 1 and the first start time 2, and determine the larger one as the final start time t b_1 ; Compare the first candidate end time 1 and the first end time 2, and determine the smaller one as the final end time t e_1 ; S107: Take the next frame signal after the larger first candidate end time in S106 as the new starting point, repeat S103 to S106 to extract the second useful pulse; and so on until the last frame signal of the sound signal is searched, and the extraction of the first-round useful pulses is completed; S108: Calculate the difference between the termination time and the start time of each useful pulse to obtain the duration of each useful pulse; based on the duration threshold T t , remove the useful pulses with a duration greater than the duration threshold, and retain the remaining useful pulses for the second round of pulse extraction.
10. The filtering system for broiler chicken sound signals that integrates wavelet denoising and pulse extraction according to claim 9, wherein The process of the second round of pulse extraction in the two-stage variable multi-threshold pulse extraction unit includes the following steps: S201: Set the second endpoint energy threshold to E be_2 = E a + 2σ E , and set the second endpoint zero-crossing rate threshold to Z be_2 = Z a + 2σ Z ; S202: Starting from the first useful pulse retained in S108, obtain the spike time t of the current useful pulse p as the starting point, and compare the energy of each frame signal with E be_2 respectively forward and backward until it is found that the energy of a certain frame signal is less than E be_2 in both directions; respectively identify the previous frame signals of these two frame signals as the second candidate starting frame signal and the second candidate ending frame signal of the current useful pulse; obtain the times of these two frame signals, which are called the second candidate starting time -t b_s1 and the second candidate ending time -t e_s1 ; S203: Starting from the first useful pulse retained from the first-round pulses, obtain the spike time t of the current useful pulse p as the starting point, and compare the zero-crossing rate of each frame signal with Z be_2 forward and backward respectively until it is found that the zero-crossing rate of a certain frame signal is less than Z be_2 in both directions; respectively identify the previous frame signals of these two frame signals as the second candidate starting frame signal and the second candidate ending frame signal of the current useful pulse; obtain the times of these two frame signals, which are called the second candidate starting time t b_s2 and the second candidate ending time t e_s2 ; S204: Compare the first second-candidate termination time and the second second-candidate termination time, and determine the smaller one as the final termination time t e_2 ; S205: Starting from the second useful pulse retained in the first round of pulse extraction, repeat the processing steps of S202 to S204; and so on until all the useful pulses retained in the first round of pulse extraction are processed; S206: Calculate the difference between the termination time and the start time of each processed useful pulse to obtain the duration of each processed useful pulse; calculate the ratio of the duration of each processed useful pulse to the duration of the corresponding useful pulse before processing in S108; if the ratio is greater than or equal to the ratio threshold, then use the final start time t b_1 and the final termination time t e_1 in S106 as the true final start time t b and the true final termination time t e of the current useful pulse; if the ratio is less than the ratio threshold, then use the final start time t b_1 in S106 and the final termination time t e_2 in S204 as the true final start time t b and the true final termination time t e of the current useful pulse; S207: Retain the useful pulses after the processing of S206 to complete the extraction of the second-round useful pulses.