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