Beginner questions about waveform (shape) and RMS (line)

149 views
Skip to first unread message

J Paul LESCOUZERES

unread,
May 4, 2021, 5:49:52 PM5/4/21
to librosa
Hi everyone,

I'm working on a small project about audio visualization, previously based on Web Audio API, that I want now to do using Python and Librosa. My technical knowledge in audio analysis is quite basic, so I hope my question here will not be too dumb...

My final goal is to get radial lines for each audio frame. Starting with librosa.load() method, I get a waveform (shape), which I'd like to "convert" to a simple line. If I'm not wrong, the RMS extraction feature would match my needs, but using it I'm having some questions for which I'd like some enlightenments:
1. The time scale doesn't seem identical when I plot the result of librosa.load() and the result of librosa.feature.rms()... Why? From my understanding, it could be related to the fact that RMS computes a root-mean-square value for each frame, but I'm not sure to understand this properly :/
2. After a few tests, I achieved getting a similar result (line vs shape) using a spectrogram magnitude (S) like this:
    S = np.abs(librosa.stft(y=yt, n_fft=512))
    rms = librosa.feature.rms(S=S, frame_length=512)[0]
Does it seem correct to you?

Thanks again for your time, and your responses!

JP
Reply all
Reply to author
Forward
0 new messages