Effect of diode–diode interactions on the characteristics of the absorption spectra of granular films and colloidal suspensions of gold and silver nanoparticles