Skip to content

Commit

Permalink
little change to wavelet conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
iizukak committed Oct 31, 2015
1 parent 18edbc7 commit 6a43b42
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/wavelet_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
from collections import deque

# setting for wavelet conversion
WAVELET_SEGMENT_SIZE = 200
WAVELET_SEGMENT_SIZE = 20
WAVELET_DB = "db2"
WAVELET_FREQUENCY = 1

SMOOTHING_SIZE = 100
SMOOTHING_SIZE = 20

# setting CSV data directory
DATA_DIR = "data/"

# setting file
import argparse
parser = argparse.ArgumentParser(description = "Lovelive MaU Manual Generator")
parser = argparse.ArgumentParser(description = "")
parser.add_argument('--target', required=True)
args = parser.parse_args()
t = args.target
Expand Down Expand Up @@ -48,9 +49,10 @@
date, value = csvReader.next()
currentSegment.append(value)

cA, cD = pywt.dwt(sorted(currentSegment), WAVELET_DB)
# cA, cD = pywt.dwt(sorted(currentSegment), WAVELET_DB)
cA, cD = pywt.dwt(currentSegment, WAVELET_DB)

smoothingSegment.append(cA[1])
smoothingSegment.append(cA[WAVELET_FREQUENCY])
smoothedValue = sum(smoothingSegment) / len(smoothingSegment)

waveletList.append([date, int(value), smoothedValue])
Expand Down

0 comments on commit 6a43b42

Please sign in to comment.