magphase icon indicating copy to clipboard operation
magphase copied to clipboard

16k sample rate audio error

Open zhang-jian opened this issue 6 years ago • 1 comments

Sorry if this question is too naive.

Can I use this tool on 16k sample rate audios? I am trying to run the demo code on a 16k sample rate audio and got error

user@localhost:~/Downloads/magphase-master/demos$ python demo_copy_synthesis_lossless.py
Analysing.....................................................
Extracting epochs with REAPER...
Residual symmetry: P:7371.288574  N:7185.912109  MEAN:-840.706116
Inverting signal
Traceback (most recent call last):
  File "demo_copy_synthesis_lossless.py", line 71, in 
    m_mag, m_real, m_imag, v_f0, fs, v_shift = mp.analysis_lossless(wav_file_orig)
  File "/home/user/Downloads/magphase-master/src/magphase.py", line 2891, in analysis_lossless
    m_fft, v_shift = analysis_with_del_comp_from_pm(v_sig, fs, v_pm_smpls, fft_len=fft_len)
  File "/home/user/Downloads/magphase-master/src/magphase.py", line 291, in analysis_with_del_comp_from_pm
    l_frms, v_lens, v_pm_plus, v_shift, v_rights = windowing(v_in_sig, v_pm_smpls_defi, win_func=win_func)
  File "/home/user/Downloads/magphase-master/src/magphase.py", line 108, in windowing
    v_frm = v_frm * v_win
ValueError: operands could not be broadcast together with shapes (217,) (421,) 

Thanks,

zhang-jian avatar Sep 27 '18 10:09 zhang-jian

Yes, MagPhase can work with 16kHz audios. If you look at src/magphase.py, you will find it supports 16000, 22050, 44100, 48000 sample frequency. Parameters need to be tuned if synthesized quality sounds dramatically poor.

Howliang avatar Jan 25 '19 08:01 Howliang