opmo Posted June 15, 2023 Share Posted June 15, 2023 New function: GEN-ENVELOPE-TENDENCY This function takes a list of data and adjusts the values to fit within the specified lower and upper envelope limits. If a value is outside the given envelope, the function will adjust it to fit within the envelope and all subsequent values in the list are also adjusted by the same amount, which helps to preserve the original shape of the data. Examples: (setf data (gen-brownian-motion 128 :seed 43)) (setf len (length data)) (setf l-limit (envelope-samples '(0 0 1 -1 2 -1 3 -2 4 3 5 -1 6 0) len)) (setf u-limit (envelope-samples '(0 1 1 4 2 2 3 4 6 4) len)) (xy-plot (list l-limit u-limit) :join-points t) (setf adj (gen-envelope-tendency data l-limit u-limit :seed 12)) (list-plot adj :zero-based t :point-radius 2 :join-points t) With optional reflect T: (setf ref (gen-envelope-tendency data l-limit u-limit :reflect t :seed 12)) (list-plot reflect :zero-based t :point-radius 2 :join-points t) Happy coding, Janusz AM and Stephane Boussuge 2 Link to comment Share on other sites More sharing options...
Recommended Posts