From 5b82233d0ef6a21020dd63c375dc9f92d0845308 Mon Sep 17 00:00:00 2001 From: Maxim Lihachev Date: Thu, 13 Oct 2016 12:36:46 +0500 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=B0=D0=BB=D0=B3=D0=BE=D1=80=D0=B8=D1=82=D0=BC?= =?UTF-8?q?=20=D1=80=D0=B0=D1=81=D1=87=D1=91=D1=82=D0=B0=20=D1=83=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=BD=D1=8F=20=D1=81=D0=B8=D0=B3=D0=BD=D0=B0=D0=BB?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- level.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/level.hs b/level.hs index 17f0d18..6267f19 100644 --- a/level.hs +++ b/level.hs @@ -1,7 +1,7 @@ {-# LANGUAGE DeriveDataTypeable, RecordWildCards #-} -- Создан: Ср 28 сен 2016 10:18:53 --- Изменен: Ср 05 окт 2016 16:09:45 +-- Изменен: Чт 13 окт 2016 12:36:15 import System.Console.CmdArgs import System.Environment @@ -41,7 +41,8 @@ calcLevel fs samples = case dd of dd = [x | x <- map float2db slices, not (isNaN x), x /= 0] float2db [] = 0 float2db list = 20 * logBase 10 (maximum list) - slices = splitWhen (== 0) $ take fs samples; + slices = chunksOf ms $ take fs samples + ms = fs `div` 2 -- Вычисление значения фазы calcPhase :: (Ord a, Fractional a) => [[a]] -> a