From 23fb666a57722d7993767baefbe93049c48d8e22 Mon Sep 17 00:00:00 2001 From: SeaSponge <61109988+Squidwarder@users.noreply.github.com> Date: Fri, 10 Dec 2021 08:59:33 -0800 Subject: [PATCH] fixed fade_in.m changed it so that it accepts instances of time where t < 1 and not a whole number --- src/NotWorking/fade_in.m | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/NotWorking/fade_in.m b/src/NotWorking/fade_in.m index 254d288..bebb07f 100644 --- a/src/NotWorking/fade_in.m +++ b/src/NotWorking/fade_in.m @@ -12,10 +12,21 @@ function output = fade_in(input, time) len = length(input); + % need to use whole number for time + time = round(time); + % if time parameter longer than signal, treat time as % the duration of original signal if time > len - time = len + time = len; + end + + % in order to create array, time >=1 + % if not, it's arbitrarily set to 1 + % in which case the fade_in effect + % is virtually nonexistent + if time < 1 + time = 1; end % set multiplier as 1D array