We are interested in acoustic or elastic wave propagation in time harmonic regime in a two-dimensional medium which is a local perturbation of an infinite anisotropic homogeneous and/or periodic medium. We investigate the question of finding artificial boundary conditions to reduce the numerical computations to a neighborhood of this perturbation. This question is difficult due to the anisotropy and/or the periodicity of the surrounding medium. Our approach consists in coupling several semi-analytical representations of the solution in half-planes surrounding the defect with a FE computation of the solution around the defect. The difficulty is to ensure that all these representations match, in particular in the infinite intersections of the half-planes. It leads to a formulation which couples, via integral operators, the solution in a bounded domain including the defect and its traces on the edge of the half-planes.