Enhanced Signal Area Estimation Based on Edge Detection and Flood Fill

Spectrograms are a common form of time-frequency representation of wireless communication signals. In many practical scenarios spectrograms need to be processed to identify accurately the time-frequency region occupied by each individual radio transmission, which in this work is referred to as Signal Area (SA). Several methods have been proposed in the literature for Signal Area Estimation (SAE), however their performance degrades significantly in the low SNR regime. In this context, this work proposes a novel approach for SAE based on the use of two well-known techniques from the field of image processing, namely edge detection and flood fill. Edge detection is first employed to identify the edges of potential SAs and flood fill is then used to fill the area inside the estimated edges in order to produce a more accurate estimation of the SAs present in a spectrogram. The performance of three popular edge detection methods (gradient magnitude, Laplacian of Gaussian and Canny) is assessed both with simulations and experimental data. The obtained results show that the proposed strategy can improve significantly the performance of existing SAE methods in the low SNR regime (with estimation accuracy improvements up to 38–45% within the SNR interval from −20 dB to −10 dB) when used as a pre/post-processing stage, thus improving their sensitivity and effectively extending their overall SNR range of operation.


I. INTRODUCTION
Wireless communication signals are often represented in the time-frequency domain by means of spectrograms, which show the time evolution of the power spectral density of a signal or set of signals present in a frequency band. In many practical applications spectrograms are processed to extract relevant signal information such as the received signal strength, carrier frequency, occupied bandwidth, spectral mask and transmission pattern. A relevant aspect in the processing of radio spectrograms is the time-frequency region occupied by each individual transmission or signal component within the spectrogram, which is typically referred to as Signal Area (SA). By definition, an SA is a rectangularly-shaped cluster of spectrogram points where a transmitted signal component is present. The SA precisely determines the occupied bandwidth and start/end times of each radio transmission. The ability to accurately extract this The associate editor coordinating the review of this manuscript and approving it for publication was Ayaz Ahmad .
information from a spectrogram can be useful in many practical scenarios such as spectrum surveillance for enforcement of spectrum regulations or gathering of signal intelligence in military applications, signal interception and identification, electronic warfare and radio environment spectral awareness (e.g., databases for spectrum sharing).
In spite of its practical relevance, the problem of Signal Area Estimation (SAE) has not been explored extensively in the literature. Several SAE methods have been proposed providing different trade-offs between accuracy and computational cost. A region growing algorithm controlled by the first and second order statistics of the spectrogram is proposed in [1] for spectrogram segmentation; such method can distinguish between deterministic signal components and background noise and classify them into separate regions, however cannot provide information about the actual SA of each component. The work reported in [2] presents a computer vision approach based on the application of a fixed threshold to the spectrogram in order to generate a binary image, which is also processed using morphological VOLUME 10, 2022 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ operations as an adaptive threshold approach to remove extraneous detections, and finally extracts the image blobs by grouping connected components and calculating their bounding boxes. Such method is modified in [3] by introducing an auto-thresholding method and a bi-directional self-organising neural network in order to reduce noise after thresholding.
In [4], the use of a network based on a single shot multibox detector (which is a classical deep learning based object detector [5]) is proposed for signal component extraction, which is further extended in [6] by introducing convolutional layers in order to provide a more accurate detection at the expense of an increased complexity and the requirement of training. A different approach based on the Mean-Shift Clustering (MSC) algorithm is suggested in [7], where each SA is determined based on the use of a scanning window whose dimensions are adjusted according to the expected bandwidth and transmission duration of the signal components to be detected. A Transmission Encapsulation based on the Connected Component Labeling (TECCL) method is proposed in [8], which performs clustering based on the connected component labelling algorithm [9] and estimates the SA of each cluster as its extreme dimensions (bounding box). This method can be implemented using contour tracing techniques [10] (see CT-SA in [11] for instance). A Simple Signal Area (SSA) estimation method is proposed in [11], which performs a raster scan to find the first corner of each SA, followed by horizontal scanning to estimate the SA width and coarse/fine vertical scanning to estimate the SA height. Some variants to reduce the impact of false alarms are proposed in [12]- [14]. An approach based on mathematical morphology principles is proposed in [15]. In this context, this work explores a new approach for SAE by treating spectrograms as images, where each spectrogram point is seen as an image pixel, and applying two well-known techniques from the field of image processing, namely edge detection and flood fill. Edge detection is first employed to identify the edges of potential SAs and flood fill is then used to fill the area inside the estimated edges in order to produce a more accurate estimation of the SAs present in a spectrogram. Three methods commonly used for edge detection are considered (gradient magnitude, Laplacian of Gaussian and Canny) and their suitability as SAE methods is explored, both as standalone SAE techniques and combined with other existing SAE methods from the literature as a pre/post-processing stage. The performance of the proposed approach is evaluated with extensive software simulations and corroborated with hardware experiments. It is observed that this approach in general has limited utility when used standalone but can provide significant accuracy improvements in the low SNR regime when used as a pre-and/or post-processing stage to other existing SAE methods. The overall effect is an improvement of their sensitivity and an effective extension of their SNR range of operation.
While the edge detection and flood fill techniques are well-known and commonly used in image processing, computer vision and other related fields, they are barely known and exploited in the wireless communications community. There have been some previous attempts in the literature to apply edge detection techniques to spectrograms, however mostly for automatic tonal detection and recognition of marine mammal sound patterns in the field of bioacoustics [16]- [19]. The signal formats and the motivations for applying edge detection techniques in such problem are very different from those in SAE scenarios. To the best of the authors' knowledge, this is the first study in the literature that explores the applicability of edge detection and flood fill techniques to the problem of SAE in spectrograms for wireless communication signals.
It is worth noting that the main objective of this work is not to propose novel methods for edge detection and flood fill, or to provide new theoretical contributions to these two particular image processing techniques, but to explore the degree to which such techniques from the field of image processing can bring performance improvements when applied to the problem of SAE. Therefore, the edge detection and flood fill methods used in this work are based on basic standard approaches that are widely known, employed and documented in the literature.
The contribution of this work is manyfold. First, it provides an exhaustive analysis on the suitability of common edge detection techniques to the problem of SAE. By means of simulations, the consequence of applying different edge detectors to SAE is investigated under a broad range of configuration parameters for each edge detector. The analysis is conducted over a representative range of Signal-to-Noise ratio (SNR) conditions typically found in wireless communication systems. In such analysis, the accuracy of edge detection plus flood fill is explored when used both as a standalone SAE method and as a pre/post-processing stage combined with other existing SAE methods from the literature. Based on the outcomes, the optimum configuration for each detector achieving the highest observed accuracy is determined and a suitable SAE strategy is formulated for each edge detection method. The proposed approach is shown to provide significant accuracy improvements in the detected SAs at low SNR (with respect to the case where the other SAE methods are used alone) and without having a significant impact on the overall computational cost.
The rest of this paper is organized as follows. First, Section II provides a formal description of the SAE problem considered in this work along with an overview of SAE techniques proposed in the existing literature. Section III then provides an overview of the fundamentals of the edge detection and flood fill techniques from image processing. The simulation and experimental methodologies employed in this work are presented in Section IV. The performance of the proposed strategy based on various edge detection techniques is explored in Section V, where the most convenient SAE approach is formulated as well. Finally, Section VI summarises and concludes this work.

II. SIGNAL AREA ESTIMATION A. PROBLEM DESCRIPTION AND FORMULATION
The spectrogram of a wireless communications signal is a discrete two-dimensional time-frequency representation of the power level observed at various time instants and frequency points. These power levels can be compared to a properly set decision threshold to produce a binary spectrogram where the value of each point can be either zero/not occupied (if the power level at that point is below the threshold) or one/occupied (if the power observed at that point is greater than the threshold). Such binary matrix is the input information that most SAE methods work with. Each individual radio transmission or signal component is confined inside a rectangular area within the spectrogram (the SA) that defines precisely the occupied bandwidth and start/end transmission instants. The purpose of SAE methods is to decide the dimensions of each SA in a spectrogram as accurately as possible. The process, however, is not trivial since the spectrum data observed by the monitoring spectrum-aware system is a degraded version of the transmitted signals after having suffered impairments introduced by radio propagation, the receiver's own noise and other external sources of unwanted noise and interference (e.g., out-of-band transmissions, ambient noise or man-made noise) [20]- [23]. The aim of this work is to accurately determine the time-frequency region occupied by each radio transmission in a spectrogram (i.e., the set of SAs present in a radio spectrogram). The problem and system model are illustrated in Fig. 1.

B. EXISTING SAE METHODS
Several methods have been proposed to estimate accurately the SAs present in a radio spectrogram based on the (degraded) signal power data observed at the receiver (see Section I). To illustrate the potential benefits that the proposed SAE approach can provide when combined with other SAE methods, two algorithms from the literature are selected. The first reference algorithm is the Transmission Encapsulation based on the Connected Component Labelling (TECCL) method proposed in [8], which performs clustering based on connected component labelling [9] and estimates the SA of each cluster as its extreme dimensions (bounding box). This method can be implemented using standard Contour-Tracing (CT-SA) techniques [10] (see [11] for instance), which is the approach adopted in this work. The second reference algorithm is the so-called Simple Signal Area (SSA) estimation method proposed in [11], which performs a raster scan to find the first corner of each SA, followed by horizontal scanning to estimate the SA width and coarse/fine vertical scanning to estimate the SA height. Some variants to reduce the impact of false alarms are proposed in [12]- [14] but are not considered in this work. These two methods have been selected due to their subjective and unambiguous algorithm formulation, which does not require manual intervention for their application (such as data training or manual parameter configuration). As it will be shown, the consideration of these two methods is sufficient to illustrate the potential benefits that the proposed SAE approach can provide when combined with other SAE methods.

C. PROPOSED SAE APPROACH
The problem of estimating a solid SA in a time-frequency matrix of degraded power values and their corresponding binary one/zero observations is equivalent to the problem of recognition of patterns in an noisy image (in this case, rectangularly shaped solid areas). Image processing techniques can be employed to this end by treating the spectrogram of power values as a greyscale image or its binary version as a blackand-white image, where each spectrogram time-frequency point represents an image pixel (the latter case is considered in this work). The problem of SAE then becomes the problem of detecting a rectangular shape in a binary noisy image. This point of view opens a new perspective for SAE where a broad range of powerful tools from the field of image processing can be exploited. Image processing is a well-developed field VOLUME 10, 2022 where many advanced and sophisticated tools have been proposed to detect shapes in noisy images, which are potentially well-suited to the SAE problem considered in this work. Concretely, the interest of this work is in exploring the feasibility of using a novel approach based on a combination of edge detection and flood fill techniques from the field of image processing to enhance the accuracy of SAE.

III. DIGITAL IMAGE PROCESSING: OVERVIEW OF THE EDGE DETECTION AND FLOOD FILL OPERATIONS
The main idea behind the strategy proposed in this work for SAE is based on two fundamental steps, namely edge detection and flood fill. The main objective of the edge detection step is to determine the most likely boundaries of potential SAs in the received time/frequency spectrum data grid. Once these boundaries are determined, a flood fill algorithm is in charge of filling the space within the detected edges in order to produce solid SAs. The problems of edge detection and flood filling have been extensively investigated for several decades and the available literature is abundant [24]. Noticing that the readership of this journal will mainly have a wireless/radio communications engineering background, this section provides an overview of the main strategies for edge detection and flood fill with a special focus on those aspects that are relevant to the problem of SAE considered in this work. This material not only makes this paper self-contained but will also make the results presented in Section V more clear to the reader unfamiliar with image processing techniques.

A. EDGE DETECTION
Edge detection is an image processing technique used to find edges of objects or boundaries between two regions within an image. In image processing, an edge is essentially a curve of connected pixels that follows a path of rapid change in image intensity; as such, it can be found by looking for places in the image where there is a rapid change or abrupt discontinuity in the intensity levels. A relatively simple technique to detect discontinuities in the intensity level is by looking for regions of the image where the magnitude of the first-order derivative of the intensity is greater than a properly set threshold. Since digital images are two-dimensional matrices of pixels, the two-dimensional gradient is employed: where ∂f /∂x and ∂f /∂y are the first-order partial derivatives of a digital image f (x, y) at every location (x, y) in the horizontal and vertical directions 1 , respectively, while G x and G y are first-order discrete differentiation operators used to estimate the intensity gradients in each direction (the symbol * denotes two-dimensional convolution). Since the gradient ∇f points in the direction of maximum rate of change of image f at location (x, y), its magnitude ∇f gives the maximum rate of increase of f (x, y) per unit distance in that direction. The result therefore represents how abruptly the image intensity changes at every point, thus giving an indication of how likely that part of the image belongs to an edge and how that edge is likely to be oriented. This implies that the magnitude of the gradient vector will be zero in areas of constant intensity and will find local maxima where edges are present. By comparing the magnitude of the gradient vector to an adequate threshold, the set of pixels belonging to edges can be extracted from an image. Concretely, a pixel will belong to an edge (H 1 ) if the gradient magnitude is greater than the selected threshold λ, and will be assumed not to belong (H 0 ) otherwise 2 : The two-dimensional gradient is obtained by computing the first-order partial derivatives ∂f /∂x and ∂f /∂y at every pixel location (x, y). This is accomplished by convolving the input image f with a predefined small squared sub-image usually called filter, mask or convolution kernel. This is a linear spatial filtering process whereby the filter mask is moved through every pixel of the input image and at each point the filter response is calculated as the sum of the products between each of the filter coefficients and the intensity levels of the corresponding image pixels within the region encompassed by the mask. Mathematically, the result of this convolution/filtering process is a discrete approximation to the gradient of the image intensity. As it can be seen from (1), two filter masks G x and G y are used, one to estimate the intensity gradient in each orthogonal direction. The magnitude of the intensity gradient at every image point is then obtained as shown in (2).
The filter coefficients are calculated so as to approximate the response of the first-order derivative (gradient) in the desired direction (hence, the filter masks G x and G y are also referred to as gradient operators). Several methods have been proposed in the literature to calculate these coefficients. Table 1 shows the gradient operators proposed by Prewitt [26], Sobel [27], [28], Jähne [29] and Kroon [30]. Notice that in all masks the coefficients sum to zero, thus indicating a zero response in areas of constant intensity (i.e., where edges are not present) as expected of a gradient/derivative operator. Prewitt masks are the simplest differentiation filters, while Sobel masks have a slightly superior noise suppression performance [25, p.579]. Both Prewitt and Sobel masks provide in general a low level of isotropicity or rotational invariance (i.e., ability not to bias any directions in images, providing an equally sensitive response in all 2 As discussed in [25], the computational burden required by the calculation of squares and square roots can be removed by approximating ∇f ≈ |G x * f | + G y * f . The resulting filters will not be isotropic (invariant to rotation) in general but this is not an issue with filters specifically designed to detect horizontal and vertical edges as the ones considered in this work. directions), which has motivated the proposal of other gradient operators by Scharr and Kroon as well as alternative filter designs [31]- [33]. All filter masks shown in Table 1 have in common that they are specifically designed to be sensitive to horizontal and vertical edges (which can be intuitively inferred from the symmetric design around central rows and columns of zeros). This property is of particular interest in this work since SAs are precisely delimited by horizontal and vertical edges. Other filter masks such as those proposed by Roberts [34], Kayyali [35] or Kirsch [36] are designed to be sensitive to diagonal edges and are not considered in this work. Filter masks are strictly defined as 3×3 templates even though some ad hoc methods have been proposed to generate larger kernels for higher dimensions by expansion [37] or dilation [38], [39].
An alternative strategy to the gradient-magnitude edge detection methods discussed above is to calculate the second-order derivative of the intensity and look for its zero-crossings to detect edges. Since digital images are two-dimensional matrices of pixels, the two-dimensional Laplacian is employed: where ∂ 2 f /∂x 2 and ∂ 2 f /∂y 2 are the second-order partial derivatives of a digital image f (x, y) at every location (x, y) in the horizontal and vertical directions, respectively, and L is a discretely sampled version of the Laplacian operator (the symbol * denotes two-dimensional convolution). Since the Laplacian is usually unacceptably sensitive to noise, the input image is first processed with a smoothing Gaussian filter whose response is typically of the form [25]: where r 2 = x 2 + y 2 and σ is the filter's standard deviation, which determines the level of smoothing or blurring in the filtered image. The Laplacian operator is then applied to the noise-filtered result, which is equivalent to filter the original input image with a Laplacian of Gaussian (LoG) filter: Thus, the input image is convolved with a discretely sampled version of the filter in (5), whose size n × n is usually selected based on the filter's standard deviation as n = 2 3σ + 1 (this ensures that the filter dimensions are large enough to include three standard deviations around the mean, which accounts for 99.73% of the Gaussian filter response). The zero-crossings of the resulting output can be exploited to extract edges from the input image. As opposed to the gradient-magnitude methods discussed above, the LoG method is not specifically sensitive to edges with a particular orientation.
A third popular strategy for edge detection is the method proposed by Canny [40]. The formulation of this method starts with the aim of finding an optimum filter that addresses the three main issues of edge detection (error rate, localisation and uniqueness of the filter response). Such optimum filter is approximated by the first derivative of a Gaussian filter. Based on this finding, the Canny method undertakes the following steps [24, sect. 2.4]: i) a Gaussian filter is applied to smooth the input image and remove noise; ii) the intensity gradient of the filtered image is found in order to perform a minimum cut-off (non-maximum) suppression of gradient magnitudes, or lower bound thresholding, as an edge thinning technique so that spurious responses of the filter are eliminated and multi-pixel wide ridges are thinned down to single pixel width; iii) final edges are determined according to a process of edge tracking by hysteresis based on double thresholding. This last step is the most significant difference between the Canny and other edge detection methods. A high threshold λ high for low edge sensitivity (typically set at around 0.7 times the maximum intensity level) is used to detect pixels belonging to strong edges, while a low threshold λ low for high edge sensitivity (typically selected as λ low ≈ 0.3 λ high ) is used to decide on weak edges. Pixels whose intensity gradient magnitude is greater (lower) than λ high (λ low ) are selected (discarded). Pixels whose intensity gradient magnitude lies within the interval [λ low , λ high ] are included in the output only if they are connected/adjacent to strong edges (whose intensity gradient is above λ high ), otherwise they are assumed to be noise or spurious responses and therefore discarded. Similar to the LoG method, the Canny method is not particularly sensitive to edges with a certain orientation. The Canny method requires three parameters, namely the standard deviation of the Gaussian filter (σ ) and the pair of thresholds (λ low , λ high ).

B. FLOOD FILL
While edge detection is the key technique employed in this work to detect SAs, it is unable by itself to produce solid SAs as it will only identify their most likely edges/boundaries. To solve this problem, a flood fill algorithm is applied immediately after the edge detection step in order to fill the empty space within the detected edges and thus produce solid SAs.
The traditional flood-fill algorithm spreads throughout the image based on the connectivity of the pixels. Two connectivity types are usually defined: the first connectivity type considers that two pixels are connected if their edges touch (in this case each pixel will be connected to a maximum of four neighbouring pixels that are adjacent in the horizontal and/or vertical directions) while the second connectivity type deems two pixels as connected if their edges or corners touch (in this other case each pixel will be connected to a maximum of eight neighbouring pixels that are adjacent in the horizontal, vertical and/or diagonal directions).
The algorithm starts at a random zero-valued (idle state) pixel within the boundaries of the detected edges and recursively reverts the state of other connected zero pixels (from zero to one, i.e., busy or occupied state) until all branches of the recursive process reach a location where all the connected pixels are one. At that point, the connected region of idle-state pixels within the boundaries of the detected edges will be filled and a solid SA will be produced. This recursive process can be used to fill holes, i.e., areas of connected idle/zero pixels surrounded by busy/one pixels (belonging to edges). The flood fill method used in this work is based on the morphological reconstruction algorithm described in [41, pp. 173-174].
A common issue that can degrade the performance of the flood fill step is the presence of SAs (or parts thereof) in contact with the border of the image (time/frequency data grid). This typically occurs when a transmission starts before or ends after the time-frequency data are captured, thus leading to SAs that are clipped in one of their sides by the bottom or top borders of the image, respectively. Clipping by the left or right borders of the image can also occur when the measurement bandwidth of the receiver is not large enough to fully embrace the bandwidth of the signals being monitored. Edge detection methods do not identify image borders as edges and the lack of edge pixels in one of the sides of a clipped SA affects the ability of the flood fill step to correctly fill the space within the SA. This problem is resolved by adding two rows of padding edge pixels to the top and bottom borders of the image (and possibly two columns to the left and right borders as well) to help the flood fill step complete its task. Once the flood fill step is completed, these padding edge pixels are removed and the image is restored to its original dimensions.

C. PROPOSED SAE METHOD BASED ON THE APPLICATION OF EDGE DETECTION AND FLOOD FILL
A flowchart summarising the signal processing flow of the input spectrogram according to the proposed edge detection plus flood fill framework is illustrated in Fig. 2. The main motivation for the application of edge detection and flood fill as a SAE method lies on the ability of edge detection techniques to detect edges of objects (SAs in this case) even when they are partly degraded and the ability of flood fill techniques to fill holes within objects. Edge detection techniques have some tolerance to edge irregularities caused by noise (i.e., missed detections and false alarms in the context of SAE). Some methods, such as the Canny method, can even reconnect fragments of edges that have been disconnected due to noise degradation. Moreover, flood fill techniques can fill gaps within SAs resulting from missing SA points due to signal missed detections under low SNR conditions. Therefore, edge detection seems a reasonable way to identify the boundaries of SAs and potentially close them when they are not perfectly closed, while flood fill can be used to fill the area within the detected edges in order to produce a solid SA that otherwise might not be detected so accurately. These observations motivate this work to explore the performance of edge detection and flood fill as a SAE method.
To gain an adequate understanding on whether and how these two image processing techniques can help improve the performance of SAE, two application scenarios are investigated in this work: (i) a first scenario where the proposed approach is applied as a standalone SAE method that takes as an input the binary matrix produced by the application of ED and produces its own final output, similar to how other SAE techniques such as CT-SA or SSA would be applied; (ii) a second scenario where the proposed approach is applied in combination with other existing SAE methods such as CT-SA and SSA as a pre/post-processing technique, where it can be applied only before, only after, or both before and after the other SAE method. The study of both scenarios will provide insights into how to best formulate a suitable SAE method based on edge detection and flood fill.

IV. EVALUATION METHODOLOGY
The performance of the SAE strategy explored in this work was evaluated with software simulations and corroborated with hardware experiments based on an tailored experimental prototype specifically built to this end. Monte Carlo simulations were performed following the same procedure used in [15], [42], which is summarised in the following steps: A. STEP 1. GENERATE NOISE-FREE DATA AT THE TRANSMITTER For each simulated SNR, 100 random time-frequency data grids were generated with dimensions 50×100 points. The frequency span was divided into three equally sized channels where only the central channel carried traffic, which was modelled as a sequence of ON/OFF transmissions randomly drawn from exponential distributions with rate parameter 0.5 points −1 and minimum duration of 10/5 points, respectively.

B. STEP 2. GENERATE NOISY DATA AT THE RECEIVER
For each data grid generated in Step 1, random errors were introduced to generate the data observed at the receiver. This process emulated the degrading effects of channel propagation and noise. Errors were generated assuming that the signal detection threshold was set to achieve a constant false alarm rate P fa = 0.01, which resulted in an SNR-dependent missed detection probability 1 − P d , calculated assuming that signal detection was performed in blocks of 100 signal samples.

C. STEP 3. APPLY SAE METHOD AND ASSESS ACCURACY
SAE was applied to each data grid obtained in Step 2 and the output was compared to the original data from Step 1 to assess the resulting final estimation accuracy. Final simulation results were corroborated with experimental results obtained with the hardware prototype shown in Fig. 3, which was composed of a Signal Hound VSG25A vector signal generator as the signal transmitter, a short coaxial cable along with a 20 dB attenuator to emulate the transmission channel, and a Tektronix RSA306B real-time spectrum analyser as the signal receiver or spectrum monitoring device. A wired connection was employed to avoid unwanted interference to/from other wireless devices operating in the neighbourhood of the prototype. The transmitter and receiver were connected via USB to the same computer, where a Matlab control program was run to coordinate the operation of the transmitter and receiver and ensure that the data were correctly synchronised so they could be compared to assess the estimation accuracy. Such program was implemented using Matlab's Instrument Control Toolbox along with the libraries and Application Programming Interfaces (APIs) provided by the manufacturers.
The experimental platform was configured to replicate the simulation configuration. The transmitted signal was a multi-tone signal with a spectral shape similar to an OFDM signal composed of 1001 unmodulated tones with random phase spaced at 10 kHz around a central frequency of 1 GHz, with a total signal bandwidth of 10 MHz. The centre frequency of the receiver was also configured to 1 GHz with a frequency span of 30 MHz (i.e., signal bandwidth was 1/3 of the frequency span). The relation between the transmission power configured at the signal generator and the SNR observed at the spectrum analyser was carefully calibrated to enable a fair comparison between simulation and experimental results.
The accuracy of the estimated SAs at the receiver was assessed based on the F1 score metric, defined as [43]: where TP, FP and FN represent the number of true positives, false positives and false negatives, respectively. The F1 score ranges from zero (completely erroneous estimation) to one VOLUME 10, 2022 (perfect estimation) and constitutes a fair metric when there exists an imbalance in the amount of idle/busy points in the spectrum data. All the data points in each time-frequency grid were taken into account in the calculation of (6).

V. PERFORMANCE ANALYSIS AND PROPOSED METHODS
This section presents simulation results for the performance of edge detection methods (with flood fill) as SAE methods. First, the performance of each edge detection strategy is explored for various parameter configurations; based on the obtained results, the optimum configuration is selected and a suitable SAE strategy is proposed for each edge detection method. This is carried out for the three edge detection methods considered in this work (gradient-magnitude, LoG and Canny). Subsequently, the performances of the best configuration for each strategy are compared and analysed to determine the extent to which the SAE approaches explored in this work can improve the accuracy of the detected SAs.

A. ANALYSIS OF GRADIENT-MAGNITUDE METHODS
The main configuration parameter of gradient-magnitude edge detection methods is the edge detection threshold λ used in (2) to extract the edge pixels. To help select suitable thresholds, Fig. 4 shows some sample histograms of the gradient magnitude values ∇f obtained after filtering the same image of received time/frequency data with the gradient operators shown in Table 1. The results are shown for high SNR (+5 dB) and low SNR (-5 dB) at the receiver and the gradient magnitudes are normalised to the interval [0, 1]. As it can be appreciated, the Prewitt/Sobel masks have similar performance and so does the Scharr/Kroon pair (this can be explained by the fact that the masks in each pair follow similar design principles and this work deals with binary black-andwhite images where only horizontal and vertical edges are present). Most pixels have an intensity gradient magnitude of zero (corresponding to the image background) that can be easily separated with a threshold λ = 0.1 at both low and high SNR. As inferred from the histograms for the high SNR scenario, strong edge pixels are found at levels above λ = 0.8, which is the second most frequent level. Other gradient magnitude levels between 0.1 and 0.8 are due to either weak edge pixels (mostly found in the corners of SAs), spurious responses of the edge detection filter or false alarms. For the low SNR scenario, gradient magnitude values are slightly more uniformly distributed as a result of a more frequent presence of weak edges and spurious filter responses. Based on these histograms, a set of thresholds λ ∈ {0.1, 0.8} is selected for a more detailed study. Fig. 5 shows the performance of gradient-magnitude edge detection methods (for the four gradient operators of Table 1) as a function of the SNR for the two thresholds selected above. These results correspond to the case where these gradient-magnitude edge detectors are used as standalone SAE methods (i.e., only applied to the output of ED without any combination with CT-SA or SSA). The performance of ED alone is included for comparison and the reference SAE methods (CT-SA and SSA) are included as well for completeness. First, it is worth noting that all four gradient operators lead to a largely similar performance in terms of F1 score. This can be explained by the fact that the different design criteria on which these masks rely do not result in any practical difference in the case of the SAE problem considered in this work. Recall that all masks are aimed at approximating the gradient operator, with Prewitt being the simplest one. The Sobel mask is designed to improve the noise suppression characteristics of the Prewitt mask, however noisy pixels in the case of binary (black-and-white) images are more localised and likely less frequent than in continuous (grayscale) images, so in practice there is no apparent difference. Moreover, the Scharr and Kroon filters are designed to improve the isotropicity (rotational invariance) of the Sobel mask, which is irrelevant when the edges of interest are either horizontal or vertical, for which all masks seem to be equally sensitive. Based on these observations, the Prewitt mask (the simplest one) suffices for gradientmagnitude SAE. Fig. 5 also shows the impact of the threshold for the two extreme cases λ = 0.1 and λ = 0.8. The curves for these two thresholds give an indication of the worst/best performance that can be attained with gradient-magnitude methods at every SNR. As one may expect, better accuracy is obtained with a more restrictive threshold (λ = 0.8) at high SNR (to filter weak edges and rely on strong edges) and with a more permissive threshold (λ = 0.1) at low SNR (to increase sensitivity). However, some counter-intuitive trends are observed in Fig. 5 when the performance of gradient-magnitude edge detectors is compared to the reference SAE methods (ED, CT-SA and SSA). On the one hand, one would expect that edge detection should be a relatively easy task at high SNR and therefore the gradient-magnitude methods should work relatively well, however they exhibit a significant loss of accuracy in this SNR regime with respect to the reference methods. On the other hand, one may also expect edge detection to fail at low SNR due to degraded signal quality, however edge detection based SAE outperforms the reference methods in the low SNR regime. To gain insights into the operation of SAE based on edge detection and explain this trend, Fig. 6 shows some examples of the time/frequency grid (image) observed at different stages of the SAE process based on edge detection.
At high SNR, the image observed after ED (Fig. 6a) is an accurate reproduction of the true SAs, except for the presence of some false alarms. After the edge detection step (Fig. 6c), the boundaries of the SAs are correctly identified, however the detected edges lie on the outer sides of the SAs and the subsequent flood fill operation (Fig. 6e) produces a set of final SAs that are slightly larger than the original SAs (this can be noticed in the narrower gaps between SAs in Fig. 6e than in Fig. 6a). This magnifying effect is observed not only in the true SAs but in the false alarms as well, whose dimensions are also larger in Fig. 6e than in Fig. 6a. This explains the lower accuracy attained by the gradient-magnitude edge  Table 1. Results are shown for high SNR (+5 dB, top) and low SNR (-5 dB, bottom). detectors at high SNR. Several techniques could be applied to remedy this degrading effect. For instance, a noise removal step (by morphological erosion or Gaussian filtering) could be introduced to reduce the number of false alarms before the actual edge detection. Moreover, the above mentioned magnifying effect on the true SAs could be reduced by using edge thinning techniques or increasing the image resolution so that the number of edge pixels represents a lower proportion of the total number of image pixels (and hence the pixel-bypixel calculated F1 score improves). However, this is unlikely to provide better performance than ED and therefore the increased computational cost would not be justified. This analysis suggests that gradient-magnitude edge detectors may not be useful for SAE at high SNR.
At low SNR, the image observed after ED (Fig. 6b) shows a high level of degradation where the presence and dimensions of any potential SAs are unrecognisable. The edge detection step (Fig. 6d) followed by the subsequent flood fill step (Fig. 6f) also have a magnifying effect, both for false alarms (which depend on the noise power only and are therefore independent of the SNR) and true signal components. However, in this case, this is beneficial for SA detection VOLUME 10, 2022 since the small signal components or portions of true SAs observed in Fig. 6b are interpreted as separate SAs, and each of these signal components is thus magnified. This somehow helps to fill empty spaces between the vestiges of true SAs, which makes the presence of SAs more visible as it can be clearly appreciated by comparing Figs. 6b and 6f. The final output obtained at low SNR in Fig. 6f may not be useful in applications where the number, location and dimensions of the present SAs need to be known accurately, however it clearly shows the presence of a signal and its approximated bandwidth and as such this information can be useful in the context of signals intelligence (e.g., for signal interception) and other similar application scenarios.
The discussion above leads to the conclusion that, in the context of SAE, the interest of gradient-magnitude edge detection lies in the low SNR regime. At low SNR, Fig. 5 indicates that the best performance is obtained by using any gradient operator (e.g., Prewitt for simplicity) and a threshold λ = 0.1. Compared to most practical edge detection application scenarios, this threshold value may seem quite low and permissive; essentially, any pixel with a gradient magnitude above zero (i.e., any pixel that is not part of the image background, see Fig. 4) is considered an edge pixel. However, recall that the images processed in the context of this work are binary black-and-white images composed of zeros (background) and ones (SAs); thus, at low SNR any pixel whose gradient magnitude is above zero is either a false alarm (which will typically occur with low probability depending on the selected ED threshold, e.g. 0.01 in this work) or an edge pixel. Such low threshold value thus yields an improved sensitivity to edge pixels that helps deliver a better SA detection performance at low SNR.
The results discussed so far correspond to the application of gradient-magnitude edge detectors as standalone SAE methods (i.e., applied directly to the output of ED as the final SAE stage). These methods can also be applied in combination with other SAE methods (such as CT-SA and SSA) as a pre/post-processing technique. The F1 score performance in this case is illustrated in Figs. 7 and 8 when combined with the CT-SA and SSA methods, respectively. As it can be noticed, the performance observed in both figures is quite similar. Moreover, the optimum SAE procedure depends on the particular SNR experienced at the monitoring receiver. Based on these results, a suitable SAE method based on gradient-magnitude edge detection can be formulated as follows: • If SNR ≤ γ l , perform edge detection before and after the other SAE method.
• If γ l < SNR ≤ γ m , perform edge detection only before the other SAE method.
• If γ m < SNR ≤ γ h , perform edge detection only after the other SAE method.
• If SNR > γ h , apply the other SAE method alone (without edge detection). In this formulation, the other SAE method refers to CT-SA, SSA or any other suitable SAE algorithm and (γ l , γ m , γ h ) is  a set of low, medium and high SNR switching thresholds, respectively, that determine the best operation to perform within each SNR range. The optimum values for these thresholds can be obtained from Figs. 7 and 8 as the crossing points between curves such that the resulting F1 score is the envelope of all the individual curves. This SAE approach provides the best accuracy that can be attained with the help of gradient-magnitude edge detectors for every SNR value, which, as shown in Figs. 7 and 8, can provide significant accuracy improvements in the low SNR regime (with respect to the use of the other SAE method alone, e.g. up to 40% for CT-SA at −10 dB SNR). This is illustrated with some sample images in Fig. 9 for the CT-SA method (with flood fill) operating at an SNR of −10 dB (similar trends and conclusions are observed for SSA). The outcome of ED at such low SNR (Fig. 6b) does not seem to provide any clear indication that a signal is present. The application of CT-SA alone (Fig. 9a) seems to provide some hint that a signal may be present, however in an unclear manner and without enough detail to estimate basic signal properties such as its bandwidth. However, the introduction of edge detection as a pre/post-processing step (Figs. 9b-9d) provides a clear indication that a signal is present as well as sufficient detail for a rough estimation of its bandwidth. As stated earlier, the output in this case does not provide sufficient detail to obtain accurate information about the number, location and dimensions of the present SAs (such as in Fig. 6a under high SNR conditions) but can be very useful in the context of signals intelligence (e.g., for signal interception) and other similar application scenarios.
Comparing Fig. 5 with Figs. 7 and 8 it can be observed that gradient-magnitude edge detectors perform better when combined with other SAE methods (based on the dynamic SNR-switching approach described above) than when used standalone. This is true for the whole range of SNR values where the use of gradient-magnitude detectors is beneficial (i.e., at low SNR). Therefore, the optimum configuration for gradient-magnitude edge detection methods is achieved when combined with other SAE methods according to the three SNR switching thresholds (γ l , γ m , γ h ) as discussed above. Fig. 10 shows the performance of the LoG edge detector as a function of the SNR for selected values of the Gaussian filter's standard deviation (parameter σ ) when used as a standalone SAE method. The performance of ED alone is included for comparison and the reference SAE methods (CT-SA and SSA) are included as well for completeness. Similar to the case of gradient-magnitude methods, the accuracy is degraded in the high SNR regime and improved at low SNR, for the same reasons explained in Section V-A. The extent to which the accuracy is improved or degraded in each SNR range depends on the filter's standard deviation. Interestingly, the optimum value of σ that yields the best attainable accuracy decreases with the experienced SNR. This can be explained based on the filter's averaging/blurring effect for different σ values. At high SNR, the present SAs are clearly visible and therefore easily detectable; any averaging/ blurring process can only degrade the current image quality and therefore reduce the accuracy of the edge detection process. For this reason, at high SNR the optimum choice is a low standard deviation as this will have a low averaging/blurring effect. In the example of Fig. 10 this corresponds to σ = 0.5 (the lowest considered value), which has no effect on the filtered signal and is equivalent to skip the edge detection plus flood fill step altogether. As the SNR decreases, parts of the true SA will start to disappear as a result of a lower detection probability, thus making them look more similar to background areas of the image (with no signal components) and therefore affecting the filter's ability to respond to the presence of edges. This can be overcome by increasing the filter's standard deviation (i.e., the filter's width) so that more neighbouring pixels are included in the averaging process, which will increase the probability of a detectable response at the output of the LoG filter when an edge is present. This explains why the optimum value of σ that yields the best attainable accuracy increases when the experienced SNR decreases (in the example of Fig. 10, the optimum choice is σ = 0.5 down to -6.5 dB, at which point σ = 1 yields a similar accuracy, then σ = 2 from -6.5 dB down to -14 dB, and finally σ = 3 for lower SNR values).

B. ANALYSIS OF THE LAPLACIAN OF GAUSSIAN METHOD
The performance of the LoG edge detector when used as a pre/post-processing technique for other SAE methods is illustrated in Fig. 11 for the CT-SA method (the counterpart figure for the SSA method is omitted as it is highly similar). Most of the observations for the LoG edge detector as a standalone SAE method that were discussed above are also valid when used as a pre/post-processing stage. It is worth noting from Fig 11 that, in the SNR range where the use of the LoG method is beneficial (i.e., in the region of lower SNR), the best accuracy is obtained when used as a pre-processing technique (i.e., only before the other SAE method is applied). Applying the LoG method as a post-processing stage leads to a lower accuracy and indeed  degrades the accuracy obtained when also applied as a preprocessing stage. This indicates that the magnifying effect of the LoG edge detection plus flood fill step makes it easier for other SAE methods to detect the presence of SAs more accurately. Similar to the standalone scenario, in this case the optimum σ increases as the experienced SNR decreases, which is illustrated in Fig. 12 when CT-SA is employed as the main SAE method (similar results are obtained for SSA). Comparing Figs. 10 and 12, and assuming that the optimum σ for each experienced SNR is selected, one can see that a better accuracy can be obtained when the LoG edge detector is combined with another SAE method as a pre-processing stage (similar to what was observed for gradient-methods in Section V-A) and therefore this is the preferred configuration.
An important aspect in the configuration of the LoG method is how the value of σ should be selected for each experienced SNR so that the resulting SAE accuracy is maximised. To answer this question, extensive simulations were run for SNR values in the range from -20 dB to -5 dB (notice in Fig. 12 that for SNR values above -5 dB the best choice is to skip the LoG edge detection step, as discussed earlier). For each simulated SNR, values of σ in the range from 0.5 to 5.0 in increments of 0.1 were tested and the resulting SAE accuracy was calculated in terms of the F1 score. The results of this simulation are shown in Fig. 13. These results can be further processed to find out the optimum σ that maximises the F1 score for each SNR (σ opt ), which is shown in Fig. 14. The stair shape of the simulation results (labelled as optimum) in Fig. 14 suggests that only a small finite set of σ values is enough to optimise the accuracy over the whole SNR range of interest, except for SNR values below -15 dB where a more diverse range of σ opt is observed. However, it can be noted in Fig. 13 that for SNR below -15 dB the optimum F1 score is observed in a rather flat region and therefore its value is not very sensitive to small variations of σ . In particular, values of σ in the interval [3, 3.5] give very similar F1 score for SNR below -15 dB, therefore replacing the true σ opt with σ =3 for SNR below -15 dB will not have a noticeable impact on the resulting accuracy. This is labelled as near-optimum in Fig. 14. The advantage of this approach is that a small set of values σ ∈ {0.75, 1.1, 1.4, 2.1, 3.0} represents the entire domain of σ opt over the whole SNR range of interest as shown in Fig. 14. The corresponding SNR switching thresholds can be readily obtained from the same figure.
The simulation results in Fig. 14 can be fitted to a Gaussian model of the form: with the fitting coefficients shown in Tables 2 and 3 for the optimum and near-optimum results, respectively. This mathematical approximation may be useful both in practical implementations and analytical studies.   In summary, the optimum configuration for the LoG edge detector as a SAE method is as follows. At low SNR, the best accuracy is obtained when combined with another SAE method as a pre-processing step, adjusting the filter standard deviation according to the experienced SNR as shown in Fig. 14 or alternatively according to the model in (7) with the fitting coefficients shown in Table 3. At high SNR (above -5 dB according to Figs. 12 and 14) the best accuracy is obtained by using only the other SAE method (i.e., without edge detection).

C. ANALYSIS OF THE CANNY METHOD
The Canny method has three configuration parameters: the standard deviation of the Gaussian filter (σ ) and the pair of thresholds for weak and strong edge pixels (λ low , λ high ). To find a suitable parameter configuration for SAE, histograms of the gradient magnitude similar to those shown in Fig. 4 were calculated for standard deviation values within the interval σ ∈ [0.5, 10] and for SNR values within the interval [-20 dB, 5 dB]. Details of the figures are not shown due to the amount of space this would require, however the main findings are summarised here. Compared to Fig. 4, the histograms obtained in this case showed a larger proportion of gradient magnitude values in the lower bottom of the range. Recall that the Canny method applies in its first step a Gaussian filter before calculating the gradient magnitude and applying the thresholds (see Section III-A). This Gaussian filtering step has a blurring effect that de-emphasises sharp gradient changes in the image, thus resulting in an overall reduction of gradient values. Based on the obtained histograms, the two threshold values identified in Section V-A were slightly reduced for the Canny method to λ low = 0.05 (to isolate pixels with zero-gradient belonging to the image background) and λ high = 0.7 (corresponding to the gradient magnitude of strong edge pixels after the initial Gaussian blurring step).
Once the thresholds (λ low , λ high ) are configured, the performance of the Canny method as a SAE method depends on σ in a largely similar manner as the LoG edge detector and the same main conclusions are reached (all figures are not shown to avoid repetitive results, however the main conclusions are summarised here). In particular, the optimum value of σ that yields the best attainable accuracy increases when the SNR decreases, both when used as a standalone SAE method and in combination with other SAE methods such as CT-SA and SSA; moreover, the latter achieves better accuracy than the former, also when the Canny edge detection plus flood fill are used as a pre-processing stage to other SAE method. The main difference between the Canny and LoG edge detectors when used for SAE, as it can seen by comparing Fig. 15 with Fig. 12, is that larger standard deviations need to be used for the filter with the Canny method (σ opt ∈ [3, 6.5]), which can also be explained based on the blurring effect of its initial Gaussian filtering step. This is corroborated in Fig. 16, which shows the optimum standard deviation (σ opt ) that maximises the F1 score for each SNR with the Canny edge detector (this figure is the counterpart to Fig. 14 and has been obtained following the same procedure; the corresponding fitting coefficients for the model in (7) are provided in Table 4). Another relevant difference is that with the Canny method it is not   possible to cover the whole SNR range with a small set of σ opt values (the optimum value is different for each SNR).
Based on the results above, the optimum configuration for the Canny edge detector as a SAE method is similar to that of the LoG edge detector. At low SNR, the best accuracy is obtained when combined with another SAE method as a pre-processing step, adjusting the filter standard deviation according to the experienced SNR based on the model in (7) with the fitting coefficients shown in Table 4. At high SNR (above -5 dB according to Figs. 15 and 16) the best accuracy is obtained by using only the other SAE method alone.

D. COMPARISON OF DIFFERENT EDGE DETECTION METHODS
The previous subsections have explored the performance of the three main edge detection algorithms when used along with flood fill as SAE methods. In all cases it has been observed that they lead to an overall accuracy degradation at high SNR but can provide significant improvements at low SNR. Moreover, the best accuracy improvement at low SNR is obtained when combined with other SAE methods (such as CT-SA and SSA) as a pre/post-processing stage. The optimum configurations at low SNR have been determined for each edge detection method. In particular, the use of gradient-magnitude methods is controlled by a set of three SNR switching thresholds (γ l , γ m , γ h ), while for the LoG and Canny methods the standard deviation of the corresponding filters is adjusted according to the experienced SNR. Based on these optimum configurations, the three methods are compared in Fig. 17. This figure shows the best accuracy that can be attained by each method when the optimum configuration is employed in each case (the results correspond to the combination with CT-SA but similar results are obtained when combined with SSA). The obtained results show that the considered SAE approach can provide significant accuracy improvements in the lower SNR regime compared to the application of the CT-SA method alone, thus effectively extending the SNR sensitivity of existing SAE methods. Concretely, it can be observed that the performance is very similar for SNR values above a certain threshold (above -6 dB in this case). However, for SNR values below this threshold, the performance of the CT-SA method degrades abruptly, providing accuracy levels of ≈30% at -10 dB SNR, ≈8% at -15 dB SNR and ≈5% at -20 dB SNR. On the other hand, the proposed approach is more robust under degraded SNR conditions, providing a significantly better performance. In the best case, which corresponds to the use of the Canny edge detector, the SAE detection accuracy can reach up to ≈75% at -10 dB SNR, ≈50% at -15 dB SNR and ≈43% at -20 dB SNR, which represent absolute performance improvements of 45%, 42% and 38%, respectively. This improvement is obtained at the expense of an increased computational cost, which can be quantified in terms of the computation time as illustrated in Fig. 18. The largest increase in the computation time is observed at low SNR, which increases from a minimum of ≈2 ms for the CT-SA method alone to a worst-case maximum below 5 ms for the Prewitt and LoG edge detectors and below 6 ms for the Canny edge detector. The higher computation time observed at low SNR for the proposed approach can be partly attributed to the additional calculations required by the edge detection and flood fill operations but also to  the detection of a higher number of SA components, which also increases the computational workload for the CT-SA method applied afterwards. It is also worth noting that these computation times were obtained with a general purpose processor in an off-the-shelf desktop computer and using code that was not specifically optimised for performance. A commercial system implementation would be expected to provide significantly reduced computation times. As it can be appreciated in Figs. Fig. 17 and 18, the Canny method provides a slightly higher accuracy than the other two edge detection methods, which could be explained by its ability to reconnect edge fragments that have been disconnected due to noise degradation, and this is also associated with a slightly higher computation time. Fig. 17 also validates the obtained simulation results by comparing with their counterparts based on hardware experiments, which demonstrates the ability of the proposed SAE strategy to achieve significant accuracy improvements in practical system implementations.

VI. CONCLUSION
Several methods have been proposed in the literature for SAE in radio spectrograms, however their performance degrades significantly in the low SNR regime. In this context, this work has proposed a novel approach for SAE based on the use of two well-known techniques from the field of image processing, namely edge detection (to identify the edges of potential SAs) and flood fill (to fill the area inside the estimated edges). The performance of three popular edge detection methods (gradient magnitude, Laplacian of Gaussian and Canny) has been assessed under a broad range of configuration parameters and a suitable SAE strategy has been formulated for each edge detection method. The obtained simulation results have shown that the proposed SAE approach based on edge detection plus flood fill can improve significantly the performance of existing SAE methods in the lower SNR range when used as a pre/post-processing step, thus effectively extending their operational SNR range. The accuracy improvements observed in simulations have been corroborated with experimental results.
The findings of this work indicate that the two considered techniques from the field of image processing (edge detection and flood fill) have a great potential to improve the accuracy of SAE in radio spectrograms and suggest that other image processing techniques may equally provide substantial performance improvements as well. The investigation of other image processing techniques and their suitability to the problem of SAE will be explored in future work.