當前位置: 首頁>>代碼示例>>Python>>正文


Python librosa.db_to_amplitude方法代碼示例

本文整理匯總了Python中librosa.db_to_amplitude方法的典型用法代碼示例。如果您正苦於以下問題:Python librosa.db_to_amplitude方法的具體用法?Python librosa.db_to_amplitude怎麽用?Python librosa.db_to_amplitude使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在librosa的用法示例。


在下文中一共展示了librosa.db_to_amplitude方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: db2amp

# 需要導入模塊: import librosa [as 別名]
# 或者: from librosa import db_to_amplitude [as 別名]
def db2amp(db):
    return librosa.db_to_amplitude(db) 
開發者ID:andabi,項目名稱:parallel-wavenet-vocoder,代碼行數:4,代碼來源:audio.py

示例2: magnitude_db_and_phase_to_audio

# 需要導入模塊: import librosa [as 別名]
# 或者: from librosa import db_to_amplitude [as 別名]
def magnitude_db_and_phase_to_audio(frame_length, hop_length_fft, stftaudio_magnitude_db, stftaudio_phase):
    """This functions reverts a spectrogram to an audio"""

    stftaudio_magnitude_rev = librosa.db_to_amplitude(stftaudio_magnitude_db, ref=1.0)

    # taking magnitude and phase of audio
    audio_reverse_stft = stftaudio_magnitude_rev * stftaudio_phase
    audio_reconstruct = librosa.core.istft(audio_reverse_stft, hop_length=hop_length_fft, length=frame_length)

    return audio_reconstruct 
開發者ID:vbelz,項目名稱:Speech-enhancement,代碼行數:12,代碼來源:data_tools.py

示例3: db_to_amplitude

# 需要導入模塊: import librosa [as 別名]
# 或者: from librosa import db_to_amplitude [as 別名]
def db_to_amplitude(x):
    """Convert decibels to amplitude."""
    return librosa.db_to_amplitude(x) 
開發者ID:Tomiinek,項目名稱:Multilingual_Text_to_Speech,代碼行數:5,代碼來源:audio.py

示例4: linear_to_mel

# 需要導入模塊: import librosa [as 別名]
# 或者: from librosa import db_to_amplitude [as 別名]
def linear_to_mel(S):
    """Convert linear to mel spectrogram (this does not return the same spec. as mel_spec. method due to the db->amplitude conversion)."""
    S = db_to_amplitude(S)
    S = librosa.feature.melspectrogram(S=S, sr=hp.sample_rate, n_mels=hp.num_mels)
    return amplitude_to_db(S) 
開發者ID:Tomiinek,項目名稱:Multilingual_Text_to_Speech,代碼行數:7,代碼來源:audio.py

示例5: inverse_spectrogram

# 需要導入模塊: import librosa [as 別名]
# 或者: from librosa import db_to_amplitude [as 別名]
def inverse_spectrogram(s, mel=False):
    """Convert log-magnitude spectrogram to waveform."""
    S = db_to_amplitude(s)
    wf = ms_to_frames(hp.stft_window_ms)
    hf = ms_to_frames(hp.stft_shift_ms)
    if mel: S = librosa.feature.inverse.mel_to_stft(S, power=1, sr=hp.sample_rate, n_fft=hp.num_fft)
    y = librosa.griffinlim(S ** hp.griffin_lim_power, n_iter=hp.griffin_lim_iters, hop_length=hf, win_length=wf)
    if hp.use_preemphasis: y = deemphasis(y)
    y /= max(y)
    return y 
開發者ID:Tomiinek,項目名稱:Multilingual_Text_to_Speech,代碼行數:12,代碼來源:audio.py


注:本文中的librosa.db_to_amplitude方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。