Software-Defined Radio Applied to a Shielding Effectiveness Measurement

Abstract This article describes the use of a low-cost softwaredefined radio applied to an Electromagnetic Compatibility (EMC) test. The proposed system is indicated for cases when an autonomous instrument is better suited, i.e., when there is no need for external signal or power connections. As a proof of concept, a metallic cavity has its shielding parameter measured, and the obtained results illustrate the kind of outputs the instrument can provide. Details concerning the hardware and software utilized are mentioned, alongside observed pitfalls and trade-offs. It is an affordable and versatile method, which can replace the traditional use of spectrum analyzers and receivers, especially in precompliance tasks.


I. INTRODUCTION
Metallic enclosures are commonly employed to shield unwanted electronic emissions (EMI) and improve the immunity of systems against external fields [1].The amount of attenuation a shielded room or box offers is a parameter that defines its performance, and it is called Shielding Effectiveness (SE).A reported application involved a metallic box blocking EMI from a computer, as to avoid an eavesdropping attempt [2].Recently, the need for small enclosures has become more common in contrast to large (i.e., room-size) volumes [3].Official existing IEEE guidelines were modified to cover SE measurements of small cavities or boxes [4], defined as objects whose none of its sides is larger than 75 cm.Common methods to evaluate the SE are based on mode-stirred reverberation chambers [5], or anechoic chambers [6].Investigations were also performed to address the shielding quality of metallic enclosures using numerical methods, for instance, Method of Moments (MoM) [1], [7] or Finite-Difference Time-Domain (FDTD) [8].
Pre-compliance has been defined as EMC tests carried out outside of formal accredited laboratories [9].Affordable and fast measurement methods are also important since they reduce the time it takes from inception to the final product.By using in-house alternatives and methods, final tests in accredited EMC laboratories can be shortened, with subsequent reductions in both cost and time-to-the market.Therefore, pre-compliance tests at component and board levels carried out throughout the initial design stages help improve the EMC performance of the designed product [10].Software-defined radios (SDR) are one of the many tools employed in EMC tests, particularly in pre-compliance evaluations, and were investigated in applications such as a cell test CISPR 16-1-1 [11], and also with a high-end SDR used for antenna measurement [12].In [13], a comparison is performed with a low-cost SDR and a professionalgrade EMC receiver, in order to address the limitations and benefits of the former instrument.This article describes a methodology to address shielding measurements where there is no need to pass cables or power cords through the cavity or shielded box, a nuisance due to the coupling channel it creates with external fields and currents.Replacing the spectrum analyzer with an SDR, fed by a laptop, brings other advantages in relation to ordinary RF instrumentation because of the large versatility, allowing activities such as data storing, frequency spectrum computing, filtering, visualization, etc. Python programming language was chosen to control and process the SDR data, due to its large number of existing libraries and easy deployment, independent of the operational system.Besides, it is open-source (i.e., free of cost), with several different integrated development environments (IDE).A test is performed in a metallic cavity, and the impact of its lid left open or closed in the shielding parameter is computed.The laptop and the SDR form an autonomous, versatile measurement system, with the potential to be integrated into complex EMC pre-compliance tests.Section II contains the block diagram of the proposed method, compared to the traditional approach.Software description and observed trade-offs are described in Section III.Cavity measurements are briefly presented in Section IV with SE results shown in Section V.

II. BLOCK DIAGRAM
The comparison between the traditional Spectrum Analyzer and the proposed method is shown Fig. 1, stressing that the latter does not require cables passing to the outside world.An SDR is connected to a laptop, running a Python code controlling RF data acquisition and posterior analysis.The RF generator excites a power amplifier (maximum frequency of 500 MHz, 30 dB gain), which in turn feeds the transmitter coil antenna, located outside the box.Extra amplification is needed because some frequencies are not properly detected inside the box using only the generator (maximum power 20 dBm).Inside the cavity, a similar loop antenna is connected to the SDR coaxial input.The laptop battery allows long acquisition times, since the used SDR draws a peak 300 mA current from the USB port.In case a spectrum analyzer is used inside the box, the shielding is disturbed by AC cables reaching the AC power outlet.Sometimes the spectrum analyzer cannot be inside the box, so it is placed outside, therefore there is a need for another cable (RF) connecting to the RX loop.Alternatively, connectors are used in the box wall to provide power and signal connection inside the box, which in the end operate as apertures, disturbing the shielding efficiency.The concerns about electronic noise emitted by the laptop and SDR set are eliminated because SE is a relative measure.It subtracts the power or amplitude levels with and without shielding, so any energy present in both scenarios is ruled out.Only random variations in the EMI emitted by the instruments during both situations would contaminate the measurement.
Two small loops, 5 cm radii, were constructed with 1.5 mm diameter aluminum wire, with only one turn, wound along a plastic container for mechanical support.Eq. 1 was used to obtain the loop impedance, results shown in Fig. 2, after the S11 measurement, performed in a vector network analyzer: with Z o = 50 Ω.Considering the frequency where the imaginary input impedance crosses the zero, the loop resonates at 60 MHz and 300 MHz, so its reactive character switches from inductive to capacitive, as Fig. 2 shows.The used SDR is a copy of the official RTL unit, which has gained widespread popularity [13] due to its low cost, with several different applications in RF and communications [14].Its main parameters are: • Frequency range: 24 MHz to 1700 MHz.
• Analog to digital converter (ADC): 8 bits, equivalent to a theoretical dynamic range of 49 dB [15].
• Internal LNA with gains up to 50 dB.
• Maximum instantaneous bandwidth of 2.4 MHz.
• Maximum safe input power is approximately 0 dBm.
More sophisticated SDRs benefit from ADCs with more bits (high-end units usually operate with 12 bits), resulting in larger dynamic ranges, as well as wider bandwidths.Frequency stability is also an issue especially with low-cost units, and for that either hardware or software correction schemes are needed in cases where absolute frequency measurement values are relevant.
In order to evaluate the used SDR and contrast it against a spectrum analyzer (Rohde & Schwarz FS315), two different RTL units were tested in terms of reflection loss (S11 parameter) and the noise floor.For the second test, the SDR input was connected to an RF generator, whose power level was adjusted until the level displayed by the computer application was 10 dB above the noise floor.The SDR noise floor for a particular frequency was, therefore, the power level set in the generator subtracted from the 10 dB level.Results are shown in Fig. 3, where both units show similar behavior across the measured range.The spectrum analyzer input shows a better matching than the SDRs, with their input impedance showing a mismatch above 250 MHz, therefore impairing critical measurements due to the reflection losses it imposes.The spectrum analyzer noise level, with the same 1 MHz bandwidth, was found to be -50 dBm for normal operation, and -110 dBm when the high sensitivity option was switched on.It should be stressed that the SDR's internal low-noise amplifiers were switched off.The SDR amplifier was observed to produce harmonics when switched on, therefore its use was avoided (i.e., it was set to 0 dB) unless needed, for instance in case of some measurements with frequencies below 80 MHz.However, when the pure dynamic range is taken into account, the spectrum analyzer admits a much larger amplitude carrier before damage sets in, whereas SDRs are limited to values around 0 dBm.

III. SOFTWARE CONTROL
Many alternatives are possible to adjust the SDR settings, control the data flow and visualize its samples.Some options can be mentioned: • Labview -employs a graphical, block-oriented programming language.Requires a paid license.
Currently, no support for RTL is provided, though Labview has been used with higher-grade National Instruments SDRs, such as the 12-bits USRP [16], [17].
• GNU Radio -also uses a block-oriented programming language, and due to its open-source characteristic has a strong cooperative, knowledge-based network.It contains several signal-processing functions, and customized blocks can be integrated using Python [18].
• Matlab -contains add-ons to operate with some SDRs, such as RTLs.Given its wide options of mathematical capabilities and toolboxes, it is a powerful tool to be considered.However, it requires a paid license [19], [20].
• Python -it has become a popular language [21], counting on a large cooperative ecosystem in different data science fields, it has also libraries and application programming interfaces (API) to control several different SDRs [22].Among its advantages, it operates in several operational systems and is free.Since it is an interpreted language, compilation is not required, therefore variables do not need to be declared in advance and code modifications are easily implemented.
In this study, the rtlsdr library provides the interface between Python and the SDR.Fig. 4 shows the implemented flowgraph, running in the laptop.As to circumvent the narrow RTL bandwidth (2.4 MHz), the following procedure was employed: the user informs the whole frequency band, (from f min to f max ), as well as the instantaneous bandwidth, hereby named samp_rate.This large frequency span is then divided into N segments, according Eq. 2: where N has to be typecast as integer since it will operate inside a loop.So each narrow frequency segment (of bandwidth samp_rate) is swept by the loop, and raw RF samples are acquired and stored.Each one of the N sub-bands has, therefore, the same bandwidth and the same number of bits.
Initial tests stored the acquired data in text format, using comma separated (.csv) files, but they were replaced by numpy binary file format (extension .npy),due to their smaller size and faster read/write operations.In terms of size, each second of data generates an average of 37.5 MB, so the file storage and manipulation imply a certain time delay within the program.Fast Fourier Transform (FFT) operations and spectra visualization within the loop were eventually removed due to synchronization issues the associated delays created.Within the numpy data file, each line contains an 8-bit complex number (since the SDR has a synchronous detection), the distance between consecutive positions in the file is defined by samp_rate −1 i.e., the raw file does not contain any timing information, it has to be created later in the Python code.Once the sweep is finished, numpy files are retrieved and FFT operations are performed, so that the power spectrum of each case is visualized, as a way to identify problems and check whether the receiving antenna operated as expected.
An important observed issue relates to the USB port throughput.Using the maximum RTL bandwidth (2.4 MHz), the sample rate transmitted by the RTL is easily supported by USB ports above 1.0, whose nominal maximum is 1.5 MBPS.However, other SDRs with larger bandwidths, such as HackRF One (20 MHz) or USRP B210 (56 MHz, or twice if the two RF channels are used) can easily lose samples in the USB channel.The missed data are not usually reported in software, so it is only detected if the signal is visualized in the time domain.
A final detail concerns the communication between the user and the enclosed system.Since the cavity is closed, a sound command is issued as a warning to initiate and finalize the measurement.Different beep frequencies or duration can be chosen to communicate the current step within the program.A 5 seconds delay was also inserted, to allow for placing or removing the lid before the actual samples are received.This versatility is an SDR advantage, not allowed with usual RF instrumentation such as spectrum analyzers.
For cases where the bandwidth and central frequency is fixed, unlike the scheme shown in Fig. 4, the waterfall format can be employed, where spectrum evolution is seen over time.The original file in time domain and with the same central frequency and bandwidth, read from the binary numpy file, contains the vector (1D) data, which needs to be broken into small segments (named T ime), according to Fig. 5.Each T ime segment undergoes an FFT operation, whose vector is column-wise stacked into a matrix.In other words, a short-time Fourier transform is performed and the final result is displayed in a matrix format, with the spectra waveforms shown vertically stacked.The user has the option to choose the T ime length, controlled by the chunk variable, which represents the number of samples it contains.The equivalent length of each short-time segment is expressed according to Eq. 3: It was experimentally found that a good result for chunk was 1024, resulting in a time segment of 426 ms for the used samp_rate.It was chosen in terms of computing time, 1024 is a power of 2, which facilitates the FFT routine, and also led to a good visualization taken into account the used signals during the test.It means each spectrum block in the Fig. 5 at the right corresponds to T ime = 426 milliseconds .Increasing the chunk variable leads to a finer frequency resolution, but coarser timedomain representation and longer computing time with Python due to the larger vector to be processed -it is harder to perform FFT than to vertically stack the results in a matrix.In other words, were rapids changes of frequency to be observed, chunk should be decreased, as to improve the frequency resolution at expenses of a coarser time discretization.For signals of transitory nature (intermittent and fast in time domain), instead of a constant carrier here analyzed, chunk should be increased as to enable a finer time resolution to capture the fast signal.

IV. CAVITY
The cavity to be tested is shown in Fig. 6.It uses an Aluminum sheet 1.7 mm thick (skin depth 17 µm at 24 MHz), total volume is 0.13 m 3 .Aluminum offers poor shielding at lower frequencies (kHz range) in contrast to copper [23], but it has a substantially lower cost.Its lid is not mechanically fixed to the cavity body, so the interest is the experimental SE evaluation of the imperfect lid contact.The cavity modes were analytically computed, and compared with those from the CST Microwave Studio model using the Eigenmode Solver.For a rectangular cavity, with dimensions W , L, and H (respectively width, length, and height) the modes f mnp can be found after Eq. ( 4) [24]: Results are shown in Table I.Both the simulation model and the analytical solutions consider perfect (lossless) conducting walls, without any hole or slit from where energy can leak to the external ambient.where P direct and P enclosed are, respectively, the received power (dBm) for the coils disposed in the thru connection and for the receiver placed inside the closed box.Fig. 9 shows the transmitter (TX) and receiver (RX) coils, the SDR, and their placement inside the cavity.The lid is placed once the program starts running and the whole system runs autonomously on the laptop battery.Results are shown in Fig. 10.The cavity shielding decreases with the frequency, with a dip around 250 MHz.The measurement had the SDR internal LNA switched off, and the generator was kept at its maximum 20 dBm power output when the receiver coil was kept inside the cavity, whereas the thru (direct) case the generator power amplitude was stepped down to -20 and -30 dBm as to avoid SDR input saturation.Some frequency points were taken above the cavity resonances, as to explore the maximum power amplifier limit.It should be noted that those points where resonances arise have, however, field patterns that produce maxima and minima along the structure (standing waves), i.e., measured SE is dependent on the excitation positions [9].

B. Cavity lid influence on the SE
Taking into account only the lid influence, an alternative of the SE is used, namely: where P open and P close are, respectively, the received power (dBm) for the open and closed box.It aims evaluating the imperfect electrical contact of the constructed box lid on its SE.The generator output power was set to 14 dBm, value experimentally found as not to overload the input receiver and still be sensitive enough throughout the test, with the exception of few points below 80 MHz that used the generator nominal maximum value of 20 dBm, along with SDR LNA switched on, with gain of 20 or 40 dB, otherwise the receiving amplitude was too faint.Since the SE is a relative measurement, as long as the box with and without the lid is measured with the same conditions this fact is not relevant.Each frequency point generates a 2D waterfall plot and from this 2D matrix data the respective continuous wave (CW) is identified and the SE is found in the 1D plot, as fig.11 illustrates.By observing the spectrum evolving in time, outlier peaks and transients due to the mechanical movement are eliminated, as well as artifacts of the RF detection.Fig. 12 shows the results from diverse points collected across the band.Observed SE peaks can be ascribed to the antenna resonances, as seen in Fig. 2.During the frequency sweep, the DC current fed to the power amplifier peaked at some points (from normal 880 mA to 1 A), indicating the presence of strong reflections.Exploring the capabilities of this proposed method, a waterfall response helps visualize the effect of a mechanical pressure laid on top of the box, performed by a 10 kg weight.It investigates the effect of a better electrical contact between the box lid and the rest of the structure, reducing small gaps and imperfect points of contact.Fig. 13 contains the plot for two tests -with 400 and 500 MHz, 5 seconds total, with the weight removed after approximately 3 seconds.The imposed mechanical pressure helps improve the SE, approximately 3 dB for 500 MHz and 9 dB at 400 MHz.To compare the measured scenarios, an electromagnetic simulation was carried out using CST Microwave Studio Finite Element solver, observing the impact three different gap sizes between the lid and the box have on the internal cavity field.Excitation is performed by a perfect plane wave, and a probe captures the electric field amplitude inside the box, due the imperfect shielding the aperture imposes in the box.Fig. 7 contains the virtual model alongside with the results.This scenario resembles the tested cavity though the gap is considered homogeneous across the lid surface, unlike the real case.Some resonances are seen in proximity to the measurements, namely in the upper range above 400 MHz.Referring to the measured SE global and SE parameters, respectively shown in Fig. 10 and Fig. 12, the minimum shielding effectiveness observed at 250 MHz correlates with the peak amplitude field result from the simulation; cases of gaps 0.1 and 0.05 mm.The virtual model considered a perfect plane wave excitation, unlike the tested coil, which is near the cavity wall and not in farfield condition.Besides it, a constant and homogeneous gap was considered in the CST software, which is not the case for the real cavity.Also, the simulated probe was a single register measuring the field at its specific point in space, differently from the receiving coil placed inside the metallic box, which influences the existing field and electromagnetically interacts with the environment.It indicates that the imperfect lid connection to the cavity body is the main responsible for the imperfect shielding, in the frequency range the system was tested.The observed shielding levels are much lower (worse) than those expected from the material alone seen in Fig. 8.It stresses the importance of providing a measurement setup where these coupling channels to the outside are minimized, particularly power and signal cables.VI.CONCLUSIONS Some advantages and potentials of the method can be summarized:

PRESSURE REMOVED PRESSURE REMOVED
• Does not need to be AC powered, so that the cavity or shielded box can be completely closed.
• Given its software control, the timing and programming of the whole setup can be easily adjusted in several different languages, among them Python.
• It is based on open-source tools, with a much larger cooperative network than those from proprietary instrumentation equipment.
• Costs are much lower than those of spectrum analyzers, the most expensive item in pre-compliance instrumentation [23].
• It operates with different SDR types, operational systems, or programming language, so it can be tailored to known tools and expertise.
• Ample possibilities of post-processing and visualization.
• Easy customization and automation of tests, shortening design cycles.
Disadvantages, in turn, can be mentioned: • SDRs have, in general much narrower bandwidths than spectrum analyzers.
• SDRs sensitivities might also be worse than those of ordinary RF instrumentation.
• The dynamic range of SDRs is smaller than professional instruments.
The first drawback requires sequential sweeps to be performed, which is easily programmed in a high-level language, at expense of a longer execution time.However, it has to be stressed that spectrum analyzer sensitivities are inversely proportional to the sweep time and bandwidth.With regard to sensitivities, they can be increased with amplification, either internal to the SDR or external modules.The system proved nevertheless to offer several advantages, notably in pre-compliance investigations.

Fig. 1 .
Fig. 1.Left, setup using a spectrum analyzer, and right, using the proposed method.

Fig. 2 .
Fig. 2. Real and imaginary input impedance of the loop antenna, with its characteristic shown in the yellow and gray areas.

Fig. 3 .
Fig. 3. S11 (left) and noise floor level (right) measurements of the two used SDRs, shown in the the inset.

Fig. 9 .
Fig. 9. (Left) both coils and the SDR and, (right) laptop, SDR and RX coil placement inside the cavity, top view.

Fig. 11 .
Fig. 11.40 MHz measurement, 2D (left) and 1D (right).The instant when the lid is removed is shown in both figures.An artifact is identified at the green ellipse, on the 1D plot.

Fig. 12 .
Fig. 12. Measured SE of the cavity.Shadow rectangle limits the FM broadcast range, which was not tested.

Fig. 13 .
Fig. 13.Waterfall diagrams for the box opened, excited by 400 MHz (left) and 500 MHz (right) and at the bottom, both frequencies shown in cartesian plot.

gapFig. 14 .
Fig. 14.Simulation setup (top) and normalized electric field amplitude inside the cavity (green arrows), with three different gap dimensions.

TABLE I .
SIMULATED AND ANALYTICAL MODES, UNIT[MHZ]