;;; Smooths out the values in stream s1 ;;; by applying the filter bank shown in ;;; the figure. ;;; Hint: add (using the right procedure) ;;; a set of independently delayed and ;;; scaled streams instead of using a let ;;; statement to store a bunch of temporary ;;; streams. (define (stream-smooth s1) ;; Here we make sure there is no net ;; amplitude gain in the signal (stream-scale ;; Add all the delayed and scaled streams (stream-add ;; Note: Here we have adjusted the ;; delays so that they are centered ;; around 0. This avoids shifting ;; the stream. (stream-scale (stream-delay s1 -3) -1) (stream-scale (stream-delay s1 -1) 3) (stream-scale (stream-delay s1 0) 5) (stream-scale (stream-delay s1 1) 3) (stream-scale (stream-delay s1 3) -1)) (/ 1. 9)))