Preprocessing Methods

This module hosts several preprocessing methods that can be used during and before construction of an EADF object.

eadf.preprocess.sampledToFourier(arrData: numpy.ndarray) → tuple

Transform the regularly sampled data in frequency domain

Here we assume that the data is already flipped along co-elevation, rotated along azimuth as described in the EADF paper and in the wideband case it is also periodified in excitation frequency direction such that we can just calculate the respective 2D/3D FFT from this along the first two /three axes.

Parameters:data (np.ndarray) – Raw sampled and periodified data in the form 2 * co-ele x azi x freq x pol x elem
Returns:Fourier Transform and the respective sample frequencies
Return type:(np.ndarray, np.ndarray, np.ndarray)
eadf.preprocess.setCompressionFactor(arrFourierData: numpy.ndarray, numCoEleInit: int, numAziInit: int, numValue: float) → tuple

Calculate Subselection-Indices

This method takes the supplied compression factor, which is not with respect to the number of Fourier coefficients to use but rather the amount of energy still present in them. this is achieved by analysing the spatial spectrum of the whole array in the following way:

  1. Flip the spectrum all into one quadrant
  2. normalize it with respect to the complete energy
  3. find all combinations of subsizes in azimuth and elevation such that the energy is lower than numValue
  4. find the pair of elevation and azimuth index such that it minimizes the execution time during sampling
Parameters:
  • arrFourierData (np.ndarray) – the description of the array in frequency domain.
  • numCoEleInit (int) – number of coelevation samples
  • numAziInit (int) – number of azimuth samples
  • numValue (float) – Compression Factor we would like to have
Returns:

compression factor and subselection indices.

Return type:

tuple

eadf.preprocess.splineInterpolateFrequency(arrFreq: numpy.ndarray, arrData: numpy.ndarray) → numpy.ndarray

Spline Interpolation of Pattern Data in Frequency

Splines!

Parameters:arrData (np.ndarray) – data to pad
Returns:of interpolation splines
Return type:np.ndarray
eadf.preprocess.symmetrizeData(arrA: numpy.ndarray) → numpy.ndarray

Generate a symmetrized version of a regularly sampled array data

This function assumes that we are given the beam pattern sampled in co-elevation and azimuth on a regular grid, as well as for at most 2 polarizations and all the same wave-frequency bins. Then this function applies (2) in the original EADF paper. So the resulting array has the same dimensions but 2*n-1 the size in co-elevation direction, if n was the original co-elevation size.

Parameters:arrA (np.ndarray) – Input data (co-elevation x azimuth x pol x freq x elem).
Returns:Output data (2*co-elevation - 2 x azimuth x pol x freq x elem).
Return type:np.ndarray
eadf.preprocess.regularSamplingToGrid(arrA: numpy.ndarray, numCoEle: int, numAzi: int) → numpy.ndarray

Reshape an array sampled on a 2D grid to actual 2D data

Parameters:
  • arrA (np.ndarray) – Input data arrA (2D angle x pol x freq x elem).
  • numCoEle (int) – Number of samples in co-elevation direction.
  • numAzi (int) – Number of samples in azimuth direction.
Returns:

Output data (co-elevation x azimuth x freq x pol x elem).

Return type:

np.ndarray