Skip to content

Commit f70cc4a

Browse files
committed
cmvnw sliding window
1 parent 9f960e5 commit f70cc4a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/test_package.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,22 @@
88
signal = signal[:,0]
99

1010
############# Extract MFCC features #############
11-
mfcc = speechpy.mfcc(signal, sampling_frequency=fs, frame_length=0.020, frame_stride=0.02,
11+
mfcc = speechpy.mfcc(signal, sampling_frequency=fs, frame_length=0.020, frame_stride=0.01,
1212
num_filters=40, fft_length=512, low_frequency=0, high_frequency=None)
13+
mfcc_cmvn = speechpy.cmvnw(mfcc,win_size=301,variance_normalization=True)
14+
print('mfcc(mean + variance normalized) feature shape=', mfcc_cmvn.shape)
15+
1316
mfcc_feature_cube = speechpy.extract_derivative_feature(mfcc)
1417
print('mfcc feature cube shape=', mfcc_feature_cube.shape)
1518

1619
############# Extract logenergy features #############
17-
logenergy = speechpy.lmfe(signal, sampling_frequency=fs, frame_length=0.020, frame_stride=0.02,
20+
logenergy = speechpy.lmfe(signal, sampling_frequency=fs, frame_length=0.020, frame_stride=0.01,
1821
num_filters=40, fft_length=512, low_frequency=0, high_frequency=None)
1922
logenergy_feature_cube = speechpy.extract_derivative_feature(logenergy)
2023
print('logenergy features=', logenergy.shape)
2124

2225
# Example of staching frames
23-
signal = speechpy.stack_frames(signal, sampling_frequency=fs, frame_length=0.020, frame_stride=0.020, Filter=lambda x: np.ones((x,)),
26+
signal = speechpy.stack_frames(signal, sampling_frequency=fs, frame_length=0.020, frame_stride=0.01, Filter=lambda x: np.ones((x,)),
2427
zero_padding=True)
2528

2629

0 commit comments

Comments
 (0)