커뮤니티
|
DSP/SPEECH
|
제목:
python코드 - Speech Conversion(음성변형) |
|
|
1792 김윤중  |
|
|
|
- beat notes(AM)
- silen,chirps(FM)
- x(t)=cos(2π"(" 350) t^2+2π(220)t), from f1=220 Hz to f2=2320 Hz , duration=3sec
- fm_silen.wav
- 4 octave - generated sample
- 음성합성 - Tacotron
- pitch 변형
- Shift the pitch of a waveform by n_steps semitones.
y : np.ndarray [shape=(n,)] audio time series
sr : number > 0 [scalar] audio sampling rate of y
n_steps : float [scalar] how many (fractional) half-steps to shift y
bins_per_octave : float > 0 [scalar] how many steps per octave
res_type : string Resample type. Possible options: ‘kaiser_best’, ‘kaiser_fast’, and ‘scipy’, ‘polyphase’, ‘fft’. By default, ‘kaiser_best’ is used.
- import librosa
- def play(sig,fs):
- sd.play(sig,fs)
sd.wait()
- x, sr = librosa.load(librosa.util.example_audio_file())
play(x,sr) [link]
- x, sr = librosa.load('data/LJ001-0001.wav'),duration=5) #5sec
play(x,sr) [link]
- x, sr = librosa.effects.pitch_shift(y, sr, n_steps=4)) #Shift up by a major third (four half-steps)
play(x,sr) [link]
- x, sr = librosa.effects.pitch_shift(y, sr, n_steps=-6)) #Shift down by a tritone (six half-steps)
play(x,sr) [link]
- x, sr = librosa.effects.pitch_shift(y, sr, n_steps=3,bins_per_octave=24) #Shift up by 3 quarter-tones
play(x,sr) [link]
- stretch [link]
- 재생속도를 빠르게,느리게 변형
- y_fast = librosa.effects.time_stretch(x, rate=2.0)
play(y_fast,sr) [link]
- y_slow = librosa.effects.time_stretch(x, rate=0.5)
play(y_slow,sr) [link]
- 참고자료
- Harmonic Percussive Source Separation[link]
- Sounds can broadly be classi ed into two classes. Harmonic sound on the one hand side is what we perceive as pitched sound and what makes us hear melodies and chords. Percussive sound on the other hand is noise-like and usually stems from instrument onsets like the hit on a drum or from consonants in speech. The goal of harmonic-percussive source separation (HPSS) is to decompose an input audio signal into a signal consisting of all harmonic sounds and a signal consisting of all percussive sounds. In this lab course, we study an HPSS algorithm and implement it in MATLAB. Exploiting knowledge about the spectral structure of harmonic and percussive sounds, this algorithm decomposes the spectrogram of the given input signal into two spectrograms, one for the harmonic, and one for the percussive component. Afterwards, two waveforms are reconstructed from the spectrograms which nally form the desired signals. Additionally, we describe the application of HPSS for enhancing chroma feature extraction and onset detection. The techniques used in this lab cover median ltering, spectral masking and the inversion of the short-time Fourier transform.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|