fixed fade_in.m

changed it so that it accepts instances of time where t < 1 and not a whole number
This commit is contained in:
SeaSponge 2021-12-10 08:59:33 -08:00 committed by GitHub
parent 9c10481b9b
commit 23fb666a57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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