当前位置: 首页>>代码示例>>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;未经允许,请勿转载。