1 Introduction

At present, wireless communication technology as hot subject develops more and more quickly through endeavor of scientific and technical worker of various countries [1, 5]. Meanwhile, demand of users gradually becomes diversified. Therefore, lack of spectrum resource becomes more and more obvious. Dynamic spectrum access (also known as cognitive wireless network) technology can weaken contradiction between low spectrum efficiency and lack of spectrum resource. Benefiting from breakthrough obtained from physical layer of cognitive wireless network communication in technical field, now secondary user sharing resource of master user directly acquiring spectrum resource can access multiple channels of master user at the same time to transmit information [2]. Compared with channel transmission mode in single channel of master user, secondary user is equipped with more chances to obtain better transmission channel (mainly including smaller outage probability, lesser time delay, greater transmission throughput, etc.). Sensing order, time of channel and transmission power distribution will influence total throughtput of secondary user system with multichannel. In literature [9, 17], distribution of sensing time of multichannel is modeled as a convex optimization problem; in literature [10], the author, based on idle probability of channel, puts forward the best channel sensing order; secondary user can choose a suitable one among several master user channels as per the sensing order to carry out perception. In literature [13, 18], the author considers conditions of sensing channel; sencondary user needs to detect channel state of master user after sensing, such as channel gain, fading, etc. However, the above-mentioned research is built on single secondary user choosing the optimum one among several channels of master user to transmit signal, besides process of distributing spectrum resource is expensive and throughput of system is undesirable. In literature [15], the author jointly optimizes sensing and transmission strategy, but it assues each channel consumes fixed detecting time. In literature [16], the author jointly optimizes transmission channel selection and sensing time, but it adopts broadband spectrum sensing mesaures.

Algorithm in the Thesis, firstly based on single secondary user transmitting on multi-channel of master user at the same time, makes secondary user detect channel by sensing in order, and then choose certain suitable channel through optimum stopping theory to perceive; finally, solves through optimum stopping theory; maximize saving sensing time, meanwhile, obtain greater average throughput.

2 System model of secondary user

First, it assumes N channels of master user are included in coverage of cognitive wireless network, and channels of master user are discontinued, system of secondary user can share spectrum resource with master user under the circumstance of interference for master user less than preset value. System of secondary user consists of one base station (BS) and N secondary users (SU), and transmission model of down link should be mainly considered. Channel of master user should be detected firstly in order through base station, and transmission power should be adjusted on this basis, and then data transmission should be transmitted. System model of secondary user is shown in Fig. 1.

Fig. 1
figure 1

System model of secondary user

Detection period of base station is set as T, including sensing time slot and transmission time slot. P n (H 1) and P n (H 0) represent occupation probability and idle probability of Channel n respectively, of which idle probability of each channel is different. Here we assume idle probability of channel of master user has been acquired by BS in system of secondary user (note: the assumption conforms to convention; through long-term observation, base station can estimate idle probability [5, 6] of each channel of master user). In physical layer, the author assumes secondary user use energy detection method (energy detection is a kind of non-coherent signal detection method, and it presents as receiver of secondary user accumulating signal energy of master user in time domain, and secondary user uses Fourier transform to accumulate frequency domain signal of master user in frequency domain and compare it with judgment threshold to detect whether master user is in idle state) to detect process of channel of master user. Judgment probability P d , n and false alarm probability P f , n of Channel n are as follows:

$$ {P}_{d, n}= \Pr \left\{{H}_1|{H}_1\right\}= Q\left(\left(\frac{\upvarepsilon_n}{\upsigma_u^2}-{\upgamma}_n-1\right)\sqrt{\frac{\uptau_n{\mathrm{f}}_s}{2{r}_n+1}}\right) $$
(1)
$$ {P}_{f, n}= \Pr \left\{{H}_1|{H}_0\right\}= Q\left(\left(\frac{\upvarepsilon_n}{\upsigma_u^2}-1\right)\sqrt{\uptau_n{\mathrm{f}}_s}\right) $$
(2)

In above equation, τ n refers to sensing time of Channel n; f s refers to sampling frequency; ε n refers to judgment threshold of energy detection; γ n refers to received signal to noise (SNR) of base station in Channel n; \( {\upsigma}_u^2 \) refers to power of independent identically distributed complex Gaussian noise. Q(x) function can be expressed by the follow equation [4, 7, 8]:

$$ Q(x)=\frac{1}{\sqrt{2\pi}}{\int}_x^{+\infty }{e}^{-{t}^2/2} dt $$
(3)

The greater the judgment probability P d , n is, the smaller interference suffered by master user from secondary user; with reduction of false alarm probability P f , n , secondary user can obtain more access chance. P f , th and P d , th are assumed as threshold value of false probability and judgment probability of channel of master user. For example, in IEEE 802.2 standard, P d , th  = 0.9, P f , th  = 0.1. The Thesis is mainly partial to research perception of access framework and MAC layer. In physical layer, energy detection should be used to detect in case of no specific instructions.

3 Model of access strategy of secondary user

In system of secondary user, sequential detection method should be used in base station to perceive channel of master user one by one. Channel of master user can be divided into two parts; hybrid access method is used in base station to perceive and access foregoing N 1 channels, (N 1 ≤ N); for the channel without perception (number of channel is N − N 1), the base station is directly accessed through Underlay access strategy. With respect to currently existing three strategies of Overlay, Underlay and hybrid access, access strategy proposed in the Thesis is of better flexibility, which is reflected in the following aspects:

  1. 1)

    In case N 1 = 0, access strategy proposed in the Thesis is equivalent to Underlay access strategy;

  2. 2)

    In case N 1 = 0, and transmission power of channel is not equal to 0, access strategy proposed in the Thesis is equivalent to hybrid access strategy;

  3. 3)

    In case N 1  = N, and base station is only used to transmit in idle channel, access strategy proposed in the Thesis is equivalent to Overlay access strategy.

In sensing time slot, base station is used to detect channel from small to big in order according to idle probability P n (H 0) of channel. After finishing sensing, base station accesses foregoing N 1 channels as per results of perception. In case perceptive result of channel n(n ≤ N 1) is idle, transmission power of base station is P 1n ; in case perceptive result shows that the channel is occupied, transmission power is P 2n . It is assumed in the Thesis transmission power of top secondary user is P 2n ; values of P 1n and P 2n can be obtained by using some classic optimization algorithm of power distribution. Under access strategy designed in the Thesis, to obtain larger throughput, the base station is accessed with different power on multi-channel. Base station will compromise in total throughput and number of sensing channel. That is to say the more the channels is perceived, the greater the probability to obtain high-quality channel will be, but defects also exist, namely it will consume plenty of sensing time of base station, so as to lower throughput of system. Single channel compromises in throughput of single channel and a sensing time, namely length of sensing time can directly affect throughput of channel. Fig. 2 shows structure diagram of access strategy proposed in the Thesis.

Fig. 2
figure 2

Structure diagram of access strategy suitable for general

Number of sensing channel and sensing time of each sensing channel are jointly optimized in the Thesis in order to maximize total throughput of secondary user system; optimization problem can be expressed in Eq. (4).

$$ P1:\underset{\uptau_n,{N}_1}{ \max}\frac{T- t}{T}\left(\sum_{n=0}^{N_1}{r}_n+\sum_{n={N}_1+1}^N{R}_n\right) $$
(4)

Subject to:

$$ \sum_{n=0}^{N_1}{\uptau}_n=\uptau \le {\uptau}^{\ast } $$
(5)
$$ {P}_{d, n}\left({\uptau}_n\right)\ge {P}_{d, th} $$
(6)
$$ {P}_{f, n}\left({\uptau}_n\right)\ge {P}_{f, th} $$
(7)
$$ {N}_1\in \left\{0,1,\cdots, N\right\} $$
(8)

In above equation, r 0 = 0Mbps0 = 0ms. τ refers to total sensing time of system; τ refers to maximum delay of secondary user system. \( {\sum}_{n={N}_1+1}^{N_1}{R}_n \) refers to the total throughput that base station directly accesses N − N 1 back channels through Underlay access strategy; \( {\sum}_{n=0}^{N_1}{r}_n \) refers to total throughput that base station accesses N 1 front channels through mixed access strategy. Limiting condition (6–7) can protect channel of master user.

There areN 1 + 1 variables in optimization problem P1, including sensing time of channel τ n and number of sensing channel N 1. For n is continuous variable, and N 1 is discrete variable, P1 is not convex optimization problem, so it is hard to be solved. Convex optimization theory and optimal stopping theory is jointly used in the Thesis to solve the problem.

4 Optimal stopping algorithm

As a branch of optimal control theory of discrete time, optimum stopping theory has obvious advantage on researching sequential statistical decision [3]. In the algorithm, optimal sensing time and number of sensing channel can be obtained through optimum stopping theory. Sensing order of channel is P n 0)descending sequence of idle probability of channel; secondary user follows the order of P n 0)from big to small to sense channel. First, observe sequence and yield sequence should be defined to adopt optimum stopping theory. It is assumed that observe sequence X n represents sensing result of channel n. In case channel is in idle state through sensing, X n  = P 1n ; in case the channel is occupied through sensing, X n  = P 2n . Distribution of X n is expressed with the following equations.

$$ \begin{array}{l}{p}_n= \Pr \left\{{X}_n={P}_{1 n}\right\}\\ {}\kern1.25em ={\mathrm{P}}_n\left({H}_0\right)\left(1-{P}_{f, n}\right)+{\mathrm{P}}_n\left({H}_1\right)\left(1-{P}_{d, n}\right)\end{array} $$
(9)
$$ \begin{array}{l}{p}_n= \Pr \left\{{X}_n={P}_{2 n}\right\}\\ {}\kern1.25em ={\mathrm{P}}_n\left({H}_0\right){P}_{f, n}+{\mathrm{P}}_n\left({H}_1\right){P}_{d, n}\end{array} $$
(10)

It is assumed that \( {C}_n=\frac{T-\sum_{k=1}^n{\uptau}_k}{T},{b}_n\left({X}_1,{X}_2,\cdots, {X}_n\right)=\sum_{k=1}^n{r}_k+\sum_{k= n+1}^n{R}_k \), then yield sequence is:

$$ \begin{array}{l}{y}_n\left({X}_n\right)={y}_n\left({X}_1,{X}_2,\dots, {X}_n\right)\\ {}\kern2.75em ={C}_n{b}_n\left({X}_1,{X}_2,\dots, {X}_n\right)\\ {}\kern2.75em =\frac{T-\sum_{k=1}^n{\uptau}_k}{T}\left(\sum_{k=1}^n{r}_k+\sum_{k= n+1}^n{R}_k\right)\end{array} $$
(11)

Observe sequence X n is limited; according to theory, base station needs to compare effective yield y n (X n ) of channel n and expectation yield E(y n + 1(X n + 1)) of channel n + 1 through sequence.

$$ \begin{array}{l} E\left({y}_{n+1}\left({X}_{n+1}\right)\right)={C}_{n+1}{b}_{n+1}\left({X}_1,{X}_2,\dots, {X}_n,{X}_{n+1}\right)\\ {}={C}_{n+1}\Big({p}_{n+1}{b}_{n+1}\left({X}_1,{X}_2,\dots, {X}_n,{P}_{1\left( n+1\right)}\right)\\ {}+{q}_{n+1}{b}_{n+1}\left({X}_1,{X}_2,\dots, {X}_n,{P}_{2\left( n+1\right)}\right)\\ {}={C}_{n+1}\left({q}_{n+1}\left(\sum_{k=1}^n{r}_k+\sum_{k= n+1}^n{R}_k\right)+{p}_{n+1}\left({H}_0\right){p}_{f,\left( n+1\right)}\right){R}_{01\left( n+1\right)}\\ {}+{p}_{n+1}\left({H}_1\right){p}_{d,\left( n+1\right)}{R}_{11\left( n+1\right)}-{R}_{n+1}\Big)\\ {}+{C}_{n+1}\Big({p}_{n+1}\left(\sum_{k=1}^n{r}_k+\sum_{k= n+1}^n{R}_k\right)+{p}_{n+1}\left({H}_0\right)\left(1-{p}_{f,\left( n+1\right)}\right){R}_{00\left( n+1\right)}\\ {}+{p}_{n+1}\left({H}_1\right)\left(1-{p}_{d,\left( n+1\right)}\right){R}_{10\left( n+1\right)}\Big)\\ {}={C}_{n+1}\left(\left({p}_{n+1}+{q}_{n+1}\right)\left(\sum_{k=1}^n{r}_k+\sum_{k= n+1}^n{R}_k\right)+{r}_{n+1}-{R}_{n+1}\right)\\ {}={C}_{n+1}\left({b}_n\left({X}_1,{X}_2,\dots, {X}_n\right)+{r}_{n+1}-{R}_{n+1}\right)\end{array} $$

In case of meeting the condition y n (X n ) ≥ E(y n + 1(X n + 1)), base station stops to sense on channel n, and N 1 = n, otherwise the base station will continue to sense channel n + 1. For base station, on account of idle probability of known channel, it can be seen that there is relationship between E(y n + 1(X n + 1)) and sensing time τ n + 1 of channel according to expression of E(y n + 1(X n + 1)). Optimal stopping criterion can be expressed as:

$$ {N}_1= \min \left\{0\le n\le N:{y}_n\left({X}_n\right)\ge \underset{\uptau_{\min, n+1}\le {\uptau}_{n+1}\le {\uptau}_{\max, n+1}}{ \max } E\left({y}_{n+1}\left({X}_{n+1}\right)\right)\right\} $$
(12)

In case base station senses the last channel, and n = N, then y n (X n ) ≥ E(y n + 1(X n + 1)). Meanwhile

$$ \begin{array}{l} E\left({y}_{n+1}\left({X}_{n+1}\right)\right)=\left({C}_n+\Delta {C}_{n+1}\right)\left({b}_n\left({X}_1,{X}_2,\dots, {X}_n\right)+\Delta {b}_{n+1}\right)\\ {}\kern5.75em ={y}_n\left({X}_n\right)+{C}_n\Delta {b}_{n+1}\\ {}\kern7.899995em +\Delta {C}_{n+1}{b}_{n+1}\left({X}_1,{X}_2,\dots, {X}_n,{X}_{n+1}\right)\\ {}\kern5.75em ={y}_n\left({X}_n\right)+\Delta {y}_{n+1}\end{array} $$
(13)

In above-mentioned equation,

$$ \Delta {C}_{n+1}=\frac{-{\uptau}_{n+1}}{T},\Delta {b}_{n+1}={r}_{n+1}-{R}_{n+1} $$

Represents difference value between effective yield obtained by sensing channel n of base station and expectation yield which can be obtained by sensing channel n + 1 of base station. It has direct influence on selection of number of sensing channel. According to Eq. (12) and Formula (13), sensing time τ n of channel n can be obtained through optimization problem P2:

$$ P2:\kern0.5em \underset{\uptau_n}{ \max}\Delta {y}_n $$
(14)

Subject to:

$$ {\left({\uptau}_{\min}\right)}_n\le {\uptau}_n\le {\left({\uptau}_{\max}\right)}_n $$
(15)

In above equation, Δy n refers to continuous function on τ n , but it is non-convex function. Numerical calculation method can be selected to solve the optimization problem. For Δy n , first-order derivative on τ n is solved to obtain [11, 12]:

$$ \begin{array}{l}\frac{d\Delta {y}_n}{d{\uptau}_n}=\frac{d\left({C}_{n-1}\Delta {b}_n+\Delta {C}_n{b}_n\left({X}_1,{X}_2,\dots, {X}_n\right)\right)}{d{\uptau}_n}\\ {}\kern2.25em ={C}_{n-1}\frac{d\Delta {b}_n}{d{\uptau}_n}+\frac{d\left(\Delta {C}_n\Delta {b}_n\right)}{d{\uptau}_n}\\ {}\kern4.399998em +{b}_{n-1}\left({X}_1,{X}_2,\dots, {X}_{n-1}\right)\frac{d\Delta {C}_n}{d{\uptau}_n}\\ {}\kern2.25em =\frac{-1}{T}\left({b}_{n-1}\left({X}_1,{X}_2,\dots, {X}_{n-1}\right)+\Delta {b}_n\right)\\ {}\kern5.099998em +\left({C}_{n-1}+\Delta {C}_n\right)\frac{d\Delta {b}_n}{d{\uptau}_n}\end{array} $$
(16)

In above equation,

$$ \begin{array}{l}\frac{ d\varDelta {b}_n}{d{\tau}_n}=\frac{{ d P}_{f, n}}{d{\tau}_n}{P}_n\left({H}_0\right){R}_{00 n}-\frac{{ d P}_{d, n}}{d{\tau}_n}{P}_n\left({H}_1\right){R}_{10 n}+\frac{{ d P}_{f, n}}{d{\tau}_n}{P}_n\left({H}_0\right){R}_{01 n}\\ {}\kern0.75em +\frac{{ d P}_{d, n}}{d{\tau}_n}{P}_n\left({H}_1\right){R}_{11 n}=\frac{{ d P}_{f, n}}{d{\tau}_n}{P}_n\left({H}_0\right)\left(-{R}_{00 n}+{R}_{01 n}\right)+\frac{{ d P}_{d, n}}{d{\tau}_n}{P}_n\left({H}_1\right)\left(-{R}_{10 n}+{R}_{11 n}\right)\end{array} $$
(17)

Make \( \frac{d\Delta {y}_n}{d{\uptau}_n}=0 \) to obtain sensing time \( {\uptau}_n^{\ast } \) and corresponding \( \Delta {y}_n\left({\uptau}_n^{\ast}\right) \). In addition, Δy n min , n ) and Δy n max , n ) should be calculated respectively. Compare the both equations with \( \Delta {y}_n\left({\uptau}_n^{\ast}\right) \) on this basis, then corresponding sensing time of the maximum value is solution of problem P2.

In case sensing time of all selected channels conforms to optimization problem P2,

$$ \begin{array}{l}\mathrm{E}\left({y}_{n+1}\left({X}_{n+1}\right)\right)={y}_{n+1}\left({X}_{n+1}\right)\\ {}\kern1.5em ={y}_0\left({X}_0\right)+\sum_{k=1}^{n+1}\Delta {y}_k=\sum_{k=1}^N{R}_k+\sum_{k=1}^{n+1}\Delta {y}_k\end{array} $$
(18)

Theorem 1: when base station detects channel as per descending sequence of idle probability of channel, in case optimal stopping criterion is shown in Formula (12), then optimal number of sensing channel N 1 exists and is the only one.

Prove: for number of channel is limited, (n ≤ N), optimal number of sensing channel N 1 must exist. Next, it needs to be proved that when base station detects channel in descending sequence of P n (H 0), N 1 is the only one. For channel n + 1, partial derivative onP n + 1(H 0)is solved forΔy n + 1 to obtain [19]:

$$ \begin{array}{l}\frac{\partial \left(\Delta {y}_n\right)}{\partial {P}_{n+1}\left({H}_0\right)}=\frac{\partial \left({C}_n\Delta {b}_{n-1}+\Delta {C}_{n+1}{b}_{n+1}\left({X}_1,{X}_2,\dots, {X}_n,{X}_{n+1}\right)\right)}{\partial {P}_{n+1}\left({H}_0\right)}\\ {}\kern1.5em =\frac{\partial \left({C}_n\Delta {b}_{n+1}+\Delta {C}_{n+1}\left({b}_{n+1}\left({X}_1,{X}_2,\dots, {X}_n,{X}_{n+1}\right)+\Delta {b}_{n+1}\right)\right)}{\partial {P}_{n+1}\left({H}_0\right)}\\ {}\kern1.5em =\left({C}_n+\Delta {C}_{n+1}\right)\frac{\partial \left(\Delta {b}_{n+1}\right)}{\partial {P}_{n+1}\left({H}_0\right)}\end{array} $$
(19)

It can be obtained from the expression:

$$ \begin{array}{l}\frac{\partial \left(\Delta {b}_{n+1}\right)}{\partial {P}_{n+1}\left({H}_0\right)}=\left(1-{P}_{f, n+1}\right)\left({R}_{00\left( n+1\right)}-{R}_{01\left( n+1\right)}\right)\\ {}\kern3.799999em -\left(1-{P}_{d, n+1}\right)\left({R}_{10\left( n+1\right)}-{R}_{11\left( n+1\right)}\right)\end{array} $$
(20)

For P f , n + 1 < P d , n + 1, then 1 − P f , n + 1 > 1 − P d , n + 1; compare R 00(n + 1) − R 01(n + 1) and R 10(n + 1) − R 11(n + 1), It can be obtained from the Formula (21): \( \frac{\partial \left(\Delta {b}_{n+1}\right)}{\partial {P}_{n+1}\left({H}_0\right)}>0 \)\( \frac{\partial \left(\Delta {y}_{n+1}\right)}{\partial {P}_{n+1}\left({H}_0\right)}>0 \)\( \frac{\partial \left(\Delta {b}_{n+1}\right)}{\partial {P}_{n+1}\left({H}_0\right)}>0 \) and \( \frac{\partial \left(\Delta {y}_{n+1}\right)}{\partial {P}_{n+1}\left({H}_0\right)}>0 \).

It shows that Δy n + 1 is monotone increasing function relative to P n + 1(H 0), and will decrease with the increase of n. According to requirements of optimal stopping criterion, base station will stop to sense in channel N 1, and then sensing yield \( {y}_{N_1}\left({X}_{N_1}\right) \) reaches the maximum value. With this, it can be seen from Formula (18) and references [3] that optimal number of sensing channel N 1 exists and is the only one.

$$ \begin{array}{l}{R}_{00\left( n+1\right)}-{R}_{01\left( n+1\right)}-\left({R}_{10\left( n+1\right)}-{R}_{11\left( n+1\right)}\right)\\ {}= B\left({ \log}_2\left(1+\frac{P_{1\left( n+1\right)}{h}_{ss\left( n+1\right)}}{N_0}\right)-{ \log}_2\left(1+\frac{P_{2\left( n+1\right)}{h}_{ss\left( n+1\right)}}{N_0}\right)\right)\\ {}- B\left({ \log}_2\left(1+\frac{P_{1\left( n+1\right)}{h}_{ss\left( n+1\right)}}{P_{p\left( n+1\right)}{h}_{p s\left( n+1\right)}+{N}_0}\right)-{ \log}_2\left(1+\frac{P_{2\left( n+1\right)}{h}_{ss\left( n+1\right)}}{P_{p\left( n+1\right)}{h}_{p s\left( n+1\right)}+{N}_0}\right)\right)\\ {}= B{ \log}_2\left(\frac{N_0+{P}_{1\left( n+1\right)}{h}_{ss\left( n+1\right)}}{N_0+{P}_{2\left( n+1\right)}{h}_{ss\left( n+1\right)}}\right)- B{ \log}_2\left(\frac{P_{p\left( n+1\right)}{h}_{p s\left( n+1\right)}+{N}_0+{P}_{1\left( n+1\right)}{h}_{ss\left( n+1\right)}}{P_{p\left( n+1\right)}{h}_{p s\left( n+1\right)}+{N}_0+{P}_{2\left( n+1\right)}{h}_{ss\left( n+1\right)}}\right)\\ {}= B{ \log}_2\left(\frac{\left({N}_0+{P}_{1\left( n+1\right)}{h}_{ss\left( n+1\right)}\right)\left({P}_{p\left( n+1\right)}{h}_{p s\left( n+1\right)}+{N}_0+{P}_{2\left( n+1\right)}{h}_{ss\left( n+1\right)}\right)}{\left({N}_0+{P}_{2\left( n+1\right)}{h}_{ss\left( n+1\right)}\right)\left({P}_{p\left( n+1\right)}{h}_{p s\left( n+1\right)}+{N}_0+{P}_{1\left( n+1\right)}{h}_{ss\left( n+1\right)}\right)}\right)\\ {}= B{ \log}_2\left(\frac{\left({N}_0+{P}_{1\left( n+1\right)}{h}_{ss\left( n+1\right)}\right)\left({N}_0+{P}_{2\left( n+1\right)}{h}_{ss\left( n+1\right)}\right)+{P}_{p\left( n+1\right)}{h}_{p s\left( n+1\right)}\left({N}_0+{P}_{1\left( n+1\right)}{h}_{ss\left( n+1\right)}\right)}{\left({N}_0+{P}_{2\left( n+1\right)}{h}_{ss\left( n+1\right)}\right)\left({N}_0+{P}_{1\left( n+1\right)}{h}_{ss\left( n+1\right)}\right)+{P}_{p\left( n+1\right)}{h}_{p s\left( n+1\right)}\left({N}_0+{P}_{2\left( n+1\right)}{h}_{ss\left( n+1\right)}\right)}\right)\\ {}>0\end{array} $$
(21)

We can obtain solving steps of optimization problem P1 from Theorem 1: first, arrange channel as per decreasing sequence of idle probability to calculate sensing time of channel respectively, and then calculate yield of channel and sense expectation yield of next channel to judge and choose optimal number of sensing channel, so as to consider whether it is necessary to stop channel sensing. Once optimal stopping criterion is satisfied, the optimal number of sensing channel N 1 and corresponding sensing time \( {\uptau}_1{,\uptau}_2,\ldots {,\uptau}_{N_1} \) are obtained. For secondary user system, base station does not need to sense all channels with existence of optimal number of sensing channel. Therefore, total sensing delay is reduced to a certain extent, which effectively reduces makes calculated amount required for the whole sensing system.

5 Numerical simulation and analysis

Next, numerical simulation will be carried out by using matlab simulation tool for algorithm proposed in the Thesis. For simplicity, access strategy designed in the Thesis, namely optimal stopping algorithm for solving P1 is recorded as (OWN). The algorithm is compared with HC-MAC [14] algorithm.

For simulation parameter, capacitable interference threshold of master user is set as P d , th  = 0.9,P f , th  = 0.9. To calculate scope of sensing time of channel, maximum decision probabilityP d , max = 0.99; minimum false alarm probability P f , min = 0.01. If there is no special instructions, difference value of idle probability among channels is 0.1; total number of channel of master user is 10; idle probability of channel n is P n (H 0) = 0.9 − 0.1(n − 1), n ∈ {1, 2,  ⋯ , 10}. Table 1 shows value of channel gain h ssn and h psn ; Table 2 shows other simulation parameters.

Table 1 Channel gain
Table 2 Other simulation parameters

Fig. 3 provides values of y n (X n ) and E(y n + 1(X n + 1))in different channel. It can be seen from figures and tables that base station will stop to sense at the sixth channel, hence when it reaches the sixth channel, y n (X n ) > E(y n + 1(X n + 1)). Sensing time of each channel under algorithm of OWN and HC-MAC is shown in Fig.4. In OWN algorithm, sensing time of channel is diminished from the first channel to the fourth channel, and keeps the minimum value (τ min) n from the fifth channel to the sixth channel, (τ min) n  = 1.6ms. It is because optimal sensing time for solving is less than (τ min) n . Sensing time becomes 0 from the seventh sensing channel. In HC-MAC algorithm, secondary user needs to make accurate decision for each channel, and sensing time of each channel is the maximum sensing time τ max , n ,τ max , n  = 5.02ms. According to optimal stopping criterion, sensing is stopped in the third channel, which causes transmission time cannot reach optimal value. In addition, it can be seen from Fig. 4 that sensing time distributed to channel will increase with increase of idle probability under the same conditions of Signal to Noise Ratioγ n and decision threshold value ε n , and sensing time will gradually reduce with increase of number of channel n. The conclusion is the same with research result of literature [9, 16, 17].

Fig. 3
figure 3

Value of y n (X n ) and E(y n + 1(X n + 1)) in different stopping channel

Fig. 4
figure 4

Sensing time of each channel

Comparison of throughput of channel in different idle probability P n (H 0) is shown in Fig. 5. It can be seen from trend of figure that total throughput in OWN algorithm is larger than that in HC-MAC algorithm. It is because sensing time and optimal number of sensing channel are optimized in OWN. Even though idle probability of channel is the same, not all channels can be sensed. It is because total number of channel is large enough to reduce sensing time. In HC-MAC algorithm, base station uses maximum sensing time to detect channel, and accessing channel through Overlay pattern affects transmission and rate to some extent.

Fig. 5
figure 5

Comparison of throughput in different idle probability P n (H 0)

Fig. 6 shows throughput in different transmission power ratio P 1/P 2. P 2 is fixed in simulation, and P 2 = 1W. It can be seen from the Figure that performance of OWN is better than that of HC-MAC. In OWN algorithm, if P 1/P 2 increases, chance for base station choosing sensing channel is more. Base station can freely choose number of sensing access channel and power of access channel. Similarly, channel accesses delay (total sensing time of selected sensing channel is access delay [13] of channel) in different transmission ratio P 1/P 2 is shown in Fig. 7. If P 1/P 2 is changed, then access delay of a section of channel is not changed, which is caused by total number of sensing channel and total sensing time required for detecting channel not changed.

Fig. 6
figure 6

Comparison of throughput in different P 1/P 2

Fig. 7
figure 7

Comparison of channel access delay of throughput in different P 1/P 2

6 Conclusion

Spectrum access algorithm of cognitive wireless network proposed in the Thesis fully absorbs advantages of mixed access and Underlay access, and optimizes total number of sensing channel and sensing time of each channel, which makes throughput of system maximize. Through optimal stopping theory, it is proved that not all channels need to be sensed. In case idle probability of channel is small or number of channel of master user is large, only certain channels are selected to be sensed, namely the best system performance can be obtained. At last, result of experiment simulation further verifies effectiveness of algorithms proposed in the Thesis; secondary user system can obtain more traversal throughput in universal access.