SNR-Adaptive Optimal Threshold Design for Energy Detection in Dynamic Spectrum Access Sushila Dhaka∗ , Jane-Hwa Huang† , Chih-Min Yu‡ , Li-Chun Wang∗§ ∗ Department of Electrical and Computer Engineering, National Yang Ming Chiao Tung University, Hsinchu, Taiwan † Department of Electrical Engineering, National Chi Nan University, Nantou County, Taiwan ‡ Department of Information and Computer Engineering, Chung Yuan Christian University, Taoyuan, Taiwan
arXiv:2607.00754v1 [cs.NI] 1 Jul 2026
Emails: [email protected], [email protected], [email protected] § Corresponding author: [email protected]
Abstract—This paper proposes an SNR-adaptive optimal threshold design framework for energy detection in Dynamic Spectrum Access (DSA). Unlike conventional constant falsealarm rate (CFAR)-based schemes that determine the sensing threshold solely from a predefined false-alarm constraint, the proposed method directly minimizes the total probability of error by deriving a closed-form analytical solution. The threshold optimization problem is formulated as a quadratic expression whose coefficients explicitly characterize the effects of signal-tonoise ratio (SNR) and number of samples. This analytical structure enables adaptive threshold selection under heterogeneous SNR conditions without exhaustive numerical search. Simulation results demonstrate that the proposed approach reduces the error probability compared with fixed-threshold and detectionconstrained schemes, particularly in low-SNR regimes. Furthermore, the impact of SNR and number of samples on detection performance is systematically analyzed, providing deeper insight into the trade-off between false alarm and missed detection. The proposed framework improves sensing reliability and practical adaptability in dynamic spectrum access systems. It also establishes a foundation for secure cooperative spectrum sensing, including blockchain-assisted aggregation mechanisms. Index Terms—Energy Detection, Dynamic Spectrum Access, SNR-Adaptive Threshold, Bayesian Error Minimization
I. I NTRODUCTION The rapid proliferation of wireless devices and bandwidthintensive applications has led to a substantial increase in spectrum demand, even though many licensed frequency bands remain underutilized [1]. Dynamic Spectrum Access (DSA) has therefore gained considerable attention as a means to improve spectrum efficiency by allowing secondary users (SUs) to opportunistically access licensed bands while ensuring adequate protection for primary users (PUs) [2]. At the core of DSA lies reliable spectrum sensing. Sensing inaccuracies may either cause harmful interference to PUs or unnecessarily restrict spectrum access for SUs [3]. Among various sensing techniques, energy detection (ED) is widely adopted due to its low implementation complexity and its independence from prior knowledge of the PU signal structure [4]. Despite these advantages, the performance of ED is highly sensitive to the selection of the local decision threshold, which directly controls the trade-off between false alarms and missed detections [5]. In conventional ED-based spectrum sensing [6], the decision threshold is typically determined using the constant false
alarm rate (CFAR) criterion [7], where a predefined false alarm probability is maintained under the null hypothesis H0 . Although CFAR-based approaches are simple and analytically convenient [8], they implicitly emphasize false alarm control rather than overall sensing reliability. In practical DSA environments, PU activity is often asymmetric and time-varying, resulting in unequal prior probabilities of H0 and H1 . In addition, cooperative spectrum sensing involves spatially distributed SUs that experience heterogeneous SNR conditions. Under such scenarios, a fixed threshold designed solely to satisfy a false alarm constraint may not achieve optimal performance, particularly in low-SNR regimes where missed detections become more significant. With an increase in SNR, the separation between H0 and H1 increases. H1 shifts right with an increase in SNR. The difference between H0 and H1 depends on the local threshold value along with the SNR. The separation between H0 and H1 confirms the detection. However, detection performance is not governed by SNR alone; it also depends critically on the selected threshold. A threshold that is overly conservative may suppress false alarms but increase missed detections, whereas a lower threshold may improve detection at the expense of higher false alarms. Consequently, minimizing the total probability of error provides a more balanced and practically meaningful performance criterion than relying solely on CFAR-based design. While considerable research has addressed threshold design in ED-based sensing, direct minimization of the total probability of error under heterogeneous SNR conditions has received comparatively less attention. Moreover, in cooperative DSA systems, accurate local decisions alone are insufficient. Malicious or unreliable SUs may falsify sensing reports, leading to incorrect global decisions and degraded spectrum utilization [4]. Ensuring secure and trustworthy aggregation of sensing outcomes is therefore equally important [5]. Blockchain technology offers a decentralized and tamper-resistant infrastructure capable of enhancing transparency [9] and accountability in distributed wireless environments [10]. By securely recording sensing reports and incorporating reputation-aware mechanisms, blockchain can discourage malicious behavior and promote reliable participation among SUs. Several prior works have investigated threshold selection
strategies for energy detection under CFAR constraints and Bayesian formulations [7], [8]. Existing approaches primarily focus on controlling Pf or optimizing detection performance under fixed statistical assumptions. While numerical optimization and grid-based search methods can efficiently determine near-optimal thresholds with modern computational resources, these approaches generally do not yield explicit closed-form expressions for the total probability of error. Consequently, they provide limited analytical insight into the dependence of the optimal threshold on key system parameters, such as the signal-to-noise ratio (SNR) and the number of samples K. This limitation motivates the development of a closed-form formulation that facilitates deeper theoretical understanding of threshold behavior and system performance. In contrast, this work derives a closed-form expression for Pe and reformulates the threshold optimization problem into a quadratic structure whose coefficients and roots explicitly characterize the optimal operating point. This analytical formulation provides deeper insight into threshold adaptation across heterogeneous SNR regimes while avoiding exhaustive numerical search. Such explicit analytical characterization facilitates lowcomplexity implementation [11] and provides theoretical insight that is not readily available in purely numerical optimization frameworks. Motivated by these considerations, this paper proposed an analytical framework for minimizing the probability of error (Pe ) through adaptive threshold selection in local spectrum sensing. A closed-form expression of the error function is derived, and the corresponding optimal threshold is obtained by solving the resulting quadratic formulation. The proposed framework is further extended toward secure cooperative operation through blockchain-assisted validation. Together, these contributions aim to improve sensing reliability while strengthening trust in dynamic spectrum access systems. The main contributions of this paper are summarized as follows: Closed-form error minimization: We directly minimize the Bayesian probability of error for energy detection and derive a closed-form quadratic expression for the optimal threshold, providing analytical insight into its dependence on system parameters. • Characterization of adaptive thresholds for SNR: The analytical formulation reveals the structural relationship among SNR, the number of samples, and the optimal threshold, allowing the selection of adaptive thresholds under heterogeneous conditions. • Performance and trade-off analysis: We systematically analyze the impact of SNR and the number of samples on detection performance and demonstrate a consistent reduction in error probability compared with conventional CFAR-based and fixed-threshold schemes. • Low-complexity implementation: The closed-form solution enables real-time threshold computation with minimal computational overhead for practical DSA systems. •
The rest of this paper is organized as follows. Section 2 describes the system model. Section 3 presents the proposed optimal error-probability formulation. Section 4 provides the simulation results and corresponding analysis. Finally, Section 5 concludes the paper and outlines future research directions. II. S YSTEM MODEL In Cognitive Radio Network (CRN), Secondary Users (SUs) opportunistically access underutilized licensed spectrum bands owned by a Primary User (PU). Each SU performs energy detection [12] to sense the presence or absence of the PU. If a channel is available (i.e., no PU activity), SUs can use it for transmission. PUs have priority in using the spectrum, and their presence must be detected accurately by SUs to avoid interference.
SBS aggregates local decisions and makes a global decision
SUs send sensing report to the SBS d3
d2
d1 Malicious User (MU) Secondary User (SU)
d..
Secondary User (SU) Sensing Sensing
Malicious User (MU)
di
Sensing Secondary Sensing User (SU)
Sensing Primary User (PU)
Fig. 1. System model for dynamic spectrum access.
The integrity of spectrum sensing is susceptible to disruption by unreliable or malicious secondary users (MU). These SUs can submit false reports, leading to incorrect spectrum access decisions and potential interference with the PU. This presents challenges in maintaining the correct spectrum status. To address these challenges, we propose an optimal probability of error. A. Energy Detection Method for PU Detection The energy detector measures the received signal energy at the ith secondary user (SUi ) and compares it with a decision threshold to determine the presence (H1 ) or absence (H0 ) of the primary user (PU). The received signal model is given by ( H0 : yi (t) = w(t), (1) H1 : yi (t) = hi s(t) + w(t), where w(t) denotes additive white Gaussian noise (AWGN), s(t) is the transmitted PU signal, and hi is the channel gain of SUi . The energy collected over a sensing interval of 2K samples is defined as
εi =
2K X
III. P ROPOSED O PTIMAL P ROBABILITY OF E RROR |yi (t)|2 .
(2)
t=1
For analytical tractability, the normalized energy statistic is defined as Ei =
2K 2 X yi (t) t=1
σ
λi,opt = arg min Pe,i (λi ). λi
,
(3)
where σ 2 is the noise variance. Since Ei is the sum of 2K independent squared Gaussian random variables, it follows a chi-square distribution. For sufficiently large K, the distribution of Ei can be accurately approximated as Gaussian using the central limit theorem (CLT). Thus, ( 2 H0 : Ei ∼ N (µi0 , σi0 ), (4) 2 H1 : Ei ∼ N (µi1 , σi1 ). Under H0 , only noise is present, yielding µi0 = 2K,
2 σi0 = 4K.
Under H1 , the received signal contains both PU signal and noise. Assuming the PU signal is independent of the noise and defining the received SNR as γi , the mean and variance become µi1 = 2K(γi + 1),
For a given SUi , the objective is to determine the optimal threshold
From (8), the probability of error at SUi is given by Pe,i (λi ) = (1 − α)Pf,i (λi ) + α 1 − Pd,i (λi ) , where Pd,i (λi ) and Pf,i (λi ) are defined in (6) and (7), respectively. Let xi0 ≜
Here, di = 1 indicates that the PU is present (H1 ), while di = 0 indicates absence (H0 ). The probability of detection and probability of false alarm at SUi are given by λi − µi1 Pd,i = P (di = 1 | H1 ) = Q , (6) σi1 λi − µi0 Pf,i = P (di = 1 | H0 ) = Q , (7) σi0 where Q(·) denotes the tail probability of the standard normal distribution. The Bayesian probability of error is formulated as a linear combination of the false alarm probability and the missdetection probability [13]: Pe,i = (1 − α)Pf,i + α(1 − Pd,i ).
xi1 ≜
λi − µi1 . σi1
The standard normal probability density function (PDF) and the Q-function are 2 1 ϕ(x) = √ e−x /2 , 2π Taking derivatives, we use
Z ∞ Q(x) =
ϕ(t) dt. x
dQ(x) = −ϕ(x). dx Applying the chain rule yields
2 σi1 = 4K(2γi + 1).
The local decision is obtained by comparing Ei with a threshold λi : ( 1, Ei ≥ λi , di = (5) 0, otherwise.
λi − µi0 , σi0
d Q(xik (λi )) dxik = −ϕ(xik ) , dλi dλi
(9)
(10)
with dxi0 1 = , dλi σi0
dxi1 1 = . dλi σi1
Differentiating Pe,i (λi ) with respect to λi gives 1 1 dPe,i = (1 − α) − ϕ(xi0 ) + α ϕ(xi1 ) . dλi σi0 σi1 Setting
(11)
dPe,i dλi = 0 yields
α 1−α ϕ(xi1 ) = ϕ(xi0 ). σi1 σi0
(12)
Substituting the value of ϕ(x) into (12) gives 2 2 α x 1−α x exp − i1 = exp − i0 . σi1 2 σi0 2
(13)
Taking the natural logarithm of both sides and substituting xi0 and xi1 yields
(8)
where α is the prior probability that the primary user (PU) is present. The optimal threshold λi is obtained by minimizing Pe,i .
(λi − µi1 )2 (λi − µi0 )2 ασi0 − = 2 ln . 2 2 σi1 σi0 (1 − α)σi1 Simplifying (14) leads to the quadratic equation
(14)
Thresholds vs SNR (K=300) 2 2 2 2 (σi0 − σi1 )λ2i + 2(µi0 σi1 − µi1 σi0 )λi
d f opt
2500
Rewrite (15) in quadratic form as Ai λ2i + Bi λi + Ci = 0,
(16)
2250 2000 Threshold ( )
(1 − α)σi1 2 2 2 2 + (µ2i1 σi0 − µ2i0 σi1 ) + 2σi0 σi1 ln = 0. ασi0 (15)
1750 1500 1250 1000
where
750
2 2 Ai = σi0 − σi1 , 2 2 Bi = 2(µi0 σi1 − µi1 σi0 ),
10
2 2 2 2 Ci = µ2i1 σi0 − µ2i0 σi1 + 2σi0 σi1 ln
(1 − α)σi1 ασi0
8
6
4
2 0 SNR (dB)
2
4
6
. Fig. 2. Comparative analysis of SNR Vs decision threshold techniques.
2 2 Using µi0 = 2K, σi0 = 4K, µi1 = 2K(γi + 1), and σi1 =
4K(2γi + 1), the coefficients reduce to
Error Probability vs SNR (K=300)
102 10 5
Bi = 16K 2 γi ,
Ci = 16K 3 γi2 + 32K 2 (2γi + 1) ln
1 − αp 2γi + 1 . α
The discriminant ∆i = Bi2 − 4Ai Ci
(17)
Probability of Error (Pe)
Ai = −8Kγi ,
10 12 10 19 10 26 10 33 10 40 10 47
Pe ( f ) Pe ( d ) Pe( opt)
10 54
simplifies to i h 1−α ∆i = 256K 3 γi (2γi +1) Kγi +4 ln +2 ln(2γi +1) . α Thus, the two candidate roots are √ √ −Bi ± ∆i ∆i λi,1,2 = =K∓ . 2Ai 16Kγi Since
8
6
4
2 0 SNR (dB)
2
4
6
Fig. 3. Error probability performance comparison under different threshold selection strategies.
(18)
√
λi,1 = K −
10
∆i 16Kγi
is much less than µi0 = 2K, the false alarm probability at λi,1 will approach one, i.e. Pf,i (λi,1 ) ≈ 1, which is not a meaningful operating point. Therefore, the optimal threshold is chosen as √ ∆i λi,opt = K + . (19) 16Kγi IV. R ESULTS AND D ISCUSSION All simulations were conducted using the Python software environment. The local decision threshold is a key parameter in the performance of the PU detection. A commonly adopted approach is the fixed Pf (CFAR) technique, in which the threshold is chosen to satisfy a predefined false alarm probability and remains constant across SNR values. In contrast,
the proposed analytical threshold λopt is derived by minimizing the Bayesian error probability and is explicitly adapted to the SNR of each SU. Fig 2 illustrates the threshold variation versus SNR. The fixed CFAR threshold λf is constant and does not adapt to channel conditions. In contrast, λd and the proposed λopt vary with SNR. At low SNR, strong overlap between H0 and H1 requires a lower threshold, so both lie below λf . As SNR increases, the thresholds rise to suppress false alarms. The proposed λopt minimizes the total error probability by optimally balancing missed detections and false alarms. Fig 3 shows the error probability Pe versus SNR for λf , λd , and the proposed λopt . The curve corresponding to Pe (λf ) appears nearly linear and remains essentially independent of SNR. For the detection-constrained threshold λd , Pe varies only slightly because the imposed detection constraint effectively stabilizes the Q-function argument despite increases in mean and variance. In contrast, Pe (λopt ) decreases rapidly with SNR, demonstrating that the proposed adaptive threshold achieves superior error minimization, particularly in medium
Error Probability vs K for different SNRs
Threshold vs K for different SNRs SNR=-10 dB SNR=-8 dB SNR=-6 dB SNR=-4 dB SNR=-2 dB SNR=0 dB SNR=2 dB SNR=4 dB
20000
10 19
10 127
SNR=-10 dB SNR=-8 dB SNR=-6 dB SNR=-4 dB SNR=-2 dB SNR=0 dB SNR=2 dB SNR=4 dB
10 163 10 199 10 235 10 271 101
Threshold ( )
15000
10 91
10000 5000 0
102 103 K (Number of samples)
Fig. 4. Error probability versus number of samples K for different SNR levels.
and high-SNR regions. Fig 4 illustrates the effect of the number of samples K on the error probability Pe for different SNR levels. Since the test statistic is formed by summing 2K samples, performance depends jointly on both SNR and the integration length K. The variation of Pe is therefore strongly influenced by these two parameters. For small values of K, Pe remains relatively high due to significant noise influence. As K increases, averaging over a larger number of samples reduces noise fluctuations and enhances detection reliability, resulting in a decrease in Pe . At low SNR, this reduction is gradual because stronger noise dominance requires longer integration to achieve meaningful separation between H0 and H1 . In contrast, at high SNR, Pe decreases rapidly even for moderate values of K, since the stronger signal enables reliable detection with shorter integration lengths. This produces a steeper slope and faster decay in the high-SNR curves compared to the low-SNR cases. Overall, the relationship among Pe , SNR, and K reflects the fundamental trade-off in energy detection: increasing K mitigates noise effects through averaging, while higher SNR inherently improves hypothesis separability, leading to the observed trends. Fig 5 shows the variation of the optimal threshold λopt with respect to the number of samples K for different SNR levels. At low SNR, the system operates in a noise-limited regime where the distributions under H0 and H1 significantly overlap. In this case, the false alarm constraint dominates, and λopt remains close to the fixed CFAR threshold λf . As SNR increases, the separation between the means under H0 and H1 grows proportionally with γ, while the variance scales with K. Consequently, λopt gradually shifts toward the detectionconstrained threshold λd , reflecting the trade-off between minimizing Pf and maximizing Pd . At high SNR, the hypotheses become well separated, and the optimal decision boundary approaches λd , where the error probability is minimized. Increasing K further enhances statistical averaging, amplifying
101
102 103 K (Number of samples)
Fig. 5. Optimal threshold λopt versus number of samples K for different SNR levels.
Pe ( )
100 10 1 10 2 Pe
Pe (log scale)
10 55
10 3 10 4 SNR=-10 dB SNR=-5 dB SNR=0 dB SNR=5 dB
10 5 10 6
0
50
100
150
200 250 Threshold ( )
300
350
400
Fig. 6. Error probability Pe versus decision threshold for different SNR levels.
this separation and resulting in the observed growth of λopt with K. This behavior confirms the transition from noiselimited to signal-limited operation as SNR increases. Fig 6 presents the error probability Pe (λ) as a function of the decision threshold for different SNR levels. The vertical dotted lines indicate the analytically derived optimal thresholds λopt . At low SNR, the error surface exhibits a broad minimum, and small visual deviations between the sampled minimum and the analytical threshold may appear due to numerical resolution. As SNR increases, the curvature around the minimum becomes steeper, and the analytical λopt aligns precisely with the minimum of the error curve. The increasing sharpness of the minima confirms improved hypothesis separability and validates the correctness of the closed-form threshold expression. V. C ONCLUSION This paper presented a closed-form SNR-adaptive optimal threshold design framework for energy detection in dynamic
spectrum access systems. By directly minimizing the Bayesian probability of error, the threshold optimization problem was reformulated into a quadratic expression, yielding an explicit analytical solution. Unlike conventional CFAR-based approaches that rely on predefined false alarm constraints, the proposed framework revealed the structural relationship among SNR, number of samples, and the optimal decision threshold. The analytical formulation provided deeper insight into the trade-off between false alarm and missed detection probabilities across heterogeneous sensing conditions. Simulation results demonstrated consistent reduction in total error probability compared with fixed-threshold and CFARbased schemes, particularly in low-SNR regimes. Owing to its closed-form structure and low computational complexity, the proposed method was well suited for practical and realtime dynamic spectrum access implementations. The proposed SNR-adaptive thresholding framework is particularly relevant for AI-driven and vehicular communication scenarios, where rapidly varying channel conditions and stringent latency constraints require analytically tractable and adaptive sensing mechanisms. Future work will extend the proposed framework to cooperative spectrum sensing scenarios, where distributed users jointly optimize sensing thresholds under heterogeneous SNR conditions. In addition, integration with adaptive resource allocation and secure spectrum sharing mechanisms will be investigated to enhance robustness in large-scale and dynamic wireless environments. In particular, blockchain-enabled aggregation and validation mechanisms will be explored to ensure integrity, transparency, and trust in dynamic spectrum access networks. ACKNOWLEDGMENT This work has been partially funded by the National Science and Technology Council under the NSTC 114-2221-E-A49185-MY3, Grant, and NSTC 114-2221-E-033-026. This work was supported by the Higher Education Sprout Project of the National Yang Ming Chiao Tung University and the Ministry of Education (MOE), Taiwan. R EFERENCES [1] M. Matinmikko-Blue, S. Yrjölä, and P. Ahokangas, “Spectrum access options for local 6g networks,” Intelligent Spectrum Management: Towards 6G, pp. 27–53, 2025. [2] M. Jiang, Y. Li, Q. Zhang, G. Zhang, and J. Qin, “Decentralized blockchain-based dynamic spectrum acquisition for wireless downlink communications,” IEEE Transactions on Signal Processing, vol. 69, pp. 986–997, 2021. [3] F. Zhou, C. Liu, H. Zhang, W. Wu, Q. Wu, T. Q. Quek, and C.B. Chae, “Spectrumfm: A foundation model for intelligent spectrum management,” IEEE Journal on Selected Areas in Communications, 2025. [4] A. A. Okon, O. S. Sholiyi, J. M. H. Elmirghani, and K. Munasighe, Blockchain for Spectrum Management in 6G Networks, 2022, pp. 137– 159. [5] S. Rajendar, U. Thangavel, S. Devendran, V. Selvi, and S. S. Muthumanickam, “Blockchain for securing autonomous vehicles,” in 2023 Second International Conference on Electronics and Renewable Systems (ICEARS), 2023, pp. 713–717. [6] H. Urkowitz, “Energy detection of unknown deterministic signals,” Proceedings of the IEEE, vol. 55, no. 4, pp. 523–531, 2005.
[7] D. Kun and N. A. Morgan, “A new low-cost cfar detector for spectrum sensing with cognitive radio systems,” in 2009 IEEE Aerospace conference. IEEE, 2009, pp. 1–8. [8] S. Wang, Y. Wang, J. P. Coon, and A. Doufexi, “Energy-efficient spectrum sensing and access for cognitive radio networks,” IEEE transactions on vehicular technology, vol. 61, no. 2, pp. 906–912, 2011. [9] S. Dhaka, Y.-J. Chen, S. De, and L.-C. Wang, “A lightweight stochastic blockchain for iot data integrity in wireless channels,” IEEE Open Journal of Vehicular Technology, pp. 1–17, 2023. [10] Y. Yang, L. Shi, Z. Wang, J. Li, T. Wang, J. Wang, and B. Ji, “Spectrumbc: A blockchain-aided cooperative spectrum sensing framework,” IEEE Transactions on Cognitive Communications and Networking, vol. 11, no. 6, pp. 3926–3938, 2025. [11] Y. Zeng and Y.-C. Liang, “Spectrum sensing algorithms for cognitive radio based on statistical covariance,” IEEE Communications Surveys & Tutorials, vol. 15, no. 1, pp. 361–378, 2010. [12] L. Perera, P. Ranaweera, S. Kusaladharma, S. Wang, and M. Liyanage, “A survey on blockchain for dynamic spectrum sharing,” IEEE Open Journal of the Communications Society, vol. 5, pp. 1753–1802, 2024. [13] C. Vlădeanu, O. M. K. Al-Dulaimi, A. Marţian, and D. C. Popescu, “Average energy detection with adaptive threshold for spectrum sensing in cognitive radio systems,” IEEE Transactions on Vehicular Technology, vol. 73, no. 11, pp. 17 222–17 230, 2024.