Abflachungssignalrahmen mit Überlappung nach dem Auftragen von VAD -Filter mit LibrosaPython

Python-Programme
Anonymous
 Abflachungssignalrahmen mit Überlappung nach dem Auftragen von VAD -Filter mit Librosa

Post by Anonymous »

Hallo, ich habe einen sehr einfachen VAD -Filter mit Librosa erstellt. < /p>

Code: Select all

# Size of our frame is 552 samples
frame_len = 552
# Size of the overlap is 221 samples
frame_hop = 221

# Slices data array into overlapping frames without previously defined variables
frames = librosa.util.frame(y,
frame_length=frame_len,
hop_length=frame_hop)

# Computing average loudness in frame.
# summing the square of our frame and dividing by frame length
# Squaring the Signal positive and negative don't cancel each other out.
energy = np.sum(frames**2, axis=0) / frame_len

# Convert to decibels and add a tiny (1e-10) constant to avoid log(0) errors
# Since the above calculates power we multiply by 10 (not 20 as would be the case for Amplitude) [1]
# To obtain the average decibel power of our frame
energy_db = 10 * np.log10(energy + 1e-10)

# Comparing the loudest frame energy_db.max() to other frames
# anything not louder than energy_db.max() - 40db, is cut off
# We return a Boolean Array
vad_mask = energy_db > (energy_db.max() - 40)

< /code>
Das Problem, auf das ich gehe, ist, dass ich die Überlappung halte, wenn ich nur naiv filtere und abflach, ich halte. (Effektiv klingt das so, als würde ich die Frequenz senken) < /p>
# We select only the vad_mask frames
speech_frames = frames[:, vad_mask]
# Transpose and flatten the frames to yield one continious signal
y_vad = speech_frames.T.reshape(-1)
Ich könnte einfach die vorhergehenden und nachfolgenden 221 Proben aus jedem Frame entfernen, aber ich frage mich, ob es eine Librosa -Funktion gibt, die mir hilft.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post