# A Spectrum Sensing Method Based on Empirical Mode Decomposition and K-Means Clustering Algorithm

Authors: Yonghua Wang; Yongwei Zhang; Pin Wan; Shunchao Zhang; Jian Yang
Journal: Wireless Communications and Mobile Computing
 (2018)

---

## Abstract

To solve the problems of poor performance of traditional spectrum sensing method under low signal-to-noise ratio, a new spectrum sensing method based on Empirical Mode Decomposition algorithm and K-means clustering algorithm is proposed. Firstly, the Empirical Mode Decomposition algorithm and the wavelet threshold algorithm are used to remove the noise components in the spectrum sensing signal, and K-means clustering algorithm is used to determine whether the primary user exists. The method can remove the redundant components such as noise in the nonstationary or nonlinear sampling signal in the real environment and does not need to know the prior information such as signal, channel, and noise, so it can well handle the complicated sensing signal in real environment. This method can reduce the impact of noise on the spectrum sensing system and thus can improve the sensing performance of the system. In the experimental part, the difference between maximum and minimum eigenvalues and the difference between the maximum eigenvalue and the average energy in the random matrix are selected as signal features. Experiments also show that the proposed method is better than the traditional spectrum sensing methods.


---

## Body

## 1. Introduction

Spectrum sensing technology is the key technology of cognitive radio. The main purpose is to detect spectrum holes and improve spectrum utilization. Conventional spectrum sensing methods include energy detection, matched filter, and the cyclostationary feature detection [1–4]. The perceived signals received in the actual environment include noise, which can affect the sensing performance of traditional spectrum sensing methods [5, 6].Spectrum sensing based on random matrix is a cooperative spectrum sensing method. This method does not require prior knowledge of sampling signals and can reduce the interference of various fading factors in the environment. Therefore, the method of random matrix theory is gradually applied to spectrum sensing. Literature [7] has extracted a perception method based on the Difference between maximum and minimum eigenvalue (DMM). This method uses DMM as the test statistic and then makes a decision by calculating the threshold. However, the algorithm is susceptible to low signal-to-noise ratio (SNR) and few collaborative users, which will greatly affect the system performance. The literature [8] proposed the Maximum to Minimum Eigenvalue (MME) spectrum sensing method. The method uses the MME eigenvalue as the test statistic to reduce the influence of noise uncertainty, but only when the number of samples is high does it have good sensing performance. Literature [9] proposed a spectrum sensing method based on the Difference between Maximum Eigenvalue and the Average Energy (DMEAE). This method uses DMEAE eigenvalue as the test statistic and derive the corresponding threshold to make a decision. Since the statistical covariance of the received signal and noise are usually different, they can be used to distinguish between the presence of the primary user signal and the presence of noise only. However, the traditional method of random matrix theory will have the problem of inaccurate estimation of the threshold. At the same time, in the complex real environment, the SNR of the primary user signal is low and susceptible to the multipath fading and time diffusion of the wireless channel, which will greatly affect the system performance.In order to solve the problem of inaccurate threshold derivation in traditional stochastic matrix theory, the literature [10] proposed spectrum sensing method based on signal eigenvalue and clustering algorithm. This method uses a K-means clustering algorithm and signal eigenvalues to train a classifier and use the classifier to determine whether the primary user signal exists. Spectrum sensing can also be considered as a problem of two classifications (the existence of a primary user or the absence of a primary user). Because the clustering algorithm can deal with the two classification problems well, the spectrum sensing method based on machine learning has gradually become a focus of people’s research. Literature [11] proposed a spectrum sensing method based on K-means clustering. This method takes the energy of the signal as a feature and then divides this feature into a channel available class or a channel unavailable class through a K-means clustering algorithm. Literature [12] proposed a spectrum sensing method combining support vector machine and MME. The literature [13] analyzes the spectrum sensing performance under different clustering algorithms. Compared with the traditional spectrum sensing method, the spectrum sensing method based on machine learning is more adaptive and does not need to know the prior knowledge of the sensing environment. However, taking into account the actual environment, the signal often contains complex uncertain noises which will affect the effectiveness of the clustering algorithm, making the spectrum sensing system have poor clustering performance at low SNR and it will affect the sensing performance of the entire system.In a cognitive radio network, noise in the actual environment will affect the sensing performance of the system. In order to improve the sensing performance of the system, it is necessary to remove redundant information such as noise in the spectrum signal. However, most signals received by the system are nonstationary and nonlinear. In order to deal with nonstationary and nonlinear signals, the traditional methods use short-time Fourier transform, Wigner-Ville distribution, and wavelet transform. However, these methods are essentially Fourier transforms, which are subject to indefinite principles. Therefore, there are certain defects in the traditional signal processing methods. Literature [14] proposed an Empirical Mode Decomposition (EMD) algorithm that decomposes complex signals into a collection of Intrinsic Mode Functions (IMF). Literature [15] proposed a spectrum sensing method based on Hilbert-Huang Transform (HHT). First, the spectrum signal is subjected to EMD decomposition to obtain the IMF component. Calculate the Hilbert spectrum and total HHT spectrum for each IMF component and then find the total marginal spectrum. Compare the total marginal spectrum with the threshold to determine whether the primary user exists.In order to make the system have good adaptability in the actual environment, reduce the impact of noise and accurately determine whether the main user exists. Based on previous studies, we propose a spectrum sensing method (KEMDSS) based on EMD algorithm and K-means clustering algorithm. The KEMDSS method will uses EMD algorithm and wavelet threshold algorithm to process the received spectrum signal, removing the redundant information in the signal, and then use the K-means clustering algorithm to determine whether the primary user exists. To verify the effectiveness of the KEMDSS method, this article uses DMM and DMEAE as signal features. The experimental results also show that KEMDSS method can improve the sensing performance of the system no matter which feature is used.


## 2. System Model

The KEMDSS method is mainly composed of a signal processing part and a clustering algorithm part. In order to be able to deal with complex spectrum signals in the actual environment, we posed a signal processing method (WEMD) which combines the EMD algorithm and the wavelet threshold algorithm. According to the multiscale filtering characteristics of EMD, the spectrum signal can be decomposed into several high-frequency and low-frequency IMF components. Considering signal noise and other interference factors are mainly concentrated in the high-frequency band, the WEMD method uses wavelet algorithm to remove the noise in high-frequency IMF components. The purpose is to reduce the impact of noise and other factors on the system. The clustering algorithm mainly uses the DMEAE and DMM signal features, collects a certain amount of training sets and test sets, and then uses the K-means clustering algorithm to train the classifiers for judgment, thereby determining whether the primary user exists. The entire KEMDSS flowchart is as shown in Figure1.Figure 1
Model of the KEMDSS framework.


### 2.1. Cognitive Radio Network Model

KEMDSS is a cooperative spectrum sensing method. The cooperative spectrum sensing system can reduce the influence of uncertain factors such as multipath fading in the actual environment and thus can improve the sensing performance of the entire system. Assume that there areM secondary users (SU) in the cognitive radio network and each SU has N sampling points. We assume that H
0 indicates that the primary user (PU) signal does not exist and H
1 indicates that the primary user PU exists. So the model of the received signal under these two assumptions can be expressed as(1)
X
i
n
=
w
i
n
H
0
i
=
1,2
,
…
,
M
s
i
n
+
w
i
n
H
1
i
=
1,2
,
…
,
Mwheres
i
(
n
) represents the PU signal and w
i
(
n
) represents a Gaussian white noise signal with a mean of 0 and a variance of σ
2. Assume that S
=
1 and S
=
0, respectively, indicate the state of the PU. The availability A of the channel can be defined as(2)
A
=
0
,
S
=
1
1
,
S
=
0where A = 0 indicates that the channel is unavailable and A = 1 indicates that the channel is available. The false alarm probability (P
f) and detection probability (P
d) of the system can be defined as(3)
P
f
=
P
A
=
0
∣
A
=
1
(4)
P
d
=
P
A
=
0
∣
A
=
0


### 2.2. WEMD Signal Processing Algorithm

#### 2.2.1. EMD Algorithm

This paper introduces the EMD algorithm. Compared to traditional signal processing methods, EMD algorithm can handle nonstationary and nonlinear signals well. The EMD algorithm decomposes the original signal into several IMF components based on the local time feature scale of the signal [14]. The specific steps of the EMD decomposition process are as follows.Step 1.
Find all local maxima and local minima in the spectrum signalX
(
t
).Step 2.
Find the maximum envelopex
m
a
x
(
t
) and the minimum envelope x
m
i
n
(
t
), and calculate the average m
1
(
t
):(5)
m
1
t
=
x
m
a
x
t
+
x
m
i
n
t
2Step 3.
Subtractm
1
(
t
) from the original signal X
(
t
) to get the first component h
1
(
t
):(6)
h
1
t
=
X
t
-
m
1
t
Determine whetherh
1
(
t
) satisfies the two conditions of the IMF. If Step 4 is satisfied, perform Steps 1 and 2 for h
1
(
t
) to obtain the mean envelope m
11
(
t
), and calculate h
11
(
t
):(7)
h
11
t
=
h
1
t
-
m
11
t
In order untilh
1
k
(
t
) meets the IMF condition, then(8)
C
1
t
=
h
1
k
t
C
1
(
t
) is the first IMF component.Step 4.
SubtractC
1
(
t
) from the spectrum signal X
(
t
) to obtain residual r
1
(
t
); that is,(9)
X
t
-
C
1
t
=
r
1
t
Treatr
1
(
t
) as the original signal and repeat Steps 1~4 to get r
2
(
t
). And so on until the residual r
n
(
t
) is a monotonous function or a constant. Therefore, the signal X
(
t
) can be expressed as(10)
X
t
=
∑
i
=
1
n
C
i
t
+
r
n
t


#### 2.2.2. Wavelet Threshold Algorithm

Considering wavelet coefficients of signal and noise are different, so the wavelet threshold algorithm can remove noise components in the signal based on this characteristic. The specific steps of the wavelet threshold denoise algorithm are as follows [16, 17].Step 1.
Wavelet transform the signalX
(
t
) to obtain the wavelet coefficient W.Step 2.
Threshold the wavelet coefficientsW to obtain the estimated coefficient W
^.Step 3.
UseW
^ to perform wavelet reconstruction and obtain the denoised signal.This paper will use the soft threshold function, which is expressed as follows:(11)
W
^
=
sgn
⁡
W
W
-
γ
W
≥
γ
0
W
≤
γwhereγ is the VisuShrink threshold proposed by Donoho and Johnstone [16], which satisfy(12)
γ
=
σ
n
2
ln
⁡
Nwhereσ
n is the standard deviation of noise and N is the number of sample points of the signal.


#### 2.2.3. WEMD Signal Processing Algorithm

After EMD decomposition, the spectrum signal can be represented by adding severalIMF components and residual components. In an actual environment, noise usually occurs at high frequencies and useful signals are generally concentrated at low frequencies. Therefore, some high-bandIMF can be removed, and then the remainingIMF can be reconstructed to obtain denoised signals, but this method will lose some useful signals [18]. In order to solve this problem, WEMD signal processing algorithm is proposed in this paper. After the signal X
(
t
) is decomposed by EMD, wavelet threshold method is used to denoise high-bandIMFto obtainDIMF, thenDIMF and the original low-bandIMF are superimposed to obtain the reconstructed signal X
~
(
t
).The literature [19] proves that this algorithm can remove the noise component of the original signal well, and it will not lose the useful information in the original signal. Therefore, the use of WEMD signal processing method can reduce the interference of noise on the spectrum sensing system and improve the system sensing performance. Figure 2 shows the WEMD signal processing flow chart.Figure 2
Flowchart of the WEMD algorithm.WEMD signal processing algorithm steps are as follows.Step 1.
The spectrum signalX
(
t
) is decomposed by EMD to obtain n
IMF components.Step 2.
Find the high-frequency components in then
IMF and obtain the critical point m.
The literature [20, 21] uses the continuous mean square error criterion to find the critical value m:(13)
C
M
S
E
X
m
,
X
m
+
1
=
1
N
∑
i
=
1
N
X
m
t
i
-
X
m
+
1
t
i
2
=
1
N
∑
i
=
1
N
I
M
F
m
t
i
2
m
=
1
,
…
,
n
-
1
(14)
m
=
arg
⁡
min
⁡
C
M
S
E
X
m
,
X
m
+
1
1
≤
m
≤
n
-
1
Among them,N represents the sampling point number of the signal X
(
t
). The critical point m represents the global minimum point of all I
M
F energy and is also the demarcation point between the low-frequency band and the high-frequency band.Step 3.
Use the wavelet soft threshold algorithm to denoise the high-frequency componentsI
M
F
1
~
I
M
F
m to obtain the denoised component D
I
M
F
1
~
D
I
M
F
m.Step 4.
TheDIMF is superimposed with the original low-frequencyIMF to obtain the reconstructed signal X
~
(
t
).


### 2.3. Clustering Algorithm Model

After the spectrum signal is processed by the WEMD algorithm, we will use the K-means clustering algorithm for further processing. The traditional spectrum sensing method generally deduces the corresponding threshold to judge whether the main user exists, but the problem of inaccurate threshold derivation occurs. Spectrum sensing can also be considered as a problem of two classifications (PU presence or PU absence). KEMDSS method will use the K-means clustering algorithm to determine whether the primary user exists. Tradition spectrum sensing methods for machine learning often use energy features to characterize signals. Then the clustering algorithm is used to divide the feature values into channel usable classes and channel unavailable classes. In this paper, we use the eigenvalues of the covariance matrix in the random matrix to describe the signal characteristics.Assuming thatX
~
i
=
[
x
i
1
x
i
2
…
x
i
(
N
)
] represents the reconstructed sample vector of thei-th SU user, the sensing matrix in a period of time can be expressed as(15)
X
-
=
X
~
1
1
X
~
1
2
…
X
~
1
N
X
~
2
1
X
~
2
2
…
X
~
2
N
⋮
⋮
⋱
⋮
X
~
M
1
X
~
M
2
…
X
~
M
NTherefore, the covariance matrix of the signal can be expressed asR
N
=
1
/
N
X
-
X
-
T. Traditional random matrix spectrum sensing method usually uses DMM eigenvalues and DMEAE eigenvalues as the statistics and then deduced the corresponding thresholds to judge. However, the traditional method has relatively high requirements for the derivation of the threshold, and it cannot adaptively make corresponding changes according to different sensing environments, which will adversely affect the sensing performance of the entire system. Therefore, this paper introduces the method of K-means clustering algorithm on the traditional method of random matrix. The status of the primary user is determined by training the classifier.In the sensing system, the signal eigenvalues ofM SU nodes are first collected and use these eigenvalues to construct a training set:(16)
T
=
T
1
,
T
2
,
…
,
T
L
TwhereT is a column vector, T
i represents the random matrix eigenvalues, and L represents the number of eigenvalues. After this training set is obtained, the K-means clustering algorithm is used to classify these features and train a classifier. Considering the actual situation of spectrum sensing, it is generally divided into two categories. One class represents that the primary user does not exist, and the other represents the primary user exists. After the training process is completed, the corresponding cluster center φ is obtained. We use formula (17) to make the decision [11]. Where ε is used to control P
f and P
d of the system, K represents the number of clusters. In this paper, the value of K is 2.(17)
T
i
-
φ
1
min
k
=
2,3
,
…
,
K
⁡
T
i
-
φ
k
≥
εIf the data of the test set satisfies (17), it is determined as A = 1; otherwise it is determined as A = 0.The specific steps of the K-means clustering algorithm are as follows.Step 1.
Firstly we collect sufficient number of training feature matrixT.Step 2.
Randomly initialize the cluster center(
φ
1
,
φ
2
,
…
,
φ
K
).Step 3.
Calculate the distanced from each feature T
i to each cluster center φ
i, find the smallest d and reclassify.Step 4.
Calculate the mean of all points(
z
1
,
z
2
,
…
,
z
j
) in each cluster and take this as a new cluster center.Step 5.
CalculateJ
=
∑
k
=
1
K
∑
z
j
∈
φ
k
z
j
-
φ
k
2. If J converges, the algorithm stops; otherwise returns to Step 3.Step 6.
After successful training the classifier, we import the corresponding test set and make a corresponding decision on channel availability A by formula (17).Step 7.
Calculate the correspondingP
f and P
d according to formula (3) and formula (4).The entire training and testing flowchart is as shown in Figure3. Table 1 shows KEMDSS algorithm.Table 1
The algorithm of KEMDSS.
KEMDSS algorithm
Input: Spectrum signalX
(
t
)
(1) DenoisingX
(
t
) with EMD algorithm to obtain reconstructed signal X
~
(
t
)
(2) Construct the perceptual matrixX
- and calculate the corresponding covariance matrix R
(
n
)
(3) Constructed eigenvectorT
=
T
1
,
T
2
,
…
,
T
L
(4) Train the classifier to get the corresponding cluster centerφ
(5) Import test set and get test result according to Eq. (17)
(6) CalculateP
d and P
f according to Eq. (3) and Eq. (4)
Output:P
d and P
fFigure 3
Flowchart of the train and test.


## 2.1. Cognitive Radio Network Model

KEMDSS is a cooperative spectrum sensing method. The cooperative spectrum sensing system can reduce the influence of uncertain factors such as multipath fading in the actual environment and thus can improve the sensing performance of the entire system. Assume that there areM secondary users (SU) in the cognitive radio network and each SU has N sampling points. We assume that H
0 indicates that the primary user (PU) signal does not exist and H
1 indicates that the primary user PU exists. So the model of the received signal under these two assumptions can be expressed as(1)
X
i
n
=
w
i
n
H
0
i
=
1,2
,
…
,
M
s
i
n
+
w
i
n
H
1
i
=
1,2
,
…
,
Mwheres
i
(
n
) represents the PU signal and w
i
(
n
) represents a Gaussian white noise signal with a mean of 0 and a variance of σ
2. Assume that S
=
1 and S
=
0, respectively, indicate the state of the PU. The availability A of the channel can be defined as(2)
A
=
0
,
S
=
1
1
,
S
=
0where A = 0 indicates that the channel is unavailable and A = 1 indicates that the channel is available. The false alarm probability (P
f) and detection probability (P
d) of the system can be defined as(3)
P
f
=
P
A
=
0
∣
A
=
1
(4)
P
d
=
P
A
=
0
∣
A
=
0


## 2.2. WEMD Signal Processing Algorithm

### 2.2.1. EMD Algorithm

This paper introduces the EMD algorithm. Compared to traditional signal processing methods, EMD algorithm can handle nonstationary and nonlinear signals well. The EMD algorithm decomposes the original signal into several IMF components based on the local time feature scale of the signal [14]. The specific steps of the EMD decomposition process are as follows.Step 1.
Find all local maxima and local minima in the spectrum signalX
(
t
).Step 2.
Find the maximum envelopex
m
a
x
(
t
) and the minimum envelope x
m
i
n
(
t
), and calculate the average m
1
(
t
):(5)
m
1
t
=
x
m
a
x
t
+
x
m
i
n
t
2Step 3.
Subtractm
1
(
t
) from the original signal X
(
t
) to get the first component h
1
(
t
):(6)
h
1
t
=
X
t
-
m
1
t
Determine whetherh
1
(
t
) satisfies the two conditions of the IMF. If Step 4 is satisfied, perform Steps 1 and 2 for h
1
(
t
) to obtain the mean envelope m
11
(
t
), and calculate h
11
(
t
):(7)
h
11
t
=
h
1
t
-
m
11
t
In order untilh
1
k
(
t
) meets the IMF condition, then(8)
C
1
t
=
h
1
k
t
C
1
(
t
) is the first IMF component.Step 4.
SubtractC
1
(
t
) from the spectrum signal X
(
t
) to obtain residual r
1
(
t
); that is,(9)
X
t
-
C
1
t
=
r
1
t
Treatr
1
(
t
) as the original signal and repeat Steps 1~4 to get r
2
(
t
). And so on until the residual r
n
(
t
) is a monotonous function or a constant. Therefore, the signal X
(
t
) can be expressed as(10)
X
t
=
∑
i
=
1
n
C
i
t
+
r
n
t


### 2.2.2. Wavelet Threshold Algorithm

Considering wavelet coefficients of signal and noise are different, so the wavelet threshold algorithm can remove noise components in the signal based on this characteristic. The specific steps of the wavelet threshold denoise algorithm are as follows [16, 17].Step 1.
Wavelet transform the signalX
(
t
) to obtain the wavelet coefficient W.Step 2.
Threshold the wavelet coefficientsW to obtain the estimated coefficient W
^.Step 3.
UseW
^ to perform wavelet reconstruction and obtain the denoised signal.This paper will use the soft threshold function, which is expressed as follows:(11)
W
^
=
sgn
⁡
W
W
-
γ
W
≥
γ
0
W
≤
γwhereγ is the VisuShrink threshold proposed by Donoho and Johnstone [16], which satisfy(12)
γ
=
σ
n
2
ln
⁡
Nwhereσ
n is the standard deviation of noise and N is the number of sample points of the signal.


### 2.2.3. WEMD Signal Processing Algorithm

After EMD decomposition, the spectrum signal can be represented by adding severalIMF components and residual components. In an actual environment, noise usually occurs at high frequencies and useful signals are generally concentrated at low frequencies. Therefore, some high-bandIMF can be removed, and then the remainingIMF can be reconstructed to obtain denoised signals, but this method will lose some useful signals [18]. In order to solve this problem, WEMD signal processing algorithm is proposed in this paper. After the signal X
(
t
) is decomposed by EMD, wavelet threshold method is used to denoise high-bandIMFto obtainDIMF, thenDIMF and the original low-bandIMF are superimposed to obtain the reconstructed signal X
~
(
t
).The literature [19] proves that this algorithm can remove the noise component of the original signal well, and it will not lose the useful information in the original signal. Therefore, the use of WEMD signal processing method can reduce the interference of noise on the spectrum sensing system and improve the system sensing performance. Figure 2 shows the WEMD signal processing flow chart.Figure 2
Flowchart of the WEMD algorithm.WEMD signal processing algorithm steps are as follows.Step 1.
The spectrum signalX
(
t
) is decomposed by EMD to obtain n
IMF components.Step 2.
Find the high-frequency components in then
IMF and obtain the critical point m.
The literature [20, 21] uses the continuous mean square error criterion to find the critical value m:(13)
C
M
S
E
X
m
,
X
m
+
1
=
1
N
∑
i
=
1
N
X
m
t
i
-
X
m
+
1
t
i
2
=
1
N
∑
i
=
1
N
I
M
F
m
t
i
2
m
=
1
,
…
,
n
-
1
(14)
m
=
arg
⁡
min
⁡
C
M
S
E
X
m
,
X
m
+
1
1
≤
m
≤
n
-
1
Among them,N represents the sampling point number of the signal X
(
t
). The critical point m represents the global minimum point of all I
M
F energy and is also the demarcation point between the low-frequency band and the high-frequency band.Step 3.
Use the wavelet soft threshold algorithm to denoise the high-frequency componentsI
M
F
1
~
I
M
F
m to obtain the denoised component D
I
M
F
1
~
D
I
M
F
m.Step 4.
TheDIMF is superimposed with the original low-frequencyIMF to obtain the reconstructed signal X
~
(
t
).


## 2.2.1. EMD Algorithm

This paper introduces the EMD algorithm. Compared to traditional signal processing methods, EMD algorithm can handle nonstationary and nonlinear signals well. The EMD algorithm decomposes the original signal into several IMF components based on the local time feature scale of the signal [14]. The specific steps of the EMD decomposition process are as follows.Step 1.
Find all local maxima and local minima in the spectrum signalX
(
t
).Step 2.
Find the maximum envelopex
m
a
x
(
t
) and the minimum envelope x
m
i
n
(
t
), and calculate the average m
1
(
t
):(5)
m
1
t
=
x
m
a
x
t
+
x
m
i
n
t
2Step 3.
Subtractm
1
(
t
) from the original signal X
(
t
) to get the first component h
1
(
t
):(6)
h
1
t
=
X
t
-
m
1
t
Determine whetherh
1
(
t
) satisfies the two conditions of the IMF. If Step 4 is satisfied, perform Steps 1 and 2 for h
1
(
t
) to obtain the mean envelope m
11
(
t
), and calculate h
11
(
t
):(7)
h
11
t
=
h
1
t
-
m
11
t
In order untilh
1
k
(
t
) meets the IMF condition, then(8)
C
1
t
=
h
1
k
t
C
1
(
t
) is the first IMF component.Step 4.
SubtractC
1
(
t
) from the spectrum signal X
(
t
) to obtain residual r
1
(
t
); that is,(9)
X
t
-
C
1
t
=
r
1
t
Treatr
1
(
t
) as the original signal and repeat Steps 1~4 to get r
2
(
t
). And so on until the residual r
n
(
t
) is a monotonous function or a constant. Therefore, the signal X
(
t
) can be expressed as(10)
X
t
=
∑
i
=
1
n
C
i
t
+
r
n
t


## 2.2.2. Wavelet Threshold Algorithm

Considering wavelet coefficients of signal and noise are different, so the wavelet threshold algorithm can remove noise components in the signal based on this characteristic. The specific steps of the wavelet threshold denoise algorithm are as follows [16, 17].Step 1.
Wavelet transform the signalX
(
t
) to obtain the wavelet coefficient W.Step 2.
Threshold the wavelet coefficientsW to obtain the estimated coefficient W
^.Step 3.
UseW
^ to perform wavelet reconstruction and obtain the denoised signal.This paper will use the soft threshold function, which is expressed as follows:(11)
W
^
=
sgn
⁡
W
W
-
γ
W
≥
γ
0
W
≤
γwhereγ is the VisuShrink threshold proposed by Donoho and Johnstone [16], which satisfy(12)
γ
=
σ
n
2
ln
⁡
Nwhereσ
n is the standard deviation of noise and N is the number of sample points of the signal.


## 2.2.3. WEMD Signal Processing Algorithm

After EMD decomposition, the spectrum signal can be represented by adding severalIMF components and residual components. In an actual environment, noise usually occurs at high frequencies and useful signals are generally concentrated at low frequencies. Therefore, some high-bandIMF can be removed, and then the remainingIMF can be reconstructed to obtain denoised signals, but this method will lose some useful signals [18]. In order to solve this problem, WEMD signal processing algorithm is proposed in this paper. After the signal X
(
t
) is decomposed by EMD, wavelet threshold method is used to denoise high-bandIMFto obtainDIMF, thenDIMF and the original low-bandIMF are superimposed to obtain the reconstructed signal X
~
(
t
).The literature [19] proves that this algorithm can remove the noise component of the original signal well, and it will not lose the useful information in the original signal. Therefore, the use of WEMD signal processing method can reduce the interference of noise on the spectrum sensing system and improve the system sensing performance. Figure 2 shows the WEMD signal processing flow chart.Figure 2
Flowchart of the WEMD algorithm.WEMD signal processing algorithm steps are as follows.Step 1.
The spectrum signalX
(
t
) is decomposed by EMD to obtain n
IMF components.Step 2.
Find the high-frequency components in then
IMF and obtain the critical point m.
The literature [20, 21] uses the continuous mean square error criterion to find the critical value m:(13)
C
M
S
E
X
m
,
X
m
+
1
=
1
N
∑
i
=
1
N
X
m
t
i
-
X
m
+
1
t
i
2
=
1
N
∑
i
=
1
N
I
M
F
m
t
i
2
m
=
1
,
…
,
n
-
1
(14)
m
=
arg
⁡
min
⁡
C
M
S
E
X
m
,
X
m
+
1
1
≤
m
≤
n
-
1
Among them,N represents the sampling point number of the signal X
(
t
). The critical point m represents the global minimum point of all I
M
F energy and is also the demarcation point between the low-frequency band and the high-frequency band.Step 3.
Use the wavelet soft threshold algorithm to denoise the high-frequency componentsI
M
F
1
~
I
M
F
m to obtain the denoised component D
I
M
F
1
~
D
I
M
F
m.Step 4.
TheDIMF is superimposed with the original low-frequencyIMF to obtain the reconstructed signal X
~
(
t
).


## 2.3. Clustering Algorithm Model

After the spectrum signal is processed by the WEMD algorithm, we will use the K-means clustering algorithm for further processing. The traditional spectrum sensing method generally deduces the corresponding threshold to judge whether the main user exists, but the problem of inaccurate threshold derivation occurs. Spectrum sensing can also be considered as a problem of two classifications (PU presence or PU absence). KEMDSS method will use the K-means clustering algorithm to determine whether the primary user exists. Tradition spectrum sensing methods for machine learning often use energy features to characterize signals. Then the clustering algorithm is used to divide the feature values into channel usable classes and channel unavailable classes. In this paper, we use the eigenvalues of the covariance matrix in the random matrix to describe the signal characteristics.Assuming thatX
~
i
=
[
x
i
1
x
i
2
…
x
i
(
N
)
] represents the reconstructed sample vector of thei-th SU user, the sensing matrix in a period of time can be expressed as(15)
X
-
=
X
~
1
1
X
~
1
2
…
X
~
1
N
X
~
2
1
X
~
2
2
…
X
~
2
N
⋮
⋮
⋱
⋮
X
~
M
1
X
~
M
2
…
X
~
M
NTherefore, the covariance matrix of the signal can be expressed asR
N
=
1
/
N
X
-
X
-
T. Traditional random matrix spectrum sensing method usually uses DMM eigenvalues and DMEAE eigenvalues as the statistics and then deduced the corresponding thresholds to judge. However, the traditional method has relatively high requirements for the derivation of the threshold, and it cannot adaptively make corresponding changes according to different sensing environments, which will adversely affect the sensing performance of the entire system. Therefore, this paper introduces the method of K-means clustering algorithm on the traditional method of random matrix. The status of the primary user is determined by training the classifier.In the sensing system, the signal eigenvalues ofM SU nodes are first collected and use these eigenvalues to construct a training set:(16)
T
=
T
1
,
T
2
,
…
,
T
L
TwhereT is a column vector, T
i represents the random matrix eigenvalues, and L represents the number of eigenvalues. After this training set is obtained, the K-means clustering algorithm is used to classify these features and train a classifier. Considering the actual situation of spectrum sensing, it is generally divided into two categories. One class represents that the primary user does not exist, and the other represents the primary user exists. After the training process is completed, the corresponding cluster center φ is obtained. We use formula (17) to make the decision [11]. Where ε is used to control P
f and P
d of the system, K represents the number of clusters. In this paper, the value of K is 2.(17)
T
i
-
φ
1
min
k
=
2,3
,
…
,
K
⁡
T
i
-
φ
k
≥
εIf the data of the test set satisfies (17), it is determined as A = 1; otherwise it is determined as A = 0.The specific steps of the K-means clustering algorithm are as follows.Step 1.
Firstly we collect sufficient number of training feature matrixT.Step 2.
Randomly initialize the cluster center(
φ
1
,
φ
2
,
…
,
φ
K
).Step 3.
Calculate the distanced from each feature T
i to each cluster center φ
i, find the smallest d and reclassify.Step 4.
Calculate the mean of all points(
z
1
,
z
2
,
…
,
z
j
) in each cluster and take this as a new cluster center.Step 5.
CalculateJ
=
∑
k
=
1
K
∑
z
j
∈
φ
k
z
j
-
φ
k
2. If J converges, the algorithm stops; otherwise returns to Step 3.Step 6.
After successful training the classifier, we import the corresponding test set and make a corresponding decision on channel availability A by formula (17).Step 7.
Calculate the correspondingP
f and P
d according to formula (3) and formula (4).The entire training and testing flowchart is as shown in Figure3. Table 1 shows KEMDSS algorithm.Table 1
The algorithm of KEMDSS.
KEMDSS algorithm
Input: Spectrum signalX
(
t
)
(1) DenoisingX
(
t
) with EMD algorithm to obtain reconstructed signal X
~
(
t
)
(2) Construct the perceptual matrixX
- and calculate the corresponding covariance matrix R
(
n
)
(3) Constructed eigenvectorT
=
T
1
,
T
2
,
…
,
T
L
(4) Train the classifier to get the corresponding cluster centerφ
(5) Import test set and get test result according to Eq. (17)
(6) CalculateP
d and P
f according to Eq. (3) and Eq. (4)
Output:P
d and P
fFigure 3
Flowchart of the train and test.


## 3. Experimental Part

In order to simulate the actual environment, this experiment uses the FM signal, chirp signal, and mixed signalS
t
=
cos
⁡
t
+
cos
⁡
⁡
(
4
t
+
0.2
t
2
) as experimental simulation signals. The carrier frequency is 702 KHz and the sampling rate is 4 MHz. To ensure the accuracy of the experiment, we obtained 1000 signal features (DMEAE, DMM), 500 of them were used as training sets and 500 were used as test sets.


### 3.1. Clustering Algorithm Classification Effect

In order to verify the effectiveness of the method, we first simulated the mixed signal. In the experimental part, we adopted two characteristic values of DMEAE and DMM. The clustering results are shown in Figures4–7.(1)
DMEAE clustering effect graph under SNR=-16
(2)
SNR=-16 DMM clustering effect chartFigure 4
Classification of K-means clustering algorithm with DMEAE feature.Figure 5
Classification of K-means clustering algorithm with DMEAE feature after KEMDSS denoise.Figure 6
Classification of K-means clustering algorithm with DMM feature.Figure 7
Classification of K-means clustering algorithm with DMM feature after KEMDSS denoise.Figures4 and 5 show the clustering of DMEAE features before and after the KEMDSS method under SNR=-16, respectively. Figures 6 and 7, respectively, show that in the conditions of SNR=-16, the DMM features are processed before and after the KEMDSS method. It can be seen from the above that after the KEMDSS method is processed, the clustering effect of the two features is better than the original. This is because after the KEMDSS method is processed, the difference between the sampled signal covariance matrix and the noise covariance matrix is more obvious, so the eigenvalue of the covariance matrix has a better clustering effect under the K-means clustering algorithm.


### 3.2. ROC Curve under Constant False Alarm Condition

In order to reflect the superiority of the KEMDSS method, we used the KEMDSS method and the traditional EMD (TEMD) method to process the spectrum signal. The TEMD method decomposes the spectrum signal and discards some high-band signals. However, the KEMDSS method uses the wavelet threshold method to further process the high-frequency signals. The test results of the two methods are as follows.(
1) ROC Curve of DMEAE Characteristics. Figures 8 and 9 show the ROC curves of the DMEAE features after KEMDSS and TEMD processing at different SNR, respectively. From this we can see that the detection performance of the spectrum signal after KEMDSS method or TEMD method is better than the original one, and the best effect can be achieved by using KEMDSS method. Tables 2 and 3 show the detection probability of each algorithm when the false alarm probability is constant at different SNR. From Table 2, we can see that, under the condition of SNR=-16 and P
f
=
0.1, the P
d using KEMDSS and TEMD as the algorithm has improved the detection performance by 69% and 41%, respectively, compared with the traditional algorithm. This is because both KEMDSS and TEMD can remove the noise in the spectrum signal. Compared with the TEMD method, KEMDSS can remove the redundant components such as noise in the spectrum signal without losing some useful signals and thus can obtain better detection results. Table 3 shows the P
d comparison of different algorithms in SNR = -18.Table 2
ThePd comparison of different algorithms in SNR=-16.
Algorithm
Pf
=
0.1
Pf
=
0.2
KEMDSS
0.9
0.95
TEMD
0.75
0.86
Tradition
0.53
0.7Table 3
ThePd comparison of different algorithms in SNR=-18.
Algorithm
Pf
=
0.1
Pf
=
0.2
KEMDSS
0.58
0.73
TEMD
0.4
0.57
Tradition
0.23
0.41Figure 8
ROC curve with DMEAE feature under SNR=-16.Figure 9
ROC curve with DMEAE feature under SNR=-18.(
2) ROC Curves of DMM Features. Figures 10 and 11 show the ROC curves of DMM features after KEMDSS and TEMD processing at different SNR, respectively. From the figure, it can still be seen that the detection performance of the system has been improved after KEMDSS and TEMD removal of noise components. We can find that KEMDSS method is more effective than the TEMD method. Tables 4 and 5 show the detection probability of each algorithm when the false alarm probability is constant under different SNR. From Table 4, we can calculate that, under the condition of SNR = -16 and P
f
=
0.1, P
d using KEMDSS and TEMD as an algorithm is 88% and 62% higher than the conventional algorithm, respectively.Table 4
ThePd comparison of different algorithms in SNR=-16.
Algorithm
Pf
=
0.1
Pf
=
0.2
KEMDSS
0.85
0.92
TEMD
0.73
0.83
Tradition
0.45
0.66Table 5
ThePdcomparison of different algorithms in SNR=-18.
Algorithm
Pf
=
0.1
Pf
=
0.2
KEMDSS
0.54
0.68
TEMD
0.33
0.51
Tradition
0.27
0.42Figure 10
ROC curve with DMM feature under SNR=-16.Figure 11
ROC curve with DMM feature under SNR=-18.From the experimental results in Section3.2 we can know that regardless of the characteristics used, the detection performance of the system is improved after the spectrum signal is processed by KEMDSS and TEMD. And the KEMDSS algorithm will have a best result. The sampled signal is processed by the KEMDSS algorithm, which minimizes the impact of noise uncertainties on the system and thus achieves good sensing performance.


### 3.3. ROC Curve for Different Cooperative Users

Figures12 and 13 show the ROC curve of the KEMDSS algorithm under different numbers of users. From this we can see that the sensing performance of the system is better as the number of collaborative users increases. This is because cooperative perception can reduce the interference of various factors such as multipath fading and shadows in the propagation environment. Therefore, the greater the number of collaborating users, the stronger the anti-interference ability of the system and the better the sensing performance.Figure 12
ROC curve with different collaboration users under DMEAE SNR=-18.Figure 13
ROC curve with different collaboration users under DMM SNR=-18.


### 3.4. ROC Curve under FM Signal and Chirp Signal

In order to verify the practicality of the KEMDSS method, different spectrum signals (FM signals and chirp signals) were used for experiments. The specific experimental results are as follows:(1)
The simulation results under the FM signal
(2)
Simulation results under the chirp signalFigures14–17 show the ROC curves of the DMM and DMEAE features under the FM and chirp signals, respectively. It can be seen from the figure that, compared with the traditional spectrum sensing method, the KEMDSS method can achieve better detection performance and it can be applied to various spectrum signals in the actual environment. This is because EMD plus wavelet threshold algorithm can remove the noise information in the spectrum signal. It can reduce the impact of noise and other pieces of redundant information on the sensing system, thereby improving the system sensing performance.Figure 14
ROC curve using FM signal under DMM SNR=-16.Figure 15
ROC curve using FM signal with DMEAE in SNR=-16.Figure 16
ROC curve using chirp signal with DMM in SNR=-20.Figure 17
ROC curve using chirp signal with DMEAE in SNR=-20.


## 3.1. Clustering Algorithm Classification Effect

In order to verify the effectiveness of the method, we first simulated the mixed signal. In the experimental part, we adopted two characteristic values of DMEAE and DMM. The clustering results are shown in Figures4–7.(1)
DMEAE clustering effect graph under SNR=-16
(2)
SNR=-16 DMM clustering effect chartFigure 4
Classification of K-means clustering algorithm with DMEAE feature.Figure 5
Classification of K-means clustering algorithm with DMEAE feature after KEMDSS denoise.Figure 6
Classification of K-means clustering algorithm with DMM feature.Figure 7
Classification of K-means clustering algorithm with DMM feature after KEMDSS denoise.Figures4 and 5 show the clustering of DMEAE features before and after the KEMDSS method under SNR=-16, respectively. Figures 6 and 7, respectively, show that in the conditions of SNR=-16, the DMM features are processed before and after the KEMDSS method. It can be seen from the above that after the KEMDSS method is processed, the clustering effect of the two features is better than the original. This is because after the KEMDSS method is processed, the difference between the sampled signal covariance matrix and the noise covariance matrix is more obvious, so the eigenvalue of the covariance matrix has a better clustering effect under the K-means clustering algorithm.


## 3.2. ROC Curve under Constant False Alarm Condition

In order to reflect the superiority of the KEMDSS method, we used the KEMDSS method and the traditional EMD (TEMD) method to process the spectrum signal. The TEMD method decomposes the spectrum signal and discards some high-band signals. However, the KEMDSS method uses the wavelet threshold method to further process the high-frequency signals. The test results of the two methods are as follows.(
1) ROC Curve of DMEAE Characteristics. Figures 8 and 9 show the ROC curves of the DMEAE features after KEMDSS and TEMD processing at different SNR, respectively. From this we can see that the detection performance of the spectrum signal after KEMDSS method or TEMD method is better than the original one, and the best effect can be achieved by using KEMDSS method. Tables 2 and 3 show the detection probability of each algorithm when the false alarm probability is constant at different SNR. From Table 2, we can see that, under the condition of SNR=-16 and P
f
=
0.1, the P
d using KEMDSS and TEMD as the algorithm has improved the detection performance by 69% and 41%, respectively, compared with the traditional algorithm. This is because both KEMDSS and TEMD can remove the noise in the spectrum signal. Compared with the TEMD method, KEMDSS can remove the redundant components such as noise in the spectrum signal without losing some useful signals and thus can obtain better detection results. Table 3 shows the P
d comparison of different algorithms in SNR = -18.Table 2
ThePd comparison of different algorithms in SNR=-16.
Algorithm
Pf
=
0.1
Pf
=
0.2
KEMDSS
0.9
0.95
TEMD
0.75
0.86
Tradition
0.53
0.7Table 3
ThePd comparison of different algorithms in SNR=-18.
Algorithm
Pf
=
0.1
Pf
=
0.2
KEMDSS
0.58
0.73
TEMD
0.4
0.57
Tradition
0.23
0.41Figure 8
ROC curve with DMEAE feature under SNR=-16.Figure 9
ROC curve with DMEAE feature under SNR=-18.(
2) ROC Curves of DMM Features. Figures 10 and 11 show the ROC curves of DMM features after KEMDSS and TEMD processing at different SNR, respectively. From the figure, it can still be seen that the detection performance of the system has been improved after KEMDSS and TEMD removal of noise components. We can find that KEMDSS method is more effective than the TEMD method. Tables 4 and 5 show the detection probability of each algorithm when the false alarm probability is constant under different SNR. From Table 4, we can calculate that, under the condition of SNR = -16 and P
f
=
0.1, P
d using KEMDSS and TEMD as an algorithm is 88% and 62% higher than the conventional algorithm, respectively.Table 4
ThePd comparison of different algorithms in SNR=-16.
Algorithm
Pf
=
0.1
Pf
=
0.2
KEMDSS
0.85
0.92
TEMD
0.73
0.83
Tradition
0.45
0.66Table 5
ThePdcomparison of different algorithms in SNR=-18.
Algorithm
Pf
=
0.1
Pf
=
0.2
KEMDSS
0.54
0.68
TEMD
0.33
0.51
Tradition
0.27
0.42Figure 10
ROC curve with DMM feature under SNR=-16.Figure 11
ROC curve with DMM feature under SNR=-18.From the experimental results in Section3.2 we can know that regardless of the characteristics used, the detection performance of the system is improved after the spectrum signal is processed by KEMDSS and TEMD. And the KEMDSS algorithm will have a best result. The sampled signal is processed by the KEMDSS algorithm, which minimizes the impact of noise uncertainties on the system and thus achieves good sensing performance.


## 3.3. ROC Curve for Different Cooperative Users

Figures12 and 13 show the ROC curve of the KEMDSS algorithm under different numbers of users. From this we can see that the sensing performance of the system is better as the number of collaborative users increases. This is because cooperative perception can reduce the interference of various factors such as multipath fading and shadows in the propagation environment. Therefore, the greater the number of collaborating users, the stronger the anti-interference ability of the system and the better the sensing performance.Figure 12
ROC curve with different collaboration users under DMEAE SNR=-18.Figure 13
ROC curve with different collaboration users under DMM SNR=-18.


## 3.4. ROC Curve under FM Signal and Chirp Signal

In order to verify the practicality of the KEMDSS method, different spectrum signals (FM signals and chirp signals) were used for experiments. The specific experimental results are as follows:(1)
The simulation results under the FM signal
(2)
Simulation results under the chirp signalFigures14–17 show the ROC curves of the DMM and DMEAE features under the FM and chirp signals, respectively. It can be seen from the figure that, compared with the traditional spectrum sensing method, the KEMDSS method can achieve better detection performance and it can be applied to various spectrum signals in the actual environment. This is because EMD plus wavelet threshold algorithm can remove the noise information in the spectrum signal. It can reduce the impact of noise and other pieces of redundant information on the sensing system, thereby improving the system sensing performance.Figure 14
ROC curve using FM signal under DMM SNR=-16.Figure 15
ROC curve using FM signal with DMEAE in SNR=-16.Figure 16
ROC curve using chirp signal with DMM in SNR=-20.Figure 17
ROC curve using chirp signal with DMEAE in SNR=-20.


## 4. Conclusions

This paper proposes a spectrum sensing method based on EMD algorithm and K-means algorithm. Compared with traditional spectrum sensing methods, KEMDSS can well solve the problem that traditional spectrum sensing methods are affected by noise and the threshold is difficult to determine. The wireless spectrum signal is first processed by the WEMD algorithm, then uses the K-means clustering algorithm to train the classifier, and finally uses the classifier to judge whether the primary user exists. In the experimental part, we analyzed the detection results of two random matrix features DMEAE and DMM under the KEMDSS algorithm. From the experimental results, it can be seen that KEMDSS spectrum sensing method has better sensing performance than the conventional spectrum sensing method.



---

*Source: 6104502-2018-07-10.xml*