kicad2ems.core.radiated¶
kicad2ems.core.radiated - what the radiated EMC questions share (the
susceptibility, kicad2ems.core.susceptibility; the emission,
kicad2ems.core.emission): each port's far field on the board, the spectra a
port is driven with, CISPR 32's radiated limits and the test site's geometry.
The ports' fields. On mom25d (PortFields.solve) the board is solved at each
frequency for a 1 V source at each port with the others shorted (one factor,
every port's currents: mom25d's excitation), and the port currents Y. With
loads Z (each port's reference impedance, or --load), a source V_s at port j
behind its load and the others loaded is
V = (1 + Z Y)^-1 V_s, I_term = I (1 + Z Y)^-1 (columns: ports)
so each port's terminated currents per unit source volt are one product, and
their far field r E (mom25d.farfield.far_field_dirs) the field per volt. An
antenna run's array file (<name>_<solver>_array.npz: kicad2ems.core.phased;
mom25d's per unit port voltage with Y, an FDTD solver's per unit incident wave
with its ports in their references) gives the same at its own frequencies and
directions (PortFields.load).
Reciprocity (susceptibility). A plane wave E0 p arriving from the direction
(theta, phi) puts on port j, its load z_j and the other ports loaded as above,
V_j = 4 pi / (j k0 eta0) z_j E0 (p . F_j(theta, phi))
F_j: r E of port j's terminated field per unit source volt (Lorentz
reciprocity between the gap source and a far dipole; the image of the ground and
the other ports' loads are in F_j). A short element h above the ground with its
image: V = E0 2h sin(theta) z / (z + Zin), its open-circuit voltage E0 h_e sin
theta (h_e = 2h) through its load; per incident wave a (matched loads) the
received wave is |b_j| = 2 pi E0 |F_j^a| / (k0 eta0), which is P_r = S A_e with
A_e = lambda^2 G_r / 4 pi (G_r the realized gain): Friis.
The test site (emission). The board at h_eut over the floor, the antenna at
distance d and height h; a turntable turns the board about the vertical; the
board stands in an orientation (its top up: 'flat'; on an edge; upside down).
Below 1 GHz the floor reflects (a semi-anechoic room or an open site, CISPR
16-1-4): the field at the antenna is the direct ray's and the floor's image's,
E = F(u_d) e^{-j k L_d} / L_d + R F(u_r) e^{-j k L_r} / L_r,
R = diag(-1, -1, 1)
u_r the ray to the floor's reflection point (the image of a PEC floor: its
horizontal field reversed); above 1 GHz the floor is covered (FSOATS) and only
the direct ray arrives. The antenna takes the vertical (E_z) and the horizontal
(E across the line of sight) polarisation; the largest over the turntable, the
heights and the polarisations is held, as a receiver's max hold.
The board alone radiates: what it is connected to (cables, which most often
dominate a product's emission and its immunity) is left out, and over mom25d's
infinite ground nothing radiates below it, with no board edge.
- class kicad2ems.core.radiated.Grid(theta, phi, E)[source]¶
A far field (r E, Cartesian: (k, ntheta, nphi, 3)) on a theta x phi grid (degrees: theta ascending from 0, its steps as grid_angles makes them; phi over 360 by its step), interpolated bilinearly in its Cartesian components (smooth at the poles, where theta and phi's unit vectors are not), zero past its last theta (the lower half over an infinite ground).
- class kicad2ems.core.radiated.PortFields(names, loads, lower, engine, freq=None)[source]¶
Each port's far field per unit source volt, its load and the others' on theirs: from mom25d (solve) or an antenna run's array file (load). pf = PortFields.solve(settings, fmin, fmax) # mom25d on the board F = pf.grid(f, step=5) # Grid: (n ports, ntheta, nphi, 3) F = pf.grid(f, step=3, drive=w) # the drive w (source volts per port)- grid(f, step, drive=None)[source]¶
Grid of each port's r E per unit source volt (drive None: (n, ...)) or the drive's (source volts per port: (1, ...)) at f.
- classmethod load(path, loads=None)[source]¶
An antenna run's array file (kicad2ems.core.phased: mom25d's or an FDTD solver's): its frequencies and directions, the ports in their references (an FDTD run's) or any loads (mom25d's Y).
- class kicad2ems.core.radiated.Signal(kind='clock', f0=None, amp=1.0, rise=1e-09, duty=0.5, rate=None, prbs=7, path=None)[source]¶
What drives the board: lines (f, RMS volts) or a continuous spectrum (its PSD, read in each receiver bandwidth), or a flat amplitude at every frequency solved (a CW sweep: the board's field per volt).
- kicad2ems.core.radiated.adaptive(evaluate, fmin, fmax, budget, start=None, tol_db=0.5, window_db=30.0, echo=None)[source]¶
(f, values): evaluate(f) (an array of values above 0, each a curve in dB over log f) at `start` frequencies equally spaced in log f (default a third of the budget), then at the midpoint in log f of each interval beside a point its two neighbours' straight line (dB over log f) misses by more than tol_db, either way (a peak between two samples can leave the one between them below its neighbours' line), the worst first, until none does or the budget is spent. A point more than window_db below the largest sample of every curve (a notch, a quiet band) is not refined. Where the curves bend (a resonance) the samples gather; where they are straight (a field rising 20 dB a decade) none is added.
- kicad2ems.core.radiated.add_board_args(p, fmin, fmax, points, step)[source]¶
The board, its solve and the ports' loads: the arguments both tools take.
- kicad2ems.core.radiated.angles(u)[source]¶
(theta, phi) degrees of unit vectors (.., 3); phi in [0, 360).
- kicad2ems.core.radiated.cartesian(Et, Ep, theta, phi)[source]¶
r E as a vector (.., 3) from its theta and phi components.
- kicad2ems.core.radiated.frequencies(pf, a, given=None)[source]¶
The frequencies solved (Hz): given (a signal's lines), the array file's in the band, or a.points equally spaced in log f.
- kicad2ems.core.radiated.grid_angles(step, lower=True)[source]¶
(theta, phi) of the grid at step degrees: theta 0..180 (lower: the whole sphere) or 0..90, with HORIZON steps halving toward 90 from either side; phi 0..360 - step.
- kicad2ems.core.radiated.limit_at(f, segs)[source]¶
The limit (dBuV/m) at each f of [(f0, f1, value)] (a step at a shared edge takes the lower), nan outside them.
- kicad2ems.core.radiated.limits(cls='B', distance=3.0)[source]¶
{detector: [(f0, f1, dBuV/m)]} of CISPR 32 class cls at distance (m): below 1 GHz its table at 10 m or 3 m, elsewhere 20 log10(10 / d) from 10 m; above 1 GHz from its 3 m (20 log10(3 / d)).
- kicad2ems.core.radiated.log_grid(fmin, fmax, points)[source]¶
points frequencies from fmin to fmax, equally spaced in log f.
- kicad2ems.core.radiated.pattern_psd(f, rate, amp, rise)[source]¶
One-sided PSD (V^2/Hz) of random NRZ data from 0 to amp at rate (b/s), edges rise seconds 10-90 %: amp^2 T / 2 sinc^2(f T) sinc^2(f t_r) (its mean, the DC line amp / 2, aside).
- kicad2ems.core.radiated.port_fields(a, out, log)[source]¶
PortFields of a's arguments: the array file's, or the board on mom25d.
- kicad2ems.core.radiated.prbs_lines(rate, amp, rise, order, fmin, fmax)[source]¶
A PRBS of 2^order - 1 bits repeated: its lines (f Hz, RMS volts) at k rate / L in [fmin, fmax]. An m-sequence's spectrum is flat, |sum_i b_i e^{-j 2 pi k i / L}|^2 = (L + 1) / 4 for k not a multiple of L, so each line is RMS^2 = amp^2 (L + 1) / (2 L^2) sinc^2(f / rate) sinc^2(f t_r) (k a multiple of L: the bit rate's harmonics, where sinc(f / rate) = 0).
- kicad2ems.core.radiated.read_spectrum(path)[source]¶
A spectrum file's lines: (f Hz, RMS volts), one a row (CSV or spaces, '#' comments; a header row is skipped).
- kicad2ems.core.radiated.receive_grid(G, loads, f, E0=1.0)[source]¶
(V_theta, V_phi) on Grid G's directions: each port's voltage on its load (V, complex; (n, ntheta, nphi)) for a plane wave of E0 V/m in theta or phi polarisation arriving from there, from G's r E per unit source volt of each port (n, ...): V = 4 pi / (j k0 eta0) z E0 (p . F).
- kicad2ems.core.radiated.settings_of(a, out)[source]¶
kicad2ems's settings for the board of a's arguments (its config's when a config), mom25d its solver.
- kicad2ems.core.radiated.site(field, f, distance=3.0, h_eut=0.8, heights=None, turns=None, orientations=('flat',), floor=True)[source]¶
The field at the antenna (V/m per the field's source volt), the largest over the orientations, the turntable's angles (deg), the heights (m) and the two polarisations: dict(E, orientation, turn, height, pol, E_by_orientation). field(u) gives r E (m, 3) in the board's directions u (m, 3) (a Grid's at, the first column). floor: its reflection (else free space).
- kicad2ems.core.radiated.sweep(pf, a, one, value, given=None, echo=None)[source]¶
(f, [one(f)]) in order of f: at given frequencies (a signal's lines) or the array file's, else adaptive's (a.points at most, ADAPT_START equally spaced in log f first) on value(one(f)), the curves whose peaks the samples follow.
- kicad2ems.core.radiated.trapezoid(f0, amp, rise, duty=0.5, fmin=0.0, fmax=6000000000.0)[source]¶
A clock's lines (f Hz, RMS volts) in [fmin, fmax]: from 0 to amp at f0, its pulse duty x the period at half swing, edges rise seconds 10-90 % (a linear ramp of rise / 0.8), the falling as the rising: c_n = 2 amp d |sinc(n d)| |sinc(n f0 t_r)| (peak; RMS c_n / sqrt 2) np.sinc(x) = sin(pi x) / (pi x).
- kicad2ems.core.radiated.two_ray(F_dir, F_ref, f, distance, h_eut, h)[source]¶
The field at height h of the direct and reflected rays of a source whose room-frame r E toward them are F_dir, F_ref (3,): site's sum, for a check.