Spectroscopic investigations of CdS nanoparticles in sol-gel derived polymeric thin films and bulk silica matrices