gillesdegottex / pulsemodel

Pulse Model vocoder
Apache License 2.0
41 stars 7 forks source link

ValueError: ndarray is not C-contiguous #7

Closed gillesdegottex closed 7 years ago

gillesdegottex commented 7 years ago

This might happens on some machines when running the tests:

Traceback (most recent call last): File "../analysis.py", line 310, in , verbose=args.verbose) File "../analysis.py", line 262, in analysisf PDD = analysis_pdd(wav, fs, f0s, dftlen=dftlen, verbose=verbose) File "../analysis.py", line 117, in analysis_pdd PDD = sp.sinusoidal.estimate_pdd(sinsps, f0sps, fs, pdd_sin_nbperperiod, dftlen, outFscale=True, rmPDtrend=True, extrapDC=True) File "pulsemodel/sigproc/sinusoidal.pyx", line 506, in pulsemodel.sigproc.sinusoidal.estimate_pdd (sinusoidal.c:16028) ValueError: ndarray is not C-contiguous

gillesdegottex commented 7 years ago

One potential solution is to insert: PDSs = PDSs.copy(order='C') PDSc = PDSc.copy(order='C') just before line 506: PDS = np.arctan2(PDSs,PDSc) # The smooth PD (the trend) In sigproc/sinusoidal.pyx

The data structures that comes back from sig.filtfilt might not be in the correct 'C' memory order, which is what numpy's arctan2 function is expecting.

Thanks to Y.L. and S.K. !