  Modern electronic systems operate in complex electromagnetic environments and
must handle noise and unwanted coupling. The capability to isolate or reject
unwanted signals for mitigating vulnerabilities is critical in any practical
application. In this work, we describe the use of a binary programmable
metasurface to (i) control the spatial degrees of freedom for waves propagating
inside an electromagnetic cavity and demonstrate the ability to create nulls in
the transmission coefficient between selected ports; and (ii) create the
conditions for coherent perfect absorption. Both objectives are performed at
arbitrary frequencies. In the first case a novel and effective optimization
algorithm is presented that selectively generates coldspots over a single
frequency band or simultaneously over multiple frequency bands. We show that
this algorithm is successful with multiple input port configurations and
varying optimization bandwidths. In the second case we establish how this
technique can be used to establish a multi-port coherent perfect absorption
state for the cavity.
