A digital spectral analysis technique and its application to radio astronomy