Singular spectrum analysis filtering and Fourier inversion: an efficient and fast way to improve resolution and quality of current density maps with low-cost Hall scanning systems

We provide a Biot–Savart inversion scheme that, for any two-dimensional, or bulk with planar crystallization, high-temperature superconducting (HTS) sample, determines current density maps with a higher resolution and accuracy than previous procedures and at a fraction of its computational cost. The starting point of our scheme is a Hall scanning microscopy map of the out-of-plane component of the magnetic field generated by the current. Such maps are noisy in scans of real samples with commercial-grade equipment, and their error is the limiting factor in any Biot–Savart inversion scheme. The main innovation of our proposed scheme is a singular spectrum analysis (SSA) filtering of the Hall probe maps, which cancels measurement errors such as noise or drifts without introducing any artifacts in the field map. The SSA filtering of the Hall probe data is so successful in this task that the resulting magnetic field map does not require an overdetermined QR inversion, allowing Fourier inversion of the Biot–Savart problem. Our implementation of SSA filtering of the Hall scan measurements, followed by Biot–Savart inversion using the fast Fourier transform (FFT), is applied to both simulations and real samples of HTS tape stacks. The algorithm works in cases where ill conditioning ruled out the application of Fourier inversion, and achieves a finer resolution for a fraction of the cost of the QR inversion used to date. The computation passes physical and statistical validity tests in all cases, and in three-dimensional samples it is shown to yield the average, with a depth-dependent weight, of the current density circulating in the different layers of the sample.


Introduction
The growing success and applications of high-temperature superconducting (HTS) bulks and long tapes make ever more interesting the resolution of the inverse Biot-Savart problem on them, i.e. finding maps of their circulating current from measurements of the magnetic induction field around them, as a precise, nondestructive quality control procedure.
It is well known that, for currents induced in planarly crystallized HTS blocks, stacks and tapes by both external magnetic fields and current carrying conditions, Hall scan mapping of the out-of-plane component of the trapped magnetic field allows the determination of the distribution of the currents if one can solve the inverse Biot-Savart problem posed by this field. Research in this topic has been conducted for two decades in order to be operative not only for research but also in the standard characterization of HTS supplies manufacture ( [1][2][3][4][5][6][7]). Researchers have been studying this problem for years ( [8][9][10][11][12][13][14]), and have identified the main limiting factors of this approach to be, in order of importance: the propagation to the computed map of currents of inaccuracies in the magnetic field measurements, the computational cost in time of the inversion, and the amount of required memory. The cost in terms of time and resolution for obtaining a useful map of the critical current density distribution, and the mechanical complexity of the data collection and mathematical treatment have led our research to develop and incorporate new enhanced procedures to obtain high-resolution, reliable and accurate current maps in static and dynamic conditions by using lowcost but very robust hardware components.
The advances we report in this work are mathematical and statistical in nature, and they have led to a significant improvement in the use of low-cost, commercial-grade Hall scanning systems. We have found that the filtering of the magnetic field measurements, on the basis of the novel technique of singular spectrum analysis (SSA), produces a greatly improved reduction of error, without introducing artifacts, in the Hall probe measurements when compared to filtration with previous techniques. Even when the inversion problem has a high resolution and is not well conditioned, this technique allows Biot-Savart inversion by means of a fast Fourier transform (FFT) procedure with a significantly reduced computational cost, yielding maps of electrical currents with finer resolution and greater accuracy compared to previous inversion procedures.
The authors have implemented for MATLAB and Octave this SSA filtering technique, complete with Fourier inversion of the Biot-Savart problem for two-dimensional or planarly crystallized HTS materials, further SSA improvement of the achieved solution, and a double physical and statistical test of the margin of error of this computation.
The purpose of this work is to document and discuss this inversion procedure. It is illustrated by applying the algorithm on simulated, inhomogeneous along the OZ axis samples, where the averaging effect of the algorithm is checked, and to real samples where we obtain detailed maps of the planar current density, pointing out the location of current inhomogeneities caused by defects in the sample.

Discretization and QR inversion
The critical current density J circulating in an HTS tape or bulk sample S is the rotational of the magnetization M supported in the sample (see the appendix in [2]). This current creates outside the sample a static magnetic induction field B through the Biot-Savart law which can be determined by measurement with a Hall probe. The determination of the magnetization M, or equivalently of the current density J = ∇ × M, constitutes the inverse Biot-Savart problem.
The inverse Biot-Savart problem can be solved in HTS samples that are thin films by the linearization algorithm that was originally introduced in [1], and was extended to bulks with planar crystallization by the authors in [8][9][10]: subdivide the sample in a rectangular grid of m × n small elements ∆ ij , assume that the magnetization has a constant value M ij on each element, measure the vertical component of the magnetic induction field B z on a second rectangular grid of points above the sample, and the Biot-Savart law (1) turns into a linear system of equations with coefficients that can be computed from the geometry of the problem, according to (1) The authors' sample discretization and linearization of the Biot-Savart inversion is illustrated in figure 1. By reading them column-wise, the rectangular tables of values formed by the magnetization values M ij , respectively the magnetic field measurements B z (P kl ), may be reshaped into column vectors M, respectively B z . The set of equations (2) then becomes a linear system where G is now a rectangular Toeplitz matrix, i.e. it has coefficients G rc = G ijkl for any i, j, k, l such that k − i = r, l − j = c, and the independent term B z can be measured, e.g. with a Hall probe.
The key to the extension of this linearization to bulk samples is planar crystallization, which means that the current density J in the bulk sample is still planar, i.e. the magnetization M only has a vertical component M. One must further assume that the magnetization M, or equivalently the current density J = (J x , J y , 0) are constant along the vertical axis z, i.e. they are the same in all planar layers and do not depend on z.
The hypothesis of homogeneity along the vertical axis z is plausible in the case of thin samples. It does not hold in the case of thick bulks, even if they have planar crystallization ( [15]), but in such cases the homogeneous extension of the algorithm returns the average along the z-axis of the current density J, averaged with a weight function w(z) = 1 h−z . Here h is the height of the measurement of B z above the sample top, the sample with thickness g ranges from z = −g (bottom) to z = 0 (top), so h − z is the depth of the layer with respect to the Hall probe. This is a well-posed problem because the Biot-Savart problem is invertible for such z-homogeneous currents, and is still informative of the position of defects in the sample (see [11,12] and the simulations in section 3.3).
Let us recall the conclusions of the error analysis for linear Biot-Savart inversion schemes from [9], as they will be reinter preted in section 3.2.
The initial step at which errors appear, and should be limited, is the measurement of the magnetic field B z . This source of error turns out to be the limiting factor for the resolution at which the current maps can be computed, so it pays to make the measurement system as precise as possible.
The propagation of relative error from the independent term B z of the system (4) to its solution M is bounded by a factor called the condition number of the system matrix, cond(G) (see [16]): where M, B z over their respective grids are written as column vectors, ∆M, ∆B z are the vectors formed by the error at each term, the norm . is the standard Euclidean norm, and c is the actual factor by which the relative error is multiplied when the system is solved. The analysis in [9] for inverse Biot-Savart systems (4) shows that the error factor cond(G) depends chiefly on: (i) The size of the elements into which the sample has been subdivided, as illustrated in table 1. (ii) The distance from the sample to the grid where the magnetic induction field B z has been measured, as illustrated in table 2. Discretization scheme: subdivision of a region containing the sample in a rectangular/orthoedrical grid (blue), and Hall probe measurement in a second rectangular grid above the sample (red). On the vertical axis, the sample with thickness g and its subdivision both range from z = −g (bottom) to z = 0 (top), while the Hall probe measurement grid is in the plane z = h.  The first factor in the growth of the condition number, its increase as the size of the discretization elements decreases, favors the selection of discretizations of the sample which are coarser than the measurement grid of B z . The resulting linear systems (4) become overdetermined, and better conditioned for it. But Fourier inversion is impossible for overdetermined systems, so even a modest amount of error in the measurement of B z makes Fourier inversion feasible only for current maps with a very coarse resolution.
The second factor in the growth of the condition number, its increase with the distance between the elements in the sample and the points where B z is measured, means that the magnetic field B z ought to be measured as close to the sample as possible. Or, conversely, the increased measurement distance makes it more important to filter away the errors in the measurement of the magnetic field.
On the other hand, the condition number of the system (4) does not change its order of magnitude with the thickness of the sample, as seen in table 2 for a typical discretization grid of 81 × 101 elements, covering a rectangle of size 14 × 20 mm 2 , and with the height of measurement at two likely settings for it on a commercial-grade Hall probe.
All these factors driving the propagation of errors from the measurement of the magnetic induction field to the Biot-Savart inversion to achieve J have led independent implementations of the inversion-by-linearization scheme ( [2,9]) to make the same choices: the selection of a discretization grid of the HTS sample that is coarser than the measurement grid for B z , resulting in an overdetermined linear system, that is solved via a QR (typically Householder) scheme because this procedure minimizes the propagation of error; hence the name of QR inversion applied to these schemes.
This resolution of the linear system (4) is computationally costly, because inversion on an m × n grid requires resolution of a linear system of size (m · n) × (m · n) whose matrix has no zero coefficients, thus the complexity of the problem is O((mn) 3 ) and its memory requirement is O((mn) 2 ), straining the capacity of modern desktop computers even for a 200 × 100 grid.

Fourier inversion
The Biot-Savart formula determining the magnetic field B created by an electrical current J or, equivalently, a magnetization M such that J = ∇ × M, can be seen as a convolution with a Biot-Savart kernel. This convolutional nature is passed to the discretization of the inverse Biot-Savart problem if the discretization and measurement grids are chosen equal, i.e. the linear system (4) is square. The system matrix G then becomes a Toeplitz matrix, and the inversion of (4) can be performed through a discrete Fourier transform and deconvolution scheme developed in [4][5][6].
If one uses the FFT algorithm to perform these (inverse) transforms, the map of the magnetization M, and equivalently of the current density J, is obtained at a dramatically reduced cost: for a discretization and measurement grid of m × n points (respectively with a fixed step ∆x in both dimensions), the QR inversion procedure requires O((mn) 3 ) arithmetic operations to be solved (respectively O(( 1 ∆x ) 6 ) operations), while the FFT is computed in (mn) log(mn) operations. Moreover, the QR inversion needs to store (mn) 2 coefficients (respectively O(( 1 ∆x ) 4 ) coefficients) for the matrix G alone, requiring slower out-of-core algorithms for QR inversion once the memory requirements exceed the computer's capacity (on a current desktop PC computer this limit is reached at around m = n = 250). In contrast, the Fourier inversion algorithm requires only O(mn) variables to be stored in the computer memory.
The Fourier transform is an isometry (see [17]), so its application does not change the condition number (5) of the system. If the coefficients of the Biot-Savart kernel are computed analytically, the only noticeable addition of error of the Fourier inversion compared to QR inversion is the extension by zero of the magnetic induction field map B z in areas where it is just close to zero.
However, the Fourier inversion scheme has succeeded only at relatively coarse resolutions, even when iterative improvements of the solution are added on top of it ( [5]).
The reason for this limitation is that all magnetic induction field measurements, even those made with a Hall probe, come with some amount of error on top of the signal, arising from causes such as background electric noise or gradual drift of the probe's or amplifier's settings. When we perform the Biot-Savart inversion by any linearization scheme (QR, Fourier or any other variant), the rate at which the relative error in the measurement propagates to the solution to the inverse problem is the condition number cond(G) of formula (5). Table 1 shows an instance of how this propagation factor grows exponentially with the size of the discretization grid: if we conduct a typical Hall probe measurement above the sample with a relative error of 0.1%, any linear Biot-Savart inversion with a 41 × 53 measurement and discretization grid will have a relative error of at least 10% (even if the inversion procedure is completely accurate). Biot-Savart inversion for a 81 × 101 grid measured to the same accuracy comes with a relative error of 3500%. This is the mechanism through which the accuracy in the measurement of the magnetic field becomes the limiting factor for the quality of the Biot-Savart inversion. QR inversion can mitigate this problem by making the system (4) overdetermined, which lowers cond(G) for a fixed current map resolution, but Fourier inversion has no way to navigate around this difficulty and can work on a fine resolution only if the measurement of the magnetic field B z can be made much more accurate than as originally made by a commercial-grade Hall probe.

SSA filtering
The natural solution for improving the accuracy of Hall probe measurements without increasing their cost and complexity is to filter the raw output of the probe. Traditional filtering techniques, such as averaging or frequency filtering in Fourier space have had a limited success on Hall scans, because their sources of error are diverse in characteristics such as amplitude, frequency or basic shape.
Because of this, authors have introduced the technique of SSA filtering in Hall probe measurements. SSA is suited to the separation of trend (that is, the true signal) and noise even in the case of superposition of several types of noise, both periodic and nonperiodic. See [18][19][20] for a description of the technique. SSA was developed for the analysis of climatological data, and has recently been applied with success to the filtering of sensor signals in mechanical engineering ( [21,22]).
SSA analysis of a sequence of equispaced numerical observations, which we will treat as a row vector {B 1 , B 2 , . . . , B N }, is performed as follows: First, choose a window length l to obtain the trajectory matrix: an array M that has l rows, copies of the original vector of observations with a delay ranging from 0 to l − 1, Next, perform the singular value decomposition (SVD, see [16]) on the trajectory matrix M. In the cases of our interest it will turn out that the singular values of the trajectory matrix decrease very fast.
Afterwards, perform the eigentriple grouping: select a subset of singular values, which in our case will be just the first k ones, the only ones not close to zero. Set all other singular values to zero, and this is the SVD of a matrix M, which is the matrix of rank k that most closely approximates the original M.
Finally, perform diagonal averaging: the matrix M is an approximation of the trajectory matrix M but, while M has coefficients M ij = B m constant over each antidiagonal {(i, j)|i + j − 1 = m} as seen in (6)  This resulting vector is the filtered signal (or trend), and the difference between it and the original vector of observations will be considered noise, and discarded.
Our SSA filtering will depend on two parameters: the window length to be used in each series of measurements, and the number of eigentriples k, which is the number of singular values that we will preserve. The selection of singular values can be more complex in a general SSA filtering, but our experimentation has shown that in Hall probe measurements the first singular values of the SSA trajectory matrix correspond to the signal, and the last ones to the noise, with a marked decrease in size ( [20]).
In our inverse Biot-Savart problem, the original measurement B z has the structure of a two-dimensional array coming from the rectangular grid of points at which the magnetic induction field has been measured. If a Hall probe has been used, the role of the two dimensions is not symmetrical because the rows correspond to successive measurements of the probe, while between a measurement and its following neighbor along a column a whole row of measurements of the probe has taken place, leaving more time for slow mechanical or electrical shifts.
Because of this, we have performed our SSA filtering on the Hall probe measurements of B z on a rectangular grid by the following method: (i) Perform SSA filtering on each row of the matrix of measured B z . (ii) Zero-level correction: for each SSA-filtered row, move its values linearly so that they become zero at the beginning and end. In this way we correct long-term shifts in probe settings. This step requires the field B z to be measured far enough from the HTS sample so that its approximation by zero is accurate. (iii) Perform SSA filtering on each column of the row-filtered and zero-levelled matrix of B z .
To ensure the consistency of this scheme, the two SSA parameters of window length l and number of eigentriples k have to be kept constant for the filtering of all rows, and then constant again for the filtering of all columns.
The optimal values for l, k have been determined experimentally in [20] from a set of measurements on HTS tapes and stacks of tapes with thickness up to 1 mm for which the inverse Biot-Savart computation of M and J has been performed by overdetermined QR inversion. The measure of success was the proximity between the Fourier-inverted and the QR-inverted M, the latter often being available with a coarser resolution.
It turned out that the optimal values for the SSA parameters were window length l = 20 and number of eigentriples k = 4, both for row and for column filtering. Modest deviations from these values for l, k give very similar results, which indicates the stability of this filtering technique.

Computation of current density by Fourier inversion
The algorithm based on the SSA filtering of B z described in section 2.3 and Fourier inversion as explained in section 2.2 have been implemented by the authors as a MATLAB program, with 100% compatibility with its GNU licensed clone Octave. It has been run on a typical desktop PC computer with a 2 GHz CPU and 8 GB RAM memory. The Biot-Savart inversion itself is performed in under 1 s, and the available memory supports computation on grids of size 400 × 400 and larger. Our verification of the margin of error of each computation follows a double procedure explained in section 3.2 which requires no additional memory but takes a longer time, typically about 30 min for a 200 × 200 inversion.
The authors have implemented our SSA filtering from scratch as a MATLAB/Octave program to ease its two-dimensional application. For the SVD decomposition of the trajectory matrix and for the two-dimensional (inverse) FFT the routines available in MATLAB or Octave are used.
The scheme that our program follows for a Biot-Savart inversion is: (i) SSA filtering of measured two-dimensional table of B z , as described in section 2.3. (ii) Computation of the discretized M from the filtered B z by Fourier inversion, applying the FFT, deconvolution and inverse FFT steps of the algorithm introduced in [5]. (iii) Cropping of the edges of the discretized M, which are away from the sample and thus any nonzero value on them is spurious, and SSA filtering of the resulting M to denoise it, with the same procedure and parameters of section 2.3. (iv) Computation of the current density as the rotational J = ∇ × M, following the four-point difference scheme of [9] (i.e. bilinear interpolation and evaluation of derivatives at the element's barycenter).

Validation of the computation and error analysis
After each Biot-Savart inversion, a double strategy is followed in order to validate the obtained current density map J and estimate its margin of error. First, we wish to estimate the margin of error that our computed magnetization field M has. As explained before, the coefficients of the matrix g are computed analytically, so this error arises from the error in the measured and filtered B z by propagation from the independent term to the solution of the linear system (4).
As indicated by formula (5), this margin of error is bounded by the condition number of the Biot-Savart matrix G of (4). The use of Fourier inversion poses a problem: we do not compute the full matrix G of size mn × mn for an m × n discretization grid, but only the auxiliary matrix g whose size is 2m × 2n. The size of the matrix G makes the computation of its condition number on the computer used for the inversion unfeasible, and the fact that G is Toeplitz does not provide a sufficient simplification of the problem, so the authors have chosen instead a statistical approach to estimate the margin of error of the inversion (4).
The statistical approach to condition number estimation is as follows: create a large sample of random errors ∆ 1 B z , . . . ∆ N B z , which are possible perturbations of the independent term in system (4). The resulting linear systems have the solution i.e. their solution is the original solution of our inversion, M, with an added error ∆ i M, and the factor by which the relative error has been multiplied in the step from B z to M is for each perturbation (compare to equation (5)) Due to the central limit theorem, the error factors c i follow a Gaussian distribution when the amount N of perturbations is large. Therefore, we can find the average c and standard deviation σ c of the factors c i in the sample, and establish intervals of confidence for the factor c regulating the propagation of error from the original measurement of B z to the computation of M, defined in (5). Verification for smaller Biot-Savart matrices G ( [20]) has shown that this average value of the propagation of error c in random perturbations has the same order of magnitude as the condition number of the matrix G, which is by definition the maximal possible value for this propagation factor. In this way, by running our fast inversion scheme a few hundred times with uniformly distributed random perturbations added to the measurement of B z , we obtain the order of magnitude of the propagation of relative error from B z to M, and upper bounds within prescribed confidence limits for its actual value.
Finally, we compute the vertical magnetic induction field B z that the obtained current density J would produce. This magnetic induction field is obtained applying the Biot-Savart law, assuming that the current density vector J = (J x , J y ) is constant throughout each element in the discretization. The interest of this computation lies in that its starting point is the final map of the current density J, so comparing the originally measured and recomputed magnetic induction fields B z , B z shows whether the cropping of spurious values of M at the edges of the grid, the SSA filtering of the cropped M, and its numerical differentiation to obtain J have introduced any errors after the inversion from B z to the original values of M.

Computations on simulated samples
To perform an initial test of our algorithm, we have applied it to two simulated bulk HTS samples with geometry and size similar to that of a stack of tapes, both of them with a circulating current that is neither regular nor homogeneous along the z-axis. The results and expected margin of error of the computations are compared with the original data.
First, we have simulated a bulk HTS sample with dimensions 12 × 60 × 8 mm 3 , subdivided along its 8 mm thickness in four layers: layers 1 and 4 are 0.8 mm thick slices at the bottom and top of the bulk, where a regular domain of current with homogeneous density 1.2 × 10 8 A m −2 has been imposed. Layer 2 is second from the bottom, has a thickness of 3.2 mm, and has a single domain of current with density 10 8 A m −2 and a 6 × 20 mm 2 rectangular hole along all its thickness and asymmetrically placed where there is no current. Layer 3 has a regular domain of current with density 10 8 A m −2 . See figure 2(a) for this assumed distribution.
Each layer is discretized in a rectangular grid with 120 × 300 elements in which M is assumed to be constant, and by analytic integration of the Biot-Savart law and sum over all elements and layers, the vertical component B z of the magnetic induction field that the imposed current density would generate is computed in a new rectangular grid of size 100 × 200 points, with size 36 × 120 mm 2 , centered on our simulated sample, and at a height of h = 0.4 mm above it.
To test our SSA filtering procedure, the computed magnetic field B z is degraded in three realistic ways, with a magnitude comparable to that observed in real measurements: (i) A drift in the settings of the measuring probe is simulated by considering the rectangular table of values of B z as a list, in the order in which a Hall probe would read them, and we add to each value a drift term that grows linearly over this list, from 0% to 4% of B z,max , the maximal value of B z in the original table. (ii) A noise term, which is a normally distributed random variable with average 0 and standard deviation Bz,max 500 . (iii) After adding the drift and noise terms to B z , we perform a rounding of the resulting values to the nearest multiple of 0.035 Gauss to mimic the resolution of our Hall system on a typical measurement.
The information fed to the authors' program consists simply of the grid of degraded values of B z shown in figure 2(b), their x, y coordinates, their height above the sample and the total thickness of the sample. These data are first SSA-filtered, and  figure 4, showing how the computed current J is in good agreement with the weighted average of the assumed J over all the sample's thickness. The hole without current in a deep layer is averaged with the regular current in the other layers, resulting in a current map with lower density and loops which are indented on both sides of the tape; on the left half of the domain because the location of the deep hole there decreases the current, and on the right half because the layer with a hole has a returning current with opposite sign to that of the other layers for the entire central quarter (see current map of layer 2 in figure 2(a)), which has an effect similar to that of the hole on the averaged current density as shown by the dotted current lines in figure 4(a).
After 1000 random perturbations of the independent term B z in our Biot-Savart inversion, the factor of propagation c of the relative error from the magnetic field B z to the magnetization and current density M, J (the statistical version of the condition number presented in equation (5)) is found to follow a normal distribution with average c = 26.31 and standard deviation σ c = 0.26. Thus the relative error in M is that in B z multiplied by a factor c which with 95% confidence is below 26.83, and the 6σ bound for the error propagation factor of the system is 27.87.
We can check our computed error bound by comparing the current density J obtained by our Biot-Savart inversion scheme with the original currents that have defined the simulation, averaged with a weight function 1 h−z where h − z is the vertical distance between each layer at a height z and Hall probe measurements at height h above the sample. This comparison at a transversal section of the simulated sample, slicing through its middle the hole in deep layer 2, is summarized in figure 4(b), which shows only the J y component because the simulated current had J x = 0 in all layers, and the computed current has J x of a value of two orders of magnitude below J y . Figure 4(b) also illustrates the aggregated nature of the error bounds that we provide through the condition number: the difference between the correct averaged current density and that obtained by our inversion procedure is about 10% in the core of the areas where the current is regular, but leaps to a relative value of 30% at the edges where discontinuities happen (edges of the tape, of the hole, transition points where the current inverts its sense of circulation).
Finally, by integration of the Biot-Savart law we compute the vertical magnetic field B z generated by the z-homogeneous current density J that our Fourier Biot-Savart inversion has found, and find that its difference in value with the magnetic field B z generated by our multilayered simulation is less than 0.5% above the sample.
A second interesting test is another simulated bulk HTS sample with dimensions 12 × 60 × 8 mm 3 , subdivided along its 8 mm thickness in two layers of equal thickness 4 mm, with an imposed circulating current as shown in figure 5(a).
Each layer has a crack, i.e. a segment going orthogonally from the y-edge of the rectangle to its central axis of symmetry. The cracks on the bottom layer, respectively on the top layer, are situated on the left-hand side of the rectangle, respectively on the right-hand side, and at 1/4 and 3/4, respectively, of the y-length of the sample. Each layer has a single domain of current, with homogeneous density 10 8 A m −2 , which circulates around each layer avoiding its crack. Thus the inhomogeneity in the current J along the z-axis lies not in its density, but in its direction.
With these starting data we perform the same computations as for the first simulated sample: discretization of each layer as a rectangular grid of 120 × 200 elements over which M is assumed constant; computation of the vertical magnetic field B z generated by this discretized current on a 100 × 200 rectangular grid covering a 36 × 120 mm 2 rectangle at a height of 0.4 mm above the sample; degradation of this field with the same parameters as for the first sample; SSA filtering of the degraded B z values ( figure 5(b) shows the map of the resulting magnetic field); and Fourier inverse computation to obtain the maps of M and current (density and current lines shown in figure 5(c), where the latter are compared to lines of the weighted z-average of the originally imposed current).
As in the case of simulated sample 1, the current density J that has been found has current lines in close agreement to those of the 1 h−z -weighted average along the z-axis of the originally imposed current, as seen in figure 5(c). The average of the originally imposed current has homogeneous density 10 8 A m −2 , and, as figure 5(c) shows, the current density J that our Biot-Savart inversion procedure has found has a margin of error below 10% in the stretches where the current is straight and homogeneous, and up to 20% in the regions where the current has inhomogeneities and sudden turns. The magnetic field B z that the obtained current density J would generate according to the Biot-Savart law differs by less than 0.5% from the B z fed to the inversion algorithm above the sample.
The second simulation clarifies a point already apparent in simulation 1: our inversion procedure yields the average of the current density over the z-axis, with a weighing average 1 h−z which is the inverse of the depth of each horizontal layer at a fixed value of z (for a sample with thickness g, z ranges from −g at the bottom to 0 at the top). This means that, in thick samples such as our simulations, current defects in superficial layers with small depth are detected much more clearly than defects in deep layers, which makes a small contribution to the average. This difference in effect between irregularities in superficial and deep layers is not introduced by our algorithm, but is already present in the weight-averaged current that is sought, and even in the magnetic field B z , as figures 5(b) and (c) illustrate. This is one of the manifestations of the impossibility of producing three-dimensional maps of the current J in a thick sample, even when the current is planar (see [11,12]).

Application on real samples
As a definitive test of our Biot-Savart inversion scheme, this has been applied to two real samples, which are stacks, formed by nine layers of HTS tapes. The used tapes were manufactured by SuperPower Inc., with the identification code SF12050. The magnetic field measurements have been done using a Hall mapping magnetometer that we have built for the characterization of superconducting samples. The Hall probe is attached to an XYZ Cartesian displacer driven by stepper motors which determine the mechanical resolution of the scans, with steps of 5 µm in our actual configuration. To obtain maps over the surface of the sample, XY scans are performed, at a fixed height Z, rastering a Hall probe in parallel rows, crossing the tape orthogonally to its main axis. To avoid displacements or misalignments between the plane of the sample and the XY scanning plane, the Hall probe is placed in a flexible strip adjusted to lightly press the sample, thus maintaining the sensor area at a constant distance. For the experiments presented here we used probe CYSJ106C, with an active area of 300 × 300 µm 2 that has a coating layer of 400 µm. The probes are calibrated using a Helmholtz coil. The one used here has a conversion factor of 18.80 V T −1 , for a supply current in the probe of 1 mA. We checked the linearity of the response for supplied currents from 0.5 mA to 10 mA. A Keithley 224 current source provides current to the probe with an accuracy of 0.05% in the range 1 mA-10 mA. An INA111 low-noise instrumentation amplifier is used to read Hall voltage. The Hall mapping system precision is 0.01% for a typical full scale range of 0.5 T.
The first example, which we will call sample L80, is a stack with dimensions 12 × 80 × 0.51 mm 3 . The stack was cooled down in a liquid nitrogen (LN2) bath under a uniform magnetic field of 1 T. Once the sample was cooled, the magnet was switched off and the sample was maintained in the LN2 bath and installed in the Hall measurement system. The vertical magnetic induction field B z generated by this current is measured with a Hall probe on a rectangular grid with 7200 × 250 points, at a height of h = 0.45 mm above the sample, with grid steps of 5 µm in the x (transversal) axis and 250 µm in the y (longitudinal) axis. The measured magnetic induction field already indicates the presence of inhomogeneities in the structure of the sample.
Due to the constraint of error propagation on a very fine grid, and the growth in relative terms as the measurements become closer of the rounding by the probe of measured values, from this measurement we select a subgrid of 240 × 250 measurements by taking one out of every 30 in each row. The resulting grid is subjected to our scheme of SSA filtering. Figure 6 shows the effect of SSA filtering on the original measurement of B z , and the resulting filtered map of B z is shown in figure 7(a). Our Fourier inversion scheme produces maps of magnetization M and current density J with the same resolution of 150 × 250 µm 2 , shown in figure 7(b). The authors' previous attempts at Biot-Savart inversion with our overdetermined QR inversion scheme had reached a current map with a maximal resolution of 242 × 686 µm 2 , and this resolution had required an out-of-core variant of our inversion algorithm working for 26 h on a desktop PC. The propagation of error from the measurement of B z , even after several standard noise-filtering schemes such as averaging or frequency screening, made this resolution unimprovable. changes its size by 1.36% after filtering), the original measurement is smoothed in a way that is more intrinsic to the measurement than other filtering schemes that ultimately impose a priori models. The claim of appropriateness of the filtering is based on the results of the Biot-Savart inversion shown in figure 7(b) which, unlike previous filtering schemes, yields a plausible current map even at a high resolution.
After the statistical study of 1000 perturbations of the inversion we find that the relative error propagation follows a normal distribution with average value c = 284.78 and deviation σ c = 2.15. We conclude that, with 95% confidence, the relative error in the resulting map of M is 289 times the relative error in B z , and the 6σ upper bound for error propagation is 297.71. The computed J is the average, with weight 1 h−z , of the current density along the thickness of the stack. The vertical magnetic field that it generates coincides with the originally measured one with an error of around 2.5% above the sample. The time used by a desktop PC running MATLAB for this computation is 1 s for the SSA filtering and Fourier inversion, and 87 min for the verification of the margin of error of the computation.
From the B z field map, we can deduce that magnetic induction decays in the central region of the sample corresponding to the valley in the field profile, thus showing the presence of a defect along the affected zone. By comparing it with the computed current map, we can observe the large density of the current at the edges matching the high slope of the magnetic induction map at the same edges. The sample remains essentially a single domain, with no current counter-flows at the boundaries of its central valley, and very localized current loops surrounding the magnetic induction field peaks. From the magnetic measurements we can deduce the critical current using the value of the current density in the neighborhood of the tape edges where the full penetration condition is fulfilled. At these lines, the computed current density is 2.8 × 10 8 A m −2 which is in the expected range. It is worth noting that this value corresponds to the so-called engineering current density, which considers the section of the full tape. Considering only the thin (1 µm) layer of the superconductor in each tape, this value should be 51 times larger so the actual current flowing through the superconductor should be in the range of 1.43 × 10 10 A m −2 . Comparing this value with the value given by the manufacturer as a reference, 300 A for the tape, we can deduce the value for the current for reference: 2.5 × 10 10 A m −2 . The difference is within the expected dispersion.
The second example is another stack with dimensions 12 × 30 × 0.51 mm 3 . The sample was field-cooled in LN2, but the magnetic field was produced by two NdFeB magnets aligned along the length of the sample, with the poles facing it at a distance of 0.6 mm from the sample surface ( B z = 0.5 T). In order to study the effect of magnetic gradients, the magnets were aligned alternating their poles. In these experiments the  Hall probe scans were performed at a height of 0.51 mm (equal to the thickness of the sample), and the vertical magnetic field B z was measured on a grid of size 8400 × 250 points, with grid steps of 5 µm in the x-axis and 200 µm in the y-axis. The grid is approximately centered on the sample.
Taking one out of every 35 measurements in each row in order to limit error propagation in the inversion, we produce a 240 × 250 value grid, with steps of 175 and 200 µm in the xand y-axis, respectively. Our SSA filtering and Fourier inversion scheme are run on this measurement, producing maps of the magnetization M and current density J with the same resolution of 175 × 200 µm 2 . Previous attempts at Biot-Savart inversion of this sample with the author's overdetermined QR inversion scheme reached a current map with a maximal resolution of 201 × 313 µm 2 , requiring the out-of-core variant of our inversion algorithm working for 37 h on a desktop PC. As in the case of the previous sample, the propagation of measurement errors even after filtering made this resolution the best available, regardless of the computational time devoted.
The results are shown in figures 8(a) (filtered B z ) and (b) (current J). The error analysis concludes that the relative error in M is, with 95% confidence, the relative error in B z multiplied by a factor of less than 1142. The measured magnetic induction field B z and the one that the obtained current map would produce agree with an error of around 2.75% above the sample.
From the field map, we can observe the presence of two poles printed in the stack, with unique central peaks of 0.083 T and 0.086 T, respectively. The symmetry in both printed poles corresponds to a nearly homogeneous superconductor. Each pole corresponds to a loop of current flowing in the opposite sense to that in the other pole, mimicking the magnetizing field. The current density reaches its maximum only in the central line delimiting the poles, which corresponds to the smaller magnetic field region. The engineering current density is 3.6 × 10 8 A m −2 , corresponding to a current density in the superconducting layer of 1.84 × 10 10 A m −2 . It is well in agreement with the typical values corresponding to the employed commercial tapes ( [23][24][25]).

Conclusions
The SSA filtering and Fourier inversion scheme proposed here can solve the inverse Biot-Savart problem for HTS samples with planar crystallization, obtaining two-dimensional maps of the induced current J from Hall probe measurements of the vertical magnetic induction field B z above the sample. It results in a resolution and accuracy that were hitherto unavailable using commercial-grade equipment, with a computational cost that is only a fraction of that of previous current map-yielding inversion schemes.
After measuring B z at a height of 0.5 mm over the sample, resolutions of 150 × 250 µm 2 have been achieved for the current maps on real samples of cm size. The maps are obtained instantaneously on a desktop PC. The computation provides bounds for its margin of error, showing these maps to be accurate. In the case of samples with nontrivial thickness, the obtained map corresponds to the average, with a weight function 1 depth measured from the height of the Hall probe, of the current density J along the sample thickness. A threedimensional map of current detailing the differences among different layers is unattainable with any linear Biot-Savart inversion scheme ( [11,15]). After accepting this, the thickness of the sample does not pose any additional difficulty to the Fourier inversion.
The initial SSA filtering of the Hall probe measurement of B z is indispensable to reach the obtained resolutions in the current maps. Fourier inversion is a very fast and economic procedure, so it already allows with existing hardware the computation of current maps with a finer resolution. The limiting factor for Biot-Savart inversion is the margin of error in the measurement of B z , which gets multiplied by a condition number to become the margin of error in the map of the current density J. This condition number grows exponentially with the fineness of the map grid, measured in terms of the height at which B z is measured. Therefore, the resolution of the Biot-Savart inversion can be made finer only by a more accurate measurement, closer to the sample, or more efficient error filtering, of B z . Even then, the exponential growth of the condition number of the inversion leaves open the question of whether the resolution of current maps obtained with the SSA filtering and Fourier inversion scheme proposed here can be greatly improved.
In this work we have demonstrated the effectiveness of our combined SSA filtering and FFT inversion scheme for determining current maps in closed circuit samples. The authors are confident that the scheme can be used for the computation of current maps in samples carrying current that crosses their boundary by adapting the discretization strategy of our QR inversion scheme of [14], which already finds current maps in such a current transport situation, but with a lower accuracy and speed than the scheme presented in this work. This approach should avoid most of the noise-like oscillations, and the imposition of symmetry conditions across the boundary of the domain, of the inversion scheme reported in [26]. This topic will be pursued further.