diff --git a/src/NotWorking/fade_in.m b/src/NotWorking/fade_in.m index 22bef76..254d288 100644 --- a/src/NotWorking/fade_in.m +++ b/src/NotWorking/fade_in.m @@ -21,7 +21,10 @@ function output = fade_in(input, time) % set multiplier as 1D array % fade in effect: from no volume to full volume of signal multiplier = (1 : time) / time; - + + while length(multiplier) < len + multiplier = [multiplier 1]; + end % the resulting fade-in output output = input .* multiplier; end diff --git a/src/NotWorking/fade_out.m b/src/NotWorking/fade_out.m index f50812b..f0821d3 100644 --- a/src/NotWorking/fade_out.m +++ b/src/NotWorking/fade_out.m @@ -23,6 +23,10 @@ function output = fade_out(input, time) % fade out effect: from full volume of signal to no volume multiplier = flip(multiplier) + + while length(multiplier) < len + multiplier = [multiplier 0]; + end % the resulting fade-in output output = input .* multiplier;