By means of ab-initio calculations we investigate the optical properties of pure a-SiN$_x$ samples, with $x in [0.4, 1.8]$, and samples embedding silicon nanoclusters (NCs) of diameter $0.5 leq d leq 1.0$ nm. In the pure samples the optical absorption gap and the radiative recombination rate vary according to the concentration of Si-N bonds. In the presence of NCs the radiative rate of the samples is barely affected, indicating that the intense photoluminescence of experimental samples is mostly due to the matrix itself rather than to the NCs. Besides, we evidence an important role of Si-N-Si bonds at the NC/matrix interface in the observed photoluminescence trend.