Page 82 of the First edition of the book. elif omega >= 0.9 and omega < 1.0: is better than elif omega > 0.9 and omega < 1.0: Otherwise signal = 1.0 for omega = 0.9