From ecf6ec01ea781b79c27b2e96260e5abd24f7f2ba Mon Sep 17 00:00:00 2001 From: SeaSponge <61109988+Squidwarder@users.noreply.github.com> Date: Thu, 9 Dec 2021 18:56:59 -0800 Subject: [PATCH 1/2] Fixed fade_in.m Fixed the error where the dimensions don't agree for the operation input .* multiplier --- src/NotWorking/fade_in.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 From 0c39f41ce8a4119a3b83f9910d00810bc55fc930 Mon Sep 17 00:00:00 2001 From: SeaSponge <61109988+Squidwarder@users.noreply.github.com> Date: Thu, 9 Dec 2021 18:58:31 -0800 Subject: [PATCH 2/2] Fixed fade_out.m Fixed the error of dimensions not matching in the operation input .* multiplier --- src/NotWorking/fade_out.m | 4 ++++ 1 file changed, 4 insertions(+) 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;