Optical properties of silver nanoparticles deposited on glass and silicon substrates