A method for identifying the type of lightning weak electric field signals

Through discrete Fourier transform, Gaussian function smoothing and wavelet decomposition technology, combined with the steepness index optimization mode merging, the characteristics of the lightning electric field signal are extracted, and the problem of low recognition accuracy of lightning weak electric field signal type is solved, which significantly improves the recognition accuracy .

CN117591952BActive Publication Date: 2024-11-19NANTONG UNIV +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311741098.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-15
Publication Date
2024-11-19
Estimated Expiration
2043-12-15

AI Technical Summary

Technical Problem

The prior art has low accuracy when identifying the type of lightning weak electric field signal, and has a great impact on the environmental noise, interference and signal attenuation of the test station.

Method used

Discrete Fourier transform, Gaussian function smoothing, maximizing variance division between classes, empirical wavelet division structure and steepness index merge mode components, extract signal characteristics, and input the trained classification model for type recognition.

Benefits of technology

The accuracy of type recognition of lightning weak electric field signals is improved, and the local characteristics of different types of weak electric field signals can be extracted more effectively.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117591952B_ABST
    Figure CN117591952B_ABST
Patent Text Reader

Abstract

The present application relates to a type identification method for a lightning weak electric field signal. The method comprises: obtaining a lightning electric field signal sequence to be identified for discrete Fourier transform, smoothing and partitioning of an optimal threshold, and determining an interval boundary, constructing a filter according to the interval boundary, and determining an empirical wavelet function and an empirical scaling function, obtaining a mode component of an empirical wavelet structure, merging the mode components based on a steepness index, obtaining a merged mode component, and analyzing the frequency mean, centroid frequency, frequency root mean square, and frequency standard deviation of the merged mode component as signal features, inputting the signal features into a trained classification model for type identification, and determining the signal type to which the lightning electric field signal sequence belongs, thereby, especially for the identification of lightning weak electric field signals, the local features of different types of weak lightning electric field signals can be fully extracted, thereby improving the accuracy of type identification of weak lightning electric field signals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of lightning signal recognition, and in particular to a method for identifying the type of lightning weak electric field signals. Background Art

[0002] Thunderstorm climate is a common weather phenomenon that occurs in small and medium-scale convective systems. Thunderstorm weather is often accompanied by lightning activity, which can cause forest and oil depot fires, power supply and communication information system failures or damage, and pose a major threat to aerospace, mining and some important and sensitive high-tech equipment. After the 1980s, the hazards caused by lightning increased significantly, especially in fields closely related to high-tech, such as aerospace, national defense, communications, electricity, computers, and electronics industries. The widespread use of large-scale and ultra-large-scale integrated circuits that are extremely sensitive to lightning electromagnetic interference has greatly increased the probability of being struck by lightning.

[0003] In recent years, artificial intelligence algorithms have gradually been used to identify lightning characteristic signals, so as to distinguish between cloud-to-ground lightning and ground-to-ground lightning, playing an important role in preventing lightning disasters. At the same time, they can also identify special lightning discharge waveforms, such as the highly ionizing terrestrial gamma-ray flashes (TGFs) produced by the upward negative leader in the initial stage of lightning, which can serve as an important technical guarantee for exploring the transmission mechanism and physical mechanism of lightning.

[0004] From the time lightning starts to the time it develops to the ground, high-rise buildings will also develop upward leaders accordingly, and connect with the downward leaders of lightning to form return strokes. If the weak electric field signal radiated by the leader process in the cloud where lightning starts, or the upward leader signal generated by the building can be detected, it will be crucial for active lightning protection technology. However, both ground lightning return strokes and TGF are highly recognizable lightning signals. Considering many issues such as environmental noise and interference at the measuring station, signal attenuation and sampling, it is difficult to identify the type of weak lightning electric field signals. Therefore, the accuracy of type identification of weak lightning electric field signals is currently low. Summary of the invention

[0005] Based on this, it is necessary to provide a method for identifying the type of lightning weak electric field signals, which can improve the accuracy of type identification of weak lightning electric field signals, in order to address the above technical problems.

[0006] A method for identifying the type of a lightning weak electric field signal, the method comprising:

[0007] Obtaining a lightning electric field signal sequence to be identified and performing discrete Fourier transform to obtain a spectrum signal of the lightning electric field signal;

[0008] Using a Gaussian function to smooth the frequency spectrum signal of the lightning electric field signal to obtain a smoothed frequency spectrum signal;

[0009] The smoothed spectrum signal is divided into two parts, and the optimal threshold T for dividing the smoothed spectrum signal is obtained by adopting the principle of maximizing the inter-class variance;

[0010] Get the minimum value of the smoothed spectrum signal with respect to the variable k, and calculate the spatial curve C corresponding to different minimum values i Length L i , and the length L i Compared with the optimal threshold T, the length L i The coordinates corresponding to the minimum value greater than the optimal threshold T are taken as the interval boundary;

[0011] Construct a filter based on the interval boundary and determine the empirical wavelet function ψ i (ω) and the empirical scaling function Obtain the mode components of the empirical wavelet structure;

[0012] The mode components are merged based on the steepness index to obtain the merged mode component A, and the frequency mean, center of gravity frequency, frequency root mean square, and frequency standard deviation of the merged mode component A are analyzed as signal features;

[0013] The signal features are input into a trained classification model for type recognition to determine the signal type to which the lightning electric field signal sequence belongs.

[0014] In one embodiment, the classification model is trained as follows:

[0015] Obtain different types of lightning electric field signal samples and corresponding type labels to obtain a lightning electric field signal sample set;

[0016] Extracting features from the lightning electric field signal samples in the lightning electric field signal sample set to obtain a signal feature sample set;

[0017] Normalizing the signal feature samples in the signal feature sample set to obtain a normalized signal feature sample set;

[0018] Dividing the normalized signal feature sample set into a training set and a test set according to a preset division ratio;

[0019] Setting a nearest neighbor number threshold K, using the training set to train a classification model based on an improved K nearest neighbor algorithm, and obtaining a trained classification model;

[0020] According to the nearest neighbor number threshold K, the test set is used to test the trained classification model to obtain a test result, and whether the preset accuracy requirement is met is determined according to the test result. If the preset accuracy requirement is met, a trained classification model is obtained; if the preset accuracy requirement is not met, the set nearest neighbor number threshold K is returned, and the training set is used to train the classification model based on the improved K nearest neighbor algorithm to obtain the trained classification model, until the test result meets the preset accuracy requirement and a trained classification model is obtained.

[0021] In one embodiment, the step of obtaining a sequence of lightning electric field signals to be identified and performing discrete Fourier transform to obtain a spectrum signal of the lightning electric field signal includes:

[0022] A lightning electric field signal sequence to be identified is obtained, and the lightning electric field signal sequence to be identified is recorded as x(n), where n∈[0, N-1], and N is the length of the lightning electric field signal sequence to be identified. A discrete Fourier transform is performed on the lightning electric field signal sequence to be identified to obtain the frequency components of the lightning electric field signal sequence to be identified in the frequency domain. The expression of the discrete Fourier transform is:

[0023]

[0024] in, is the kth frequency component in the frequency domain, x(n) is the nth lightning electric field signal to be identified in the time domain, and j is an imaginary unit;

[0025] The frequency components in the frequency domain are transformed to obtain a spectrum signal of the lightning electric field signal to be identified. The spectrum signal is expressed as follows:

[0026]

[0027] Wherein, X(k) is the kth spectrum signal of the lightning electric field signal to be identified.

[0028] In one embodiment, the step of smoothing the spectrum signal of each lightning electric field signal using a Gaussian function to obtain a smoothed spectrum signal includes:

[0029] The frequency spectrum signal of each lightning electric field signal is smoothed using a Gaussian function according to a smoothing formula to obtain a smoothed frequency spectrum signal. The smoothing formula is:

[0030]

[0031]

[0032] in, is the smoothed spectrum signal, is a filter smoothed with a Gaussian function, is the Gaussian filter response function in the discrete frequency domain, τ is the discrete time delay parameter, is the scale parameter, represents the initial scale parameter, s=1,2,…N / 2。

[0033] In one embodiment, the smoothed spectrum signal is divided into two parts, and the optimal threshold T for dividing the smoothed spectrum signal is obtained by adopting the principle of maximizing the inter-class variance, including:

[0034] The smoothed spectrum signal is divided into two parts, H1 and H2. The optimal threshold T for dividing the smoothed spectrum signal is obtained by maximizing the inter-class variance. The expression of the optimal threshold T is:

[0035] T=argmax{σ 2}

[0036] σ 2 =W1W2(μ1-μ2) 2

[0037]

[0038] Among them, σ 2 is the between-class variance, W1 is the weight of H1, W2 is the weight of H2, μ1 is the mean of H1, μ2 is the mean of H2, H(k) is the r The elements in n r H r The number of elements in .

[0039] In one embodiment, the filter is constructed according to the interval boundary, and the empirical wavelet function ψ is determined. i (ω) and the empirical scaling function Obtain the mode components of the empirical wavelet structure, including:

[0040] Construct a filter based on the interval boundary and determine the empirical wavelet function ψ i (ω) and the empirical scaling function Empirical wavelet function ψ i (ω) and the empirical scaling function The expression is:

[0041]

[0042]

[0043] Among them, ωi is the interval boundary, τ i =γω i , γ is the relevant parameter of the compact support region, β(x) is the auxiliary function, and x is the variable;

[0044] According to the empirical wavelet function and the empirical scale function, detail coefficients and approximation coefficients are determined, wherein the detail coefficients and the approximation coefficient The expression is:

[0045]

[0046]

[0047] in, is i The complex conjugate of (ω), for The complex conjugate of -1 [·] represents the inverse Fourier transform, x(ω) is the frequency domain signal, x(τ) is the time domain signal, is the high-pass filter part of the wavelet basis function, i represents the index of scale or frequency, is the conjugate of the wavelet basis function, τ is the integral variable, and t is the time;

[0048] According to the detail coefficient and the approximation coefficient, a mode component of an empirical wavelet substructure is obtained, wherein the mode component x of the empirical wavelet substructure is k The expression of (t) is:

[0049]

[0050] Among them, x0(t) is the approximation component of the signal.

[0051] In one embodiment, the steepness index K r The expression is:

[0052]

[0053] in, is the mean value of the mode component and σ represents the standard deviation.

[0054] In one embodiment, the step of using the training set to train a classification model based on an improved K-nearest neighbor algorithm to obtain a trained classification model includes:

[0055] The features and labels involved in the training are divided into Pn according to categories 1 , Pn 2 , Pn 3 …Pn Band Tn 1 、Tn 2 、Tn 3 ...Tn B , Pn i and Tn i Represent the features and labels b of the b-th class samples, b∈{1, 2, 3, ...B}, traverse the samples of each class in the training set, and select the cluster center Ce of each class b , get the set of cluster centers Ce = {Ce1, Ce2, Ce3…Ce B}, the cluster center Ce n The expression is:

[0056]

[0057] Among them, B is the number of categories, is the i-th sample of the b-th class, is the jth sample of the bth class, k b is the number of samples of category b in the training set;

[0058] According to the cluster center Ce of each class b , determine the average intra-class distance of each class of samples in the training set Get the average distance set within the class based on the improved K nearest neighbor algorithm Obtain the trained classification model, the average distance within the class The expression is:

[0059]

[0060] Among them, m is the number of features of the b-th class sample, is the value of feature u of the i-th sample of the b-th class, Ce bu is the value of the characteristic u of the cluster center of the bth class.

[0061] In one embodiment, the method of testing the trained classification model using the test set according to the neighbor number threshold K to obtain the test result includes:

[0062] The test set Ps={Ps1, Ps2, Ps3, ..., Ps G} Input the trained classification model to calculate each test sample Ps in the test set g The distance from the center of all clusters The expression is:

[0063]

[0064] Among them, Ps guis the value of feature u of test sample g, is the distance between the g-th test sample and the b-th cluster center;

[0065] According to the distance between each test sample and all category cluster centers And the average distance set within the class compare the values ​​in ; if only one value satisfies Then directly set the g-th test sample category of the test set Classified as b' If there are two or more values ​​that satisfy According to Find b′, ​​and then classify the g-th test sample category of the test set into b′ category, and let If there does not exist a value of b′ that satisfies Calculate the average distance between the g-th test sample and each class Then take the samples of the B / 2 classes with the closest distance in the training set to form a set S = {Pn1, Pn2, Pn3, ...Pn V}, and then through the formula Calculate the similarity between the g-th test sample and all samples in the set S, sort the calculated similarities from large to small, retain the first K samples, and take the true labels corresponding to the first K samples to form the label set SY, count the frequency of each category label in the label set SY, and take the category with the largest frequency as b′ as the predicted category of the g-th test sample Until all test samples in the test set are traversed, the predicted labels of all test samples are obtained.

[0066] In one embodiment, the method of judging whether the preset accuracy requirement is met according to the test result includes:

[0067] Based on the predicted labels of all test samples The type labels of all test samples in the test set are used to determine the accuracy A, precision P, recall R and comprehensive evaluation index F1 of the trained classification model;

[0068] If the accuracy A, precision P, recall R and comprehensive evaluation index F1 of the trained classification model exceed the preset threshold, the preset accuracy requirement is met.

[0069] The above-mentioned type identification method of lightning weak electric field signals obtains a lightning electric field signal sequence to be identified and performs discrete Fourier transform to obtain a spectrum signal of the lightning electric field signal, smoothes the spectrum signal of the lightning electric field signal using a Gaussian function to obtain a smoothed spectrum signal, divides the smoothed spectrum signal into two parts, obtains the optimal threshold T for dividing the smoothed spectrum signal using the principle of maximizing the inter-class variance, obtains the minimum value of the smoothed spectrum signal with respect to the variable k, and calculates the spatial curve C corresponding to different minimum values i Length L i , and the length L i Compared with the optimal threshold T, the length L i The coordinates corresponding to the minimum value greater than the optimal threshold T are used as the interval boundary, the filter is constructed according to the interval boundary, and the empirical wavelet function ψ is determined i (ω) and the empirical scaling function The mode components of the empirical wavelet structure are obtained, and the mode components are merged based on the steepness index to obtain a merged mode component A. The frequency mean, center of gravity frequency, frequency root mean square, and frequency standard deviation of the merged mode component A are analyzed as signal features, and the signal features are input into a trained classification model for type recognition to determine the signal type to which the lightning electric field signal sequence belongs. As a result, especially for lightning weak electric field signals, local features of different types of weak lightning electric field signals can be fully extracted, thereby improving the accuracy of type recognition of weak lightning electric field signals. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 It is a flowchart of a method for identifying the type of a lightning weak electric field signal in one embodiment;

[0071] Figure 2 A schematic diagram of classification of a situation of the g-th test sample in a test set in an embodiment;

[0072] Figure 3 FIG. 4 is a schematic diagram of another classification of the g-th test sample in a test set in an embodiment. DETAILED DESCRIPTION

[0073] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0074] In one embodiment, Figure 1 As shown, a method for identifying the type of weak electric field signal of lightning is provided, and the method is applied to a terminal as an example for explanation, including the following steps:

[0075] Step S220, obtaining a lightning electric field signal sequence to be identified and performing discrete Fourier transform to obtain a frequency spectrum signal of the lightning electric field signal.

[0076] The lightning electric field signal sequence to be identified may be a discrete sequence of lightning electric field signals measured by a fast antenna device at a single station over a period of time.

[0077] In one embodiment, obtaining a lightning electric field signal sequence to be identified and performing discrete Fourier transform to obtain a spectrum signal of the lightning electric field signal includes:

[0078] Obtain a lightning electric field signal sequence to be identified, record the lightning electric field signal sequence to be identified as x(n), where n∈[0, N-1], N is the length of the lightning electric field signal sequence to be identified, perform discrete Fourier transform on the lightning electric field signal sequence to be identified, and obtain the frequency components of the lightning electric field signal sequence to be identified in the frequency domain. The expression of discrete Fourier transform is:

[0079]

[0080] in, is the kth frequency component in the frequency domain, x(n) is the nth lightning electric field signal to be identified in the time domain, and j is an imaginary unit;

[0081] The frequency components in the frequency domain are transformed to obtain the spectrum signal of the lightning electric field signal to be identified. The expression of the spectrum signal is:

[0082]

[0083] Wherein, X(k) is the kth spectrum signal of the lightning electric field signal to be identified.

[0084] Step S240: Use a Gaussian function to smooth the frequency spectrum signal of the lightning electric field signal to obtain a smoothed frequency spectrum signal.

[0085] In one embodiment, a Gaussian function is used to smooth the spectrum signal of each lightning electric field signal to obtain a smoothed spectrum signal, including:

[0086] According to the smoothing formula, the frequency spectrum signal of each lightning electric field signal is smoothed using a Gaussian function to obtain a smoothed frequency spectrum signal. The smoothing formula is:

[0087]

[0088]

[0089] in, is the smoothed spectrum signal, is a filter smoothed with a Gaussian function, is the Gaussian filter response function in the discrete frequency domain, τ is the discrete time delay parameter, is the scale parameter, represents the initial scale parameter, s=1,2,…N / 2。

[0090] Step S260: divide the smoothed spectrum signal into two parts, and obtain the optimal threshold T for dividing the smoothed spectrum signal by adopting the principle of maximizing the inter-class variance.

[0091] In one embodiment, the smoothed spectrum signal is divided into two parts, and the optimal threshold T for dividing the smoothed spectrum signal is obtained by adopting the principle of maximizing the inter-class variance, including:

[0092] The smoothed spectrum signal is divided into two parts, H1 and H2. The optimal threshold T for dividing the smoothed spectrum signal is obtained by maximizing the inter-class variance principle. The expression of the optimal threshold T is:

[0093] T=argmax{σ 2}

[0094] σ 2 =W1W2(μ1-μ2) 2

[0095]

[0096] Among them, σ 2 is the between-class variance, W1 is the weight of H1, W2 is the weight of H2, μ1 is the mean of H1, μ2 is the mean of H2, H(k) is the r The elements in n r H r The number of elements in .

[0097] Step S280, obtaining the minimum value of the smoothed spectrum signal with respect to the variable k, and calculating the space curves C corresponding to different minimum values i Length L i , and the length L i Compare with the optimal threshold T and set the length L i The coordinates corresponding to the minimum value greater than the optimal threshold T are taken as the interval boundaries.

[0098] Step S300, constructing a filter according to the interval boundary and determining the empirical wavelet function ψ i (ω) and the empirical scaling function Obtain the mode components of the empirical wavelet structure.

[0099] In one embodiment, a filter is constructed based on the interval boundary and an empirical wavelet function ψ is determined. i (ω) and the empirical scaling function Obtain the mode components of the empirical wavelet structure, including:

[0100] Construct the filter according to the interval boundary and determine the empirical wavelet function ψ i (ω) and the empirical scaling function Empirical wavelet function ψ i (ω) and the empirical scaling function The expression is:

[0101]

[0102]

[0103] Among them, ω i is the interval boundary, τ i =γω i , γ is the relevant parameter of the compact support region, β(x) is the auxiliary function, and x is the variable;

[0104] According to the empirical wavelet function and the empirical scale function, the detail coefficient and the approximation coefficient are determined, where the detail coefficient and approximation coefficient The expression is:

[0105]

[0106]

[0107] in, is i The complex conjugate of (ω), for The complex conjugate of -1 [·] represents the inverse Fourier transform, x(ω) is the frequency domain signal, x(τ) is the time domain signal, is the high-pass filter part of the wavelet basis function, i represents the index of scale or frequency, is the conjugate of the wavelet basis function, τ is the integral variable, and t is the time;

[0108] According to the detail coefficient and the approximation coefficient, the mode component of the empirical wavelet substructure is obtained, where the mode component x k The expression of (t) is:

[0109]

[0110] Among them, x0(t) is the approximation component of the signal.

[0111] Step S320, combining the mode components based on the steepness index to obtain a combined mode component A, and analyzing the frequency mean, center of gravity frequency, frequency root mean square, and frequency standard deviation of the combined mode component A as signal features.

[0112] In one embodiment, the steepness index K r The expression is:

[0113]

[0114] in, is the mean value of the mode component and σ represents the standard deviation.

[0115] It should be understood that after the mode decomposition based on the empirical wavelet function is completed, the mode components are merged based on the steepness index. First, the mode components x of the empirical wavelet structure are merged. k (t) are defined as u={u1,…,u k Then merge the mode components according to the merging rule. The merging rule is: for the first mode, let A1 = u1. Starting from the second mode, first determine whether the steepness value of u' obtained by merging u2 and the adjacent mode u3 is greater than the steepness value of u2. If it is satisfied, let A2 = u', otherwise A2 = u2. According to the above rules, loop through all mode components to obtain all new mode components A i , and merge them to obtain the merged component A.

[0116] According to the merged mode component A, the frequency characteristics of the mode component, such as the frequency mean, center of gravity frequency, frequency root mean square, and frequency standard deviation, are calculated and used as characteristic components (ie, signal characteristics).

[0117] It should be understood that the different types of lightning electric field signals collected have obvious impact characteristics, and such waveform signals containing Gaussian noise, harmonic noise and impact characteristics can be better decomposed by wavelet technology, so as to further extract features. However, it is difficult to determine the appropriate number of decomposition modes with traditional wavelet decomposition technology, and it is easy to encounter the problem of frequency band integrity destruction, making it difficult to achieve the best feature extraction effect. In order to better extract the characteristics of weak lightning electric field signals, the lightning electric field signal to be identified can be first decomposed by the parameter-free scale space method, and its mode components can be obtained at the same time. Subsequently, the improved wavelet transform is used to screen the mode components obtained by decomposition using the steepness index, and then merged, and finally the local characteristics of the lightning electric field signal to be identified are extracted as signal features.

[0118] It should be understood that the smoothing of the Fourier spectrum by Gaussian function and then decomposition of the spectrum pattern by unempirical wavelet transform greatly reduces the influence of noise on pattern decomposition. The pattern merging based on the optimization of steepness index avoids the inaccurate and insufficient pattern extraction caused by inaccurate wavelet threshold setting, so that the local characteristics of different types of weak lightning electric field signals can be fully extracted.

[0119] Step S340: input the signal features into the trained classification model for type recognition to determine the signal type to which the lightning electric field signal sequence belongs.

[0120] In one embodiment, the classification model is trained as follows:

[0121] The invention discloses a method for obtaining lightning electric field signal samples of different types and corresponding type labels to obtain a lightning electric field signal sample set; extracting features of lightning electric field signal samples in the lightning electric field signal sample set to obtain a signal feature sample set; normalizing the signal feature samples in the signal feature sample set to obtain a normalized signal feature sample set; dividing the normalized signal feature sample set into a training set and a test set according to a preset division ratio; setting a nearest neighbor number threshold K, using the training set to train a classification model based on an improved K nearest neighbor algorithm, and obtaining a trained classification model; testing the trained classification model using the test set according to the nearest neighbor number threshold K to obtain a test result, and judging whether the preset accuracy requirement is met according to the test result; if the preset accuracy requirement is met, obtaining a trained classification model; and if the preset accuracy requirement is not met, returning to the step of setting the nearest neighbor number threshold K, using the training set to train a classification model based on an improved K nearest neighbor algorithm, and obtaining a trained classification model, until the test result meets the preset accuracy requirement and a trained classification model is obtained.

[0122] Among them, the method of extracting features from the lightning electric field signal samples in the lightning electric field signal sample set is the same as the method of processing the lightning electric field signal sequence to be identified to obtain signal features, which will not be repeated here.

[0123] In one embodiment, the normalization expression is:

[0124]

[0125] Among them, F′ is the normalized feature data of each signal feature sample, max(F) represents the maximum value of each feature, and min(F) represents the minimum value of each feature. Since the K-nearest neighbor algorithm needs to measure the similarity of samples by Euclidean distance, if there is a large gap in the order of magnitude of different features, there will be a situation where individual features determine the similarity, affecting the classification effect. Therefore, normalization is used to eliminate the impact of the difference in the numerical values ​​of different features.

[0126] After completing the normalization of the feature data, we obtained the feature data F′ of different categories and the type labels corresponding to different types of lightning electric field signals. In order to obtain better training and prediction results and enhance the robustness of the model, the training set and the test set are first shuffled in the same way. Then, the data set is divided into 80% for the training set and 20% for the test set, and different letters are used to represent them, as shown in Table 1:

[0127] Table 1 Data division

[0128]

[0129] After completing the division of the data set, it is necessary to determine the appropriate threshold K of the number of nearest neighbors. This is because if the threshold K is too small, the prediction results will be more random. When the threshold K is too large, a lot of computing time will be consumed. Therefore, this algorithm uses an empirical formula and can set the threshold K to 2 times the number of classification categories.

[0130] In one embodiment, a training set is used to train a classification model based on an improved K-nearest neighbor algorithm to obtain a trained classification model, including:

[0131] The features and labels involved in the training are divided into Pn according to categories 1 , Pn 2 , Pn 3 ...Pn B and Tn 1 、Tn 2 、Tn 3 ...Tn B , Pn i and Tn i Represent the features and labels of the b-th class samples, b∈{1, 2, 3, ...B}, traverse the samples of each class in the training set, and select the cluster center Ce of each class b , get the set of cluster centers Ce = {Ce1, Ce2, Ce3…Ce B}, cluster center Ce n The expression is:

[0132]

[0133] Among them, B is the number of categories, is the i-th sample of the b-th class, is the jth sample of the bth class, k b is the number of samples of category b in the training set;

[0134] According to the cluster center Ce of each class b , determine the average intra-class distance of each class of samples in the training set Get the average distance set within the class based on the improved K nearest neighbor algorithm Get the trained classification model, average distance within the class The expression is:

[0135]

[0136] Among them, m is the number of features of the b-th class sample, is the value of feature u of the i-th sample of the b-th class, Ce bu is the value of the characteristic u of the cluster center of the bth class.

[0137] It should be understood that after obtaining the average intra-class distance of each class of samples in the training set, the training set and training are completed. Classification can be achieved.

[0138] In one embodiment, according to the neighbor number threshold K, the trained classification model is tested using a test set to obtain test results, including:

[0139] The test set Ps = {Ps1, Ps2, Ps3, ..., Ps G} Input the trained classification model to calculate Ps for each test sample in the test set g The distance from the center of all clusters The expression is:

[0140]

[0141] Among them, Ps gu is the value of feature u of test sample g, is the distance between the g-th test sample and the b-th cluster center;

[0142] According to the distance between each test sample and all category cluster centers And the average distance set within the class compare the values ​​in ; if only one value satisfies Then directly set the g-th test sample category of the test set Classified as b' If there are two or more values ​​that satisfy According to Find b′, ​​and then classify the g-th test sample category of the test set into b′ category, and let This process is as Figure 2 As shown; if there is no b value that satisfies Calculate the average distance between the g-th test sample and each class Then take the samples of the B / 2 classes with the closest distance in the training set to form a set S = {Pn1, Pn2, Pn3, ...Pn V}, and then through the formula Calculate the similarity between the g-th test sample and all samples in the set S, sort the calculated similarities from large to small, retain the first K samples, and take the true labels corresponding to the first K samples to form the label set SY, count the frequency of each category label in the label set SY, and take the category with the largest frequency as b′ as the predicted category of the g-th test sample This process is as Figure 3 As shown; until all test samples in the test set are traversed, the predicted labels of all test samples are obtained

[0143] In one embodiment, the method of determining whether the preset accuracy requirement is met according to the test result includes:

[0144] Based on the predicted labels of all test samples The accuracy A, precision P, recall R and comprehensive evaluation index F1 of the trained classification model are determined based on the type labels of all test samples in the test set; if the accuracy A, precision P, recall R and comprehensive evaluation index F1 of the trained classification model exceed the preset threshold, the preset accuracy requirement is met.

[0145] Among them, the expression of accuracy A(accuracy) is:

[0146]

[0147] Among them, the expression of precision P (precision) is:

[0148]

[0149] Among them, the expression of recall rate R (Recall) is:

[0150]

[0151] Among them, the expression of the comprehensive evaluation index F1 (F1-score) is:

[0152]

[0153] Among them, TP represents the number of samples predicted as positive when the test samples are actually positive; TN represents the number of samples predicted as negative when the test samples are actually negative; FP represents the number of samples predicted as positive when the test samples are actually negative; FN represents the number of samples predicted as negative when the test samples are actually positive.

[0154] It should be understood that by mixing the average distance within the training set class with the neighborhood pattern, the robustness and stability of the model classification model are greatly improved, and the misclassification caused by the unreasonable setting of the number of neighbors is avoided; at the same time, the high cost of calculation generated during the sample testing process is avoided, which greatly improves the classification speed of different types of lightning weak signals while improving the classification accuracy.

[0155] It should be understood that the lightning electric field signal sequence to be identified may be a lightning electric field signal of the type NBE (bipolar narrow pulse), ground lightning return stroke waveform, initial breakdown waveform, regular pulse cluster or irregular pulse cluster. After extracting the features of the lightning electric field signal sequence to be identified, the signal features are input into the trained classification model for type identification to determine the signal type to which the lightning electric field signal sequence belongs. The trained classification model can classify lightning electric field signals such as NBE (bipolar narrow pulse), ground lightning return stroke waveform, initial breakdown waveform, regular pulse cluster and irregular pulse cluster.

[0156] The above-mentioned type recognition method of lightning weak electric field signal obtains the lightning electric field signal sequence to be identified and performs discrete Fourier transform to obtain the spectrum signal of the lightning electric field signal, uses Gaussian function to smooth the spectrum signal of the lightning electric field signal to obtain the smoothed spectrum signal, divides the smoothed spectrum signal into two parts, uses the principle of maximizing the inter-class variance to obtain the optimal threshold T for dividing the smoothed spectrum signal, obtains the minimum value of the smoothed spectrum signal with respect to the variable k, and calculates the spatial curve C corresponding to different minimum values i Length L i , and the length L i Compare with the optimal threshold T and set the length L i The coordinates corresponding to the minimum value greater than the optimal threshold T are used as the interval boundary, the filter is constructed according to the interval boundary, and the empirical wavelet function ψ is determined i (ω) and the empirical scaling function The mode components of the empirical wavelet structure are obtained, and the mode components are merged based on the steepness index to obtain the merged mode component A. The frequency mean, centroid frequency, frequency root mean square, and frequency standard deviation of the merged mode component A are analyzed as signal features. The signal features are input into the trained classification model for type recognition to determine the signal type to which the lightning electric field signal sequence belongs. As a result, the local features of different types of weak lightning electric field signals can be fully extracted, thereby improving the accuracy of type recognition of weak lightning weak electric field signals.

[0157] It should be understood that although Figure 1The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0158] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0159] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for identifying the type of lightning weak electric field signal, characterized in that: The method comprises: Obtaining a lightning electric field signal sequence to be identified and performing discrete Fourier transform to obtain a spectrum signal of the lightning electric field signal; Using a Gaussian function to smooth the frequency spectrum signal of the lightning electric field signal to obtain a smoothed frequency spectrum signal; The smoothed spectrum signal is divided into two parts, and the optimal threshold T for dividing the smoothed spectrum signal is obtained by adopting the principle of maximizing the inter-class variance; Get the minimum value of the smoothed spectrum signal with respect to the variable k, and calculate the spatial curve C corresponding to different minimum values i Length L i , and the length L i Compared with the optimal threshold T, the length L i The coordinates corresponding to the minimum value greater than the optimal threshold T are taken as the interval boundary; Construct a filter based on the interval boundary and determine the empirical wavelet function ψ i (ω) and the empirical scaling function Obtain the mode components of the empirical wavelet structure; The mode components are merged based on the steepness index to obtain the merged mode component A, and the frequency mean, center of gravity frequency, frequency root mean square, and frequency standard deviation of the merged mode component A are analyzed as signal features; Inputting the signal features into a trained classification model for type recognition to determine the signal type to which the lightning electric field signal sequence belongs; The training method of the classification model is: Obtain different types of lightning electric field signal samples and corresponding type labels to obtain a lightning electric field signal sample set; Extracting features from the lightning electric field signal samples in the lightning electric field signal sample set to obtain a signal feature sample set; Normalizing the signal feature samples in the signal feature sample set to obtain a normalized signal feature sample set; Dividing the normalized signal feature sample set into a training set and a test set according to a preset division ratio; Setting a nearest neighbor number threshold K, using the training set to train a classification model based on an improved K nearest neighbor algorithm, and obtaining a trained classification model; According to the nearest neighbor number threshold K, the trained classification model is tested using the test set to obtain a test result, and whether the preset accuracy requirement is met is determined according to the test result. If the preset accuracy requirement is met, a trained classification model is obtained; if the preset accuracy requirement is not met, the set nearest neighbor number threshold K is returned, and the classification model based on the improved K nearest neighbor algorithm is trained using the training set to obtain a trained classification model, until the test result meets the preset accuracy requirement and a trained classification model is obtained; The training set is used to train the classification model based on the improved K nearest neighbor algorithm to obtain the trained classification model, including: The features and labels involved in the training are divided into Pn according to categories 1 , Pn 2 , Pn 3 …Pn B and Tn 1 、Tn 2 、Tn 3 …Tn B , Pn b and Tn b Represent the features and labels b of the b-th class samples, b∈{1, 2, 3, ...B}, traverse the samples of each class in the training set, and select the cluster center Ce of each class b , get the set of cluster centers Ce={Ce1,Ce2,Ce3…Ce B }, the cluster center Ce b The expression is: Among them, B is the number of categories, is the i-th sample of the b-th class, is the jth sample of the bth class, k b is the number of samples of category b in the training set; According to the cluster center Ce of each class b , determine the average intra-class distance of each class of samples in the training set Get the average distance set within the class based on the improved K nearest neighbor algorithm Obtain the trained classification model, the average distance within the class The expression is: Among them, m is the number of features of the b-th class sample, is the value of feature u of the i-th sample of the b-th class, Ce bu is the value of feature u of the cluster center of the bth class; The step of testing the trained classification model using the test set according to the neighbor number threshold K to obtain a test result includes: The test set Ps={Ps1, Ps2, Ps3,…, Ps G } Input the trained classification model to calculate each test sample Ps in the test set g The distance from the cluster center of all categories The expression is: Among them, Ps gu is the value of feature u of test sample g, is the distance between the g-th test sample and the b-th cluster center; According to the distance between each test sample and all category cluster centers And the average distance set within the class compare the values ​​in ; if only one value satisfies b′∈{1, 2, 3, …B}, then directly assign the g-th test sample category of the test set Classified as b' If there are two or more values ​​that satisfy According to Find b′, ​​and then classify the g-th test sample category of the test set into b′ category, and let If there does not exist a value of b′ that satisfies Calculate the average distance between the g-th test sample and each class Then take the samples of the B / 2 classes with the closest distance in the training set to form a set S = {Pn1, Pn2, Pn3, ... Pn V }, and then through the formula Calculate the similarity between the g-th test sample and all samples in the set S, sort the calculated similarities from large to small, retain the first K samples, and take the true labels corresponding to the first K samples to form the label set SY, count the frequency of each category label in the label set SY, and take the category with the largest frequency as b′ as the predicted category of the g-th test sample Until all test samples in the test set are traversed, the predicted labels of all test samples are obtained.

2. The method according to claim 1, characterized in that The step of obtaining a sequence of lightning electric field signals to be identified and performing discrete Fourier transform to obtain a spectrum signal of the lightning electric field signal comprises: A lightning electric field signal sequence to be identified is obtained, and the lightning electric field signal sequence to be identified is recorded as x(n), where n∈[0, N-1], and N is the length of the lightning electric field signal sequence to be identified. A discrete Fourier transform is performed on the lightning electric field signal sequence to be identified to obtain the frequency components of the lightning electric field signal sequence to be identified in the frequency domain. The expression of the discrete Fourier transform is: in, is the kth frequency component in the frequency domain, x(n) is the nth lightning electric field signal to be identified in the time domain, and j is an imaginary unit; The frequency components in the frequency domain are transformed to obtain a spectrum signal of the lightning electric field signal to be identified. The spectrum signal is expressed as follows: Wherein, X(k) is the kth spectrum signal of the lightning electric field signal to be identified.

3. The method according to claim 2, characterized in that The step of smoothing the frequency spectrum signals of the lightning electric field signals by using a Gaussian function to obtain smoothed frequency spectrum signals comprises: The frequency spectrum signal of each lightning electric field signal is smoothed using a Gaussian function according to a smoothing formula to obtain a smoothed frequency spectrum signal. The smoothing formula is: in, is the smoothed spectrum signal, is a filter smoothed with a Gaussian function, is the Gaussian filter response function in the discrete frequency domain, τ is the discrete time delay parameter, is the scale parameter, represents the initial scale parameter, s=1,2,…N / 2.

4. The method according to claim 3, characterized in that The method of dividing the smoothed spectrum signal into two parts and obtaining the optimal threshold T for dividing the smoothed spectrum signal by adopting the principle of maximizing the inter-class variance includes: The smoothed spectrum signal is divided into two parts, H1 and H2. The optimal threshold T for dividing the smoothed spectrum signal is obtained by maximizing the inter-class variance. The expression of the optimal threshold T is: T=argmax{σ 2 } s 2 =W1W2(μ1-μ2) 2 r=1、2 Among them, σ 2 is the between-class variance, W1 is the weight of H1, W2 is the weight of H2, μ1 is the mean of H1, μ2 is the mean of H2, H(k) is the r The elements in n r H r The number of elements in .

5. The method according to claim 4, characterized in that The filter is constructed according to the interval boundary, and the empirical wavelet function ψ is determined. i (ω) and the empirical scaling function Obtain the mode components of the empirical wavelet structure, including: Construct a filter based on the interval boundary and determine the empirical wavelet function ψ i (ω) and the empirical scaling function Empirical wavelet function ψ i (ω) and the empirical scaling function The expression is: Among them, ω i is the interval boundary, τ i =γω i , γ is the relevant parameter of the compact support region, β(x) is the auxiliary function, and x is the variable; According to the empirical wavelet function and the empirical scale function, detail coefficients and approximation coefficients are determined, wherein the detail coefficients and the approximation coefficient The expression is: in, is i The complex conjugate of (ω), for The complex conjugate of -1 [·] represents the inverse Fourier transform, x(ω) is the frequency domain signal, x(τ) is the time domain signal, is the high-pass filter part of the wavelet basis function, i represents the index of scale or frequency, is the conjugate of the wavelet basis function, τ is the integral variable, and t is the time; According to the detail coefficient and the approximation coefficient, a mode component of an empirical wavelet substructure is obtained, wherein the mode component x of the empirical wavelet substructure is k The expression of (t) is: Among them, x0(t) is the approximation component of the signal.

6. The method according to claim 5, characterized in that The steepness index K r The expression is: in, is the mean value of the mode component and σ represents the standard deviation.

7. The method according to claim 1, characterized in that The method of judging whether the preset accuracy requirement is met according to the test result includes: Based on the predicted labels of all test samples The type labels of all test samples in the test set are used to determine the accuracy A, precision P, recall R and comprehensive evaluation index F1 of the trained classification model; If the accuracy A, precision P, recall R and comprehensive evaluation index F1 of the trained classification model exceed the preset threshold, the preset accuracy requirement is met.

Citation Information

Patent Citations

  • Reciprocating compressor bearing clearance fault diagnosis method

    CN111738155A

  • Epilepsy signal classification method based on EWT and improved CSP

    CN111931576A

  • Urban medium-voltage distribution cable partial discharge signal denoising method

    CN114492538A

  • Cloud-to-ground lightning identification method based on lightning electric field signal

    CN117195097A