A LoRa signal denoising method based on deep learning
Through the deep learning-based recurrent neural network model, feature extraction and learning of LoRa signal noise is solved, the problem of insufficient transmission performance of LoRa network in a low signal-to-noise ratio environment is achieved, the effect of reducing bit error rate and noise power is achieved, and the reliability of the network is improved.
Patent Information
- Application Number
- CN202410516815.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-04-26
AI Technical Summary
The transmission performance of the LoRa network in low signal-to-noise ratio and high occlusion environments is insufficient, resulting in high bit error rate and high noise power of the received signal, affecting the reliability of the network.
Using a recurrent neural network model based on deep learning, the LoRa signal noise model is constructed by collecting and preprocessing noise data, and the model is used to extract and learn noise characteristics, reducing noise energy and improving signal cleanliness.
It effectively reduces the bit error rate and noise power of the LoRa signal, improves the sensitivity of the receiver and network reliability, and enhances transmission performance.
Smart Images

Figure CN118449621B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of communication technology, and in particular to a method for denoising a LoRa signal, a low-power wide area network technology, based on deep learning in the field of wireless communication. Technical Background
[0002] Industrial wide-area IoT communication is the premise and foundation of industrial intelligence. The huge network system plus the large-scale deployment of sensors have resulted in the current situation of messy cables for on-site management. The deployment of wired transmission has high costs, difficult maintenance, and poor scalability, which need to be solved urgently. Lora (a low-power wide area network wireless communication technology) is a low-power wide area network technology designed for long-distance, low-power, and large-scale connected IoT devices, and can replace a large part of the wired transmission system. Lora technology provides a low-cost, low-energy, and high-coverage reliable connection network solution. , It can replace a large part of industrial wired connections. However, the transmission performance of Lora signals in low signal-to-noise ratio and high-occlusion environments is not good, and there are many bit errors. Industrial communications have high requirements for data security and reliability, so Lora weak signal decoding in low signal-to-noise ratio environments has become an important optimization direction. Summary of the invention
[0003] The technical problem to be solved by the present invention is: how to solve the problem of insufficient transmission performance of the LoRa network actually used in industrial environments due to low signal-to-noise ratio and high occlusion, reduce the bit error rate of the LoRa signal and the noise power of the received signal, increase the sensitivity of the LoRa receiver and the reliability of the LoRa network.
[0004] The technical solution adopted by the present invention is: a LoRa signal denoising method based on deep learning, collecting noise data of the detected environment, constructing a data set, dividing the data set into a training set and a test set, using the colored noise related to the time series in the noise, building a recurrent neural network model based on deep learning, using the training set and the test set to train the recurrent neural network model, so that the recurrent neural network model learns the noise data of the detected environment, and the LoRa signal noise model of the detected environment is obtained by training, and the noise data of the detected environment to be processed is input into the LoRa signal noise model of the detected environment to obtain the denoised LoRa signal data corresponding to the noise data of the detected environment to be processed; the method specifically includes the following steps:
[0005] Step 1: Collect noise data of the detected environment. It is necessary to use noise ratio data of various signal-to-noise ratios in the detected environment to construct a data set.
[0006] Step 2: Preprocess the data set to construct training set and test set;
[0007] Step 3: Using the colored noise related to the time series in the noise, a recurrent neural network model based on deep learning is constructed. The recurrent neural network model includes an input layer, a hidden layer, and an output layer. The output dimension of the input layer is 256ⅹ1, the hidden layer is a fully connected layer with an activation function, the input dimension of the hidden layer is 35×256 and the output dimension is 256×5, the input dimension of the output layer is 256×5, and the hidden state h at each moment in the hidden layer is t It will be updated with time t. The hidden states before and after are related and contain timing information. The activation function of the hidden layer is the ReLu function. At time t, the input x of the tth time step is first t Load it in and calculate the hidden state h at time t t =ReLu(W _xh ×x+h t-1 ×W_hh), and then update the hidden state to get the output y at time t t =h t ×W_hq, output y t Contains the input x at this moment t and previous timing information, W _xh is the weight of input x, w_hh is the hidden state h at time t-1 t-1 The weight of W_hq is the hidden state h at time t. t weight; use c[n]-w_pred[n] for time domain processing, c[n] is the noisy LoRa signal received by the LoRa receiver, w_pred[n] is the learned noise model sequence, and the amplitude is subtracted to obtain a clean LoRa symbol signal after removing the noise, thereby reducing the noise energy; in the frequency domain, set the array p x
[256] , and threshold a x , in the spectrum for amplitudes greater than a x , the frequency component mark becomes an interference point that misleads decoding. If the final decoded symbol value is marked in the corresponding array, the terminal is required to retransmit; Step 4, use the training set and test set to train and test the recurrent neural network model, so that the recurrent neural network model learns the noise data of the detected environment, and trains to obtain the LoRa signal noise model of the detected environment; the parameters to be learned are the weight W_xh of the input x, the hidden state h at time t-1 t-1 The weight W_hh, the offset b_h of the hidden layer, and the hidden state h at time t tThe weight W_hq of the output layer, the offset b_q of the output layer, the size of the hidden layer is set to 5, the number of iterations Epochs is initially set to 200, the vector structure of W_xh is 1×5; the vector structure of W_hh is 5×5; b_h is a vector of length 5, initialized to all 0, the vector structure of W_hq is 5×1, b_q is a number, initialized to 0; the learning rate is set to 0.01, and the cross entropy loss is used to calculate the loss function. The gradient of the loss function with respect to the weight is calculated, the learning rate Ir is multiplied by this gradient, and then this gradient is subtracted from the weight to obtain the updated weight; use GPU to learn the recurrent neural network, input the training set and the test set into the recurrent neural network to learn in the time domain and frequency domain respectively, the loss function yi is the true value of the i-th cycle, y pre is the predicted value, n is the number of cycles; find the accuracy set by the loss function MSE and obtain the LoRa signal noise model of the detected environment. If the loss function MSE does not meet the accuracy set by the loss function MSE, adjust the number of training sets and test sets or adjust one or more of the hidden layer size, the number of iterations or the step size and continue the cyclic learning;
[0008] Step 5: Input the noise data of the detected environment to be processed into the LoRa signal noise model of the detected environment to obtain the denoised LoRa signal data corresponding to the noise data of the detected environment to be processed.
[0009] In step 2, during data set preprocessing, select data whose sampling rate is consistent with the LoRa signal in the data set. The linear spread spectrum modulation technology CSS uses undersampling technology, and each code element samples 256 points, and the batch size of the data is 256.
[0010] In step 4, the truncated time step is used to avoid the explosion of the back-propagation gradient, and a projection vector is set to limit the length when the gradient length is greater than the projection value.
[0011] In step 4, the gradients in all layers are placed in a vector L, L = min(1, θ / (||L||))L, so that the value of L is always limited to θ, effectively avoiding excessive gradients.
[0012] The beneficial effects of the present invention are as follows: the present invention utilizes the colored noise related to the time series in the noise to build a recurrent neural network model based on deep learning, and utilizes the recurrent neural network model to extract and learn the noise features, thereby reducing the threshold requirement of LoRa for the signal-to-noise ratio, filtering out a portion of the noise energy at the receiving end, and obtaining clean code elements. The received signal can be restored to code elements when it is submerged in noise. The present invention predicts in advance the situation that the frequency domain may generate or interfere with the decoding of the original code elements based on the decoding characteristics of the linear spread spectrum signal, and overcomes the problem that the LoRa signal can only ensure the reliability of transmission through the CRC frame check and ACK mechanism. The present invention maintains the security and reliability of transmission in the LoRa signal network. The present invention can be used in the demodulation and decoding process after receiving the LoRa signal in the LoRa network to filter the noise of the received signal and improve the transmission accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is a flow chart of the present invention;
[0014] Figure 2 It is a schematic diagram of the overall structure of the present invention;
[0015] Figure 3 This is a schematic diagram of noise fitting results;
[0016] Figure 4 Schematic diagram comparing the method of the present invention with the traditional decoding method; DETAILED DESCRIPTION
[0017] In this embodiment, the processor is Intel I5 13600KF, and the computer system is Windows 11. The deep learning framework is processed based on the Nvidia GeForce GTX4070 graphics processor platform, and the deep learning environment is built by programming in the Python language based on the conda environment jupyter. And the learned model is placed on the MATLAB R2018a software platform to build a modulation and demodulation simulation experiment of lora signal transmission.
[0018] To collect noise data of the detected environment, it is necessary to use noise ratio data of various signal-to-noise ratios in the detected environment to build a data set; collect a large number of noise data for learning, use a spectrum analyzer to collect noise data in real time, use MATLAB to generate diversified data sets under various signal-to-noise ratio environments, and randomly generate various amplitude-controllable Gaussian noises to obtain high-quality synthetic data sets covering all signal-to-noise ratio levels and various powers. One part of the data uses a spectrum analyzer to collect environmental noise, and the other part of the data uses MATLAB to randomly generate Gaussian noise under various signal-to-noise ratios. The two parts of noise can be robust to the data set, fully cover various possible situations, and optimize the learning model. Both parts of the data are converted in the time-frequency domain through Fourier transform and inverse transform.
[0019] After preprocessing the dataset, training and test sets are constructed.
[0020] During data preprocessing, select the data whose sampling rate is consistent with the LoRa signal in the data set. The linear spread spectrum modulation technology CSS uses undersampling technology, sampling 256 points for each symbol, and the batch size of the data is 256. The input is a one-dimensional feature vector of 1x256.
[0021] Each feature vector is normalized using the batch normalization method; all normalized feature vectors are randomly divided into training set and test set in a ratio of 7:3;
[0022] The colored noise related to the time series in the noise is used to build a recurrent neural network model based on deep learning. The recurrent neural network model of the present invention is an RNN recurrent neural network model built based on Sequential and Keras.Dense in the Keras library and the SImpleRNN model. The recurrent neural network model includes an input layer, a hidden layer and an output layer. The output dimension of the input layer is 256×1, the hidden layer is a fully connected layer with an activation function, the input dimension of the hidden layer is 35ⅹ256 and the output dimension is 256ⅹ5, the input dimension of the output layer is 256ⅹ5, and the hidden state h at each moment in the hidden layer is t It will be updated with time t. The hidden states before and after are related and contain timing information. The activation function of the hidden layer is the ReLu function. At time t, the input x of the tth time step is first t Load it in and calculate the hidden state h at time t t =ReLu(W _xh ×x+h t-1 ×W_hh) updates the hidden state and obtains the output y at time t t =h t ×W_hq output y t Contains the input x at this moment t and previous timing information, W_xh is the weight of the input x, W_hh is the hidden state h at time t-1 t-1 weight; use c[n]-w_pred[n] for time domain processing, c[n] is the noisy LoRa signal received by the LoRa receiver, w_pred[n] is the learned noise model sequence, and the amplitude is subtracted to obtain a clean LoRa symbol signal after removing the noise, thereby reducing the noise energy; in the frequency domain, set the array p x
[256] , and threshold a x , in the spectrum for amplitudes greater than a x , the frequency component mark becomes an interference point that misleads decoding. If the final decoded symbol value is marked in the corresponding array, the terminal is required to retransmit. The present invention is a one-dimensional prediction of a single value, and does not use one-hot encoding to expand the dimension. The size of the hidden layer is set to 5, and the number of iterations Epochs is initially set to 200. The hidden layer activation function is set to the ReLu function. Parameter settings in Model.compile: Select optimizer Optimizer = "adam". Each input is 256 samples, and the input shape is 256×8×1.
[0023] The training set and test set are used to train and test the recurrent neural network model (learning in the time domain and frequency domain), so that the recurrent neural network model learns the noise data of the detected environment and trains to obtain the LoRa signal noise model of the detected environment; the parameters to be learned are the weight W_xh of the input x, the hidden state h at time t-1 t-1 The weight W_hh, the offset b_h of the hidden layer, and the hidden state h at time t t The weight W_hq of the output layer, the offset b_q of the output layer, the size of the hidden layer is set to 5, the number of iterations Epochs is initially set to 200, the vector structure of W_xh is 1×5; the vector structure of W_hh is 55; b_h is a vector of length 5, initialized to all 0, the vector structure of W_hq is 5×1, b_q is a number, initialized to 0; the learning rate is set to 0.01, and the cross entropy loss is used to calculate the loss function. The gradient of the loss function with respect to the weight is calculated, the learning rate Ir is multiplied by this gradient, and then this gradient is subtracted from the weight to obtain the updated weight; GPU is used to learn the recurrent neural network, and the training set and test set are input into the recurrent neural network to learn in the time domain and frequency domain respectively, and the loss function yi is the true value of the i-th cycle, y preis the predicted value, n is the number of cycles; find the accuracy set by the loss function MSE, and obtain the LoRa signal noise model of the detected environment. If the loss function MSE does not meet the accuracy set by the loss function MSE, adjust the number of training sets and test sets or adjust one or more of the hidden layer size or the number of iterations or the step size and continue the cycle learning. Input the noise data of the detected environment to be processed into the LoRa signal noise model of the detected environment to obtain the denoised LoRa signal data corresponding to the noise data of the detected environment to be processed.
[0024] The truncated time step is used to avoid the explosion of the back-propagation gradient, and a projection vector is set to limit the length when the gradient length is greater than the projection value.
[0025] The gradients in all layers are placed in a vector L, L = min(1, θ / (||L||))L, so that the value of L is always limited to θ, effectively avoiding excessive gradients.
[0026] The loss function MSE loss using the method of the present invention can be reduced to 2e-2 at the lowest, achieving a good fitting effect. yi is the actual input value (the true value of the i-th cycle), and y_pre is the predicted value (predicted value) of the deep learning network.
[0027] The minimum frequency f_min of the transmitted lora signal is 0, the signal bandwidth is 500KHz, the spreading factor SF is 7, the binary bit sequence is 01000000, and the decimal number is 64. The initial frequency f_o is 250KHz.
[0028] Recurrent neural networks effectively learn and identify noise, and have good fitting and prediction capabilities for noise patterns. This method is deployed on a gateway in a weak signal environment, which can reduce the noise component in the received signal by 30% to 40%, enhance transmission performance, and reduce the noise energy and transmission bit error rate at the receiving end.
Claims
1. A LoRa signal denoising method based on deep learning, characterized in that: The noise data of the detected environment is collected, a data set is constructed, and the data set is divided into a training set and a test set. The colored noise related to the time series in the noise is used to build a recurrent neural network model based on deep learning. The recurrent neural network model is trained using the training set and the test set, so that the recurrent neural network model learns the noise data of the detected environment, and the LoRa signal noise model of the detected environment is obtained by training. The noise data of the detected environment to be processed is input into the LoRa signal noise model of the detected environment to obtain the denoised LoRa signal data corresponding to the noise data of the detected environment to be processed; the method specifically includes the following steps: Step 1: Collect noise data of the detected environment. It is necessary to use noise ratio data of various signal-to-noise ratios in the detected environment to construct a data set. Step 2: Preprocess the data set to construct training set and test set; Step 3: Using the colored noise related to the time series in the noise, a recurrent neural network model based on deep learning is constructed. The recurrent neural network model includes an input layer, a hidden layer, and an output layer. The output dimension of the input layer is 256×1, the hidden layer is a fully connected layer with an activation function, the input dimension of the hidden layer is 35×256 and the output dimension is 256×5, the input dimension of the output layer is 256×5, and the hidden state h at each moment in the hidden layer is t It will be updated with time t. The hidden states before and after are related and contain timing information. The activation function of the hidden layer is the ReLu function. At time t, the input x of the tth time step is first t Load it in and calculate the hidden state h at time t t =ReLu(W _xh ×x+h t-1 ×W_hh), and then update the hidden state to get the output y at time t t =h t ×W_hq, output y t Contains the input x at this moment t and previous timing information, W _xh is the weight of the input x, W_hh is the hidden state ht at time t-1 t-1 The weight of W_hq is the hidden state h at time t. t weight; use c[n]-w_pred[n] for time domain processing, c[n] is the noisy LoRa signal received by the LoRa receiver, w_pred[n] is the learned noise model sequence, and the amplitude is subtracted to obtain a clean LoRa symbol signal after removing the noise, thereby reducing the noise energy; in the frequency domain, set the array p x [256], and threshold a x , in the spectrum for amplitudes greater than a x ,The frequency component mark becomes an interference point that misleads the decoding. If the final decoded symbol value is marked in the corresponding array, the terminal is required to retransmit; Step 4: Use the training set and test set to train and test the recurrent neural network model, so that the recurrent neural network model learns the noise data of the detected environment and obtains the LoRa signal noise model of the detected environment through training; the parameters to be learned are the weight W_xh of the input x, the hidden state h at time t-1 t-1 The weight W_hh, the offset b_h of the hidden layer, and the hidden state h at time t t The weight W_hq of the output layer, the offset b_q of the output layer, the size of the hidden layer is set to 5, the number of iterations Epochs is initially set to 200, the vector structure of W_xh is 1ⅹ5; the vector structure of W_hh is 5ⅹ5; b_h is a vector of length 5, initialized to all 0, the vector structure of W_hq is 5ⅹ1, b_q is a number, initialized to 0; the learning rate is set to 0.01, and the cross entropy loss is used to calculate the loss function. The gradient of the loss function with respect to the weight is calculated, the learning rate Ir is multiplied by this gradient, and then this gradient is subtracted from the weight to obtain the updated weight; GPU is used to learn the recurrent neural network, and the training set and test set are input into the recurrent neural network to learn in the time domain and frequency domain respectively, and the loss function yi is the true value of the i-th cycle, y pre is the predicted value, n is the number of cycles; find the accuracy set by the loss function MSE and obtain the LoRa signal noise model of the detected environment. If the loss function MSE does not meet the accuracy set by the loss function MSE, adjust the number of training sets and test sets or adjust one or more of the hidden layer size, the number of iterations or the step size and continue the cyclic learning; Step 5: Input the noise data of the detected environment to be processed into the LoRa signal noise model of the detected environment to obtain the denoised LoRa signal data corresponding to the noise data of the detected environment to be processed.
2. A LoRa signal denoising method based on deep learning according to claim 1, characterized in that: In step 2, during data set preprocessing, select data whose sampling rate is consistent with the LoRa signal in the data set. The linear spread spectrum modulation technology CSS uses undersampling technology, and each code element samples 256 points, and the batch size of the data is 256.
3. A LoRa signal denoising method based on deep learning according to claim 1, characterized in that: In step 4, the truncated time step is used to avoid the explosion of the back-propagation gradient, and a projection vector is set to limit the length when the gradient length is greater than the projection value.
4. A LoRa signal denoising method based on deep learning according to claim 1, characterized in that: In step 4, the gradients in all layers are placed in a vector L, L = min(1, θ / (||L||))L, so that the value of L is always limited to θ, effectively avoiding excessive gradients.
Citation Information
Patent Citations
Establishing method of regional CORS coordinate time series noise model
CN104392414A
LoRa modulation signal detection method based on deep learning
CN110099019A