Occupied bandwidth measurement using a spectrum analyzer