def apply_tf(data, fftLen, step, tf_config, src_index, noise_amp=0): win = hamming(fftLen) # ハミング窓 mch_data = apply_tf_spec(data, fftLen, step, tf_config, src_index, noise_amp) out_wavdata = [] for mic_index in xrange(mch_data.shape[0]): spec = mch_data[mic_index] ### iSTFT resyn_data = simmch.istft(spec, win, step) out_wavdata.append(resyn_data) # concat waves mch_wavdata = np.vstack(out_wavdata) return mch_wavdata
def make_white_noise(nch,length,fftLen,step): # stft length <-> samples src_volume=1 data=make_white_noise_freq(nch,length,fftLen,step) #win = hamming(fftLen) # ハミング窓 win = np.array([1.0]*fftLen) out_wavdata=[] for mic_index in xrange(data.shape[0]): spec=data[mic_index] ### iSTFT resyn_data = simmch.istft(spec, win, step) #x=simmch.apply_window(resyn_data, win, step) #w_sum=np.sum(x**2,axis=1) #print "[CHECK] power(x/frame):",np.mean(w_sum) out_wavdata.append(resyn_data) # concat waves mch_wavdata=np.vstack(out_wavdata) amp=np.max(np.abs(mch_wavdata)) return mch_wavdata/amp
def apply_tf(data,fftLen, step,tf_config,src_index,noise_amp=0): win = hamming(fftLen) # ハミング窓 mch_data=apply_tf_spec(data,fftLen, step,tf_config,src_index,noise_amp) out_wavdata=[] for mic_index in xrange(mch_data.shape[0]): spec=mch_data[mic_index] ### iSTFT resyn_data = simmch.istft(spec, win, step) out_wavdata.append(resyn_data) # concat waves mch_wavdata=np.vstack(out_wavdata) return mch_wavdata