Fourier-Stieltjes transforms of discrete measures; periodic and semiperiodic functions