[docs]classSpecificIsolation(Serializable,Isolation):"""Specific leakage between RF chains."""yaml_tag="Specific"__leakage_factors:Optional[np.ndarray]def__init__(self,isolation:Union[None,np.ndarray,float,int]=None,device:Optional[SimulatedDevice]=None,)->None:# Initialize base classIsolation.__init__(self,device=device)# Initialize class attributesself.__leakage_factors=Noneself.isolation=isolation# type: ignore[operator]@register(title="Isolation")# type: ignore@propertydefisolation(self)->np.ndarray:"""Linear power isolation between transmit and receive chains. Returns: Numpy matrix (two-dimensional array). """returnself.__isolation@isolation.setterdefisolation(self,value:Union[None,np.ndarray,float,int])->None:ifvalueisNone:self.__isolation=Nonereturnifisinstance(value,(float,int)):ifself.deviceisnotNoneandself.device.num_antennas!=1:raiseValueError("Scalar isolation definition is only allowed for devices with a single antenna")value=np.array([[value]],dtype=float)ifvalue.ndim!=2:raiseValueError("Isolation specification must be a two dimensional array")self.__isolation=value# The leaking power is the square root of the inverse isolationself.__leakage_factors=np.power(value,-0.5)def_leak(self,signal:Signal)->Signal:ifself.__leakage_factorsisNone:raiseRuntimeError("Error trying to model specific isolaion leakage with undefined isolations")ifself.__leakage_factors.shape[0]!=self.device.antennas.num_receive_antennas:raiseRuntimeError("Number of receiving antennas in isolation specifications ({self.__leakage_factors.shape[0]}) ""don't match the antenna array ({self.device.antennas.num_receive_antennas})")ifself.__leakage_factors.shape[1]!=self.device.antennas.num_transmit_antennas:raiseRuntimeError("Number of receiving antennas in isolation specifications ({self.__leakage_factors.shape[0]}) ""don't match the antenna array ({self.device.antennas.num_receive_antennas})")leaked_samples=self.__leakage_factors@signal[:,:]returnsignal.from_ndarray(leaked_samples)