Skip to content

Commit

Permalink
Use this LPC
Browse files Browse the repository at this point in the history
  • Loading branch information
ManviG committed Jul 24, 2016
1 parent e29625f commit 323ed87
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions FinalCode/LPC.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
#!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# File: LPC.py
# Date: Thu Mar 19 19:37:11 2015 +0800
# Author: Yuxin Wu <[email protected]>

import time
#import scikits.talkbox as tb
Expand Down Expand Up @@ -64,13 +59,13 @@ def get_lpc_extractor(fs, win_length_ms=32, win_shift_ms=16,
return ret


def extract(fs, signal=None, diff=False, **kwargs):
def extract(fs, signal=None, diff=False,win_len = 32, win_shift = 16, **kwargs):
"""accept two argument, or one as a tuple"""
if signal is None:
assert type(fs) == tuple
fs, signal = fs[0], fs[1]
signal = cast['float'](signal)
ret = get_lpc_extractor(fs, **kwargs).extract(signal)
ret = get_lpc_extractor(fs, win_length_ms = win_len, win_shift_ms= win_shift, **kwargs).extract(signal)
if diff:
return diff_feature(ret)
return ret
Expand All @@ -79,7 +74,7 @@ def extract(fs, signal=None, diff=False, **kwargs):
extractor = LPCCExtractor(8000)
fs, signal = wavfile.read("../corpus.silence-removed/Style_Reading/f_001_03.wav")
start = time.time()
ret = extractor.extract(signal)
ret = extractor.extract(signal, win_len = 32, win_shift= 16)
print len(ret)
print len(ret[0])
print time.time() - start

0 comments on commit 323ed87

Please sign in to comment.