A detailed in situ study by infrared phase-modulated ellipsometry of interfaces between plasma-deposited amorphous silicon (a-Si:H) and silicon nitride (a-SiN(x)) is presented. The structure of the interface is affected by the deposition sequence. A behavior compatible with a sharp interface is observed when a-SiN(x) is deposited on top of a-Si:H, the underlayer material being very weakly influenced by the deposition of the overlayer. In contrast, a graded transition is observed when a-SiN(x) is deposited first. In the latter case, the infrared measurements directly reveal a nitrogen tail incorporated in the first monolayers of a-Si:H (10-20 angstrom thick). The formation mechanisms of the interfaces are discussed.