r9y9 / pysptk

A python wrapper for Speech Signal Processing Toolkit (SPTK).
http://pysptk.readthedocs.io/en/latest/
Other
441 stars 79 forks source link

questions about function mc2sp in conversion.py #52

Closed attitudechunfeng closed 6 years ago

attitudechunfeng commented 6 years ago

hi, @r9y9. I have questions about function mc2sp in conversion.py when reading your codes. the parameter 'mc' passed into 'mc2sp' is a 2d array, and i tested that 'c' returned by 'freqt' is also a 2d array. But, 'symc' declared in this function is a 1d array as 'symc=np.zeros(fftlen)', and is it wrong about the code 'symc[0] = c[0]'?

r9y9 commented 6 years ago

This is correct. If you pass a 2d array input, then function decorated with apply_along_last_axis (e.g., freqt and mc2sp) is applied along with the last axis, taking input as 1d array.

attitudechunfeng commented 6 years ago

thank u! I have also noticed that~

attitudechunfeng commented 6 years ago

And do you know what "cdef double[:, ::1]" mean in cython? i'm not familiar with cython.

r9y9 commented 6 years ago

C-contiguous typed memoryviews. See http://cython.readthedocs.io/en/latest/src/userguide/memoryviews.html#c-and-fortran-contiguous-memoryviews for details.

attitudechunfeng commented 6 years ago

thanks!