  Metasurfaces constitute effective media for manipulating and transforming
impinging EM waves. Related studies have explored a series of impactful MS
capabilities and applications in sectors such as wireless communications,
medical imaging and energy harvesting. A key-gap in the existing body of work
is that the attributes of the EM waves to-be-controlled (e.g., direction,
polarity, phase) are known in advance. The present work proposes a practical
solution to the EM wave sensing problem using the intelligent and networked MS
counterparts-the HyperSurfaces (HSFs), without requiring dedicated field
sensors. An nano-network embedded within the HSF iterates over the possible MS
configurations, finding the one that fully absorbs the impinging EM wave, hence
maximizing the energy distribution within the HSF. Using a distributed
consensus approach, the nano-network then matches the found configuration to
the most probable EM wave traits, via a static lookup table that can be created
during the HSF manufacturing. Realistic simulations demonstrate the potential
of the proposed scheme. Moreover, we show that the proposed workflow is the
first-of-its-kind embedded EM compiler, i.e., an autonomic HSF that can
translate high-level EM behavior objectives to the corresponding, low-level EM
actuation commands.
