From ebaf623ab4a00e6b78c68906793574bb10a861c7 Mon Sep 17 00:00:00 2001 From: Apostolof Date: Sat, 26 Jan 2019 13:39:38 +0200 Subject: [PATCH] Fix SSC's calculation of energy estimations --- Level_1/SSC.m | 4 ++-- Level_2/SSC.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Level_1/SSC.m b/Level_1/SSC.m index 4df0078..e0f4502 100644 --- a/Level_1/SSC.m +++ b/Level_1/SSC.m @@ -3,7 +3,7 @@ function frameType = SSC(~, nextFrameT, prevFrameType) % Usage frameType = SSC(frameT, nextFrameT, prevFrameType), where: % Inputs % - frameT is a frame in the time domain, containing both channels of -% the audio stored in an array of dimensions 2048X2 +% the audio stored in an array of dimensions 2048X2 % - nextFrameT is the next frame in the time domain, containing both % channels of the audio stored in an array of dimensions 2048X2 % - prevFrameType is the type of the previous frame in string @@ -33,7 +33,7 @@ function frameType = SSC(~, nextFrameT, prevFrameType) channelFrameType = {'nan', 'nan'}; for channel = 1:2 % Calculates sub-frame energy estimation - [subFrames, ~] = buffer(nextFrameT(449:end - 448, channel), 256, 128, 'nodelay'); + [subFrames, ~] = buffer(nextFrameT(577:end - 448, channel), 128, 0, 'nodelay'); energyEstimations = sum(subFrames .^ 2, 1); % Calculates the ratio of the sub-frame energy to the average energy of diff --git a/Level_2/SSC.m b/Level_2/SSC.m index 50ebec7..e0f4502 100644 --- a/Level_2/SSC.m +++ b/Level_2/SSC.m @@ -33,7 +33,7 @@ function frameType = SSC(~, nextFrameT, prevFrameType) channelFrameType = {'nan', 'nan'}; for channel = 1:2 % Calculates sub-frame energy estimation - [subFrames, ~] = buffer(nextFrameT(449:end - 448, channel), 256, 128, 'nodelay'); + [subFrames, ~] = buffer(nextFrameT(577:end - 448, channel), 128, 0, 'nodelay'); energyEstimations = sum(subFrames .^ 2, 1); % Calculates the ratio of the sub-frame energy to the average energy of