def plots(m_mag, m_real, m_imag, v_f0): lp.plotm(la.db(m_mag)) # in decibels for better visualisation lp.title('Magnitude Spectrum (dB)') lp.xlabel('Time (frames)') lp.ylabel('Frequency bins') lp.plotm(m_real) lp.title('"R" Feature Phase Spectrum') lp.xlabel('Time (frames)') lp.ylabel('Frequency bins') lp.plotm(m_imag) lp.title('"I" Feature Phase Spectrum') lp.xlabel('Time (frames)') lp.ylabel('Frequency bins') lp.figure() lp.plot(v_f0) lp.title('F0') lp.xlabel('Time (frames)') lp.ylabel('F0') lp.grid() return
def plots(m_mag, m_real, m_imag, v_f0): lp.plotm(la.db(m_mag)) # in decibels for better visualisation lp.title('Magnitude Spectrum (dB)') lp.xlabel('Time (frames)') lp.ylabel('Frequency bins') lp.plotm(m_real) lp.title('"R" Feature Phase Spectrum') lp.xlabel('Time (frames)') lp.ylabel('Frequency bins') lp.plotm(m_imag) lp.title('"I" Feature Phase Spectrum') lp.xlabel('Time (frames)') lp.ylabel('Frequency bins') lp.figure() lp.plot(v_f0) lp.title('F0') lp.xlabel('Time (frames)') lp.ylabel('F0') lp.grid() return
def plots(m_mag_mel_log, m_real_mel, m_imag_mel, v_lf0): lp.plotm(m_mag_mel_log) lp.title('Log-Magnitude Spectrum') lp.xlabel('Time (frames)') lp.ylabel('Mel-scaled frequency bins') lp.plotm(m_real_mel) lp.title('"R" Feature Phase Spectrum') lp.xlabel('Time (frames)') lp.ylabel('Mel-scaled frequency bins') lp.plotm(m_imag_mel) lp.title('"I" Feature Phase Spectrum') lp.xlabel('Time (frames)') lp.ylabel('Mel-scaled frequency bins') lp.figure() lp.plot(np.exp(v_lf0)) # unlog for better visualisation lp.title('F0') lp.xlabel('Time (frames)') lp.ylabel('F0') lp.grid() return
# PLOTS:==================================================================== #lp.close('all') fft_len_half = fft_len / 2 + 1 #m_mag_ref = lu.read_binfile(magfile_ref, dim=60) m_mag_ref = la.db(lu.read_binfile(magfile_ref, dim=fft_len_half)) m_mag_a = la.db( np.exp( la.sp_mel_unwarp(lu.read_binfile(magfile_a, dim=60), fft_len_half, alpha=alpha, in_type='log'))) if False: lp.plotm(m_mag_ref) lp.plotm(m_mag_a) lp.plotm(m_mag_ref - m_mag_a) lp.plotm((m_mag_ref - m_mag_a)[:50, :50]) lp.plotm(np.diff(m_mag_ref, axis=0)) lp.plotm(np.diff(m_mag_a, axis=0)) if True: nx = 26 lp.figure() lp.plot(m_mag_ref[nx, :]) lp.plot(m_mag_a[nx, :]) lp.grid() if True: