Separate words in audio file

6 次查看(过去 30 天)
Hello, I am trying to separate words in an audio file, leaving only samples between red lines, with also having a variable with a border of each word:
I understand I can remove the silence between words using
envelope = imdilate(abs(y), true(1500, 1));
quietParts = envelope < 0.05;
y(quietParts) = [];
but this does leave me without knowing the boundary between each of these words.
  2 个评论
Arthur Goodhart
Arthur Goodhart 2018-11-2
Did you ever work out how to do this?
Michael Saniuk
Michael Saniuk 2018-11-3
I posted this question 1.5 year ago but yes, I managed to do it myself.
[y, fs] = audioread(sprintf('test%d.wav', i));
envelope = imdilate(abs(y), true(1500, 1));
quietParts = envelope > 0.01;
beginning = strfind(quietParts',[0 1]);
ending = strfind(quietParts', [1 0]);
With this code you can get boundaries between words but also between noises and sometimes the word gets separated.
In order to concatenate fragments of word into one full word, I had to detect parts where where is a very small distance between them and remove their corresponding endings/begginings:
eg. [b1 e1] [b2 e2] [b3 e3] are from the same word,
distances between them are very small.
I concatenate them and now I have a full word [b1 e3]
The last thing that might annoy us are the boundaries of noise that we do not want to be treated as a word! In order to get rid of them I calculated minimal length of a word in my dictionary and counted it as a minimal length for a detected word to be counted as a word.

请先登录,再进行评论。

采纳的回答

Michael Saniuk
Michael Saniuk 2018-11-5
Copying my comment to post it as an answer:
I posted this question 1.5 year ago but yes, I managed to do it myself.
[y, fs] = audioread(sprintf('test%d.wav', i));
envelope = imdilate(abs(y), true(1500, 1));
quietParts = envelope > 0.01;
beginning = strfind(quietParts',[0 1]);
ending = strfind(quietParts', [1 0]);
With this code you can get boundaries between words but also between noises and sometimes the word gets separated.
In order to concatenate fragments of word into one full word, I had to detect parts where where is a very small distance between them and remove their corresponding endings/begginings:
eg. [b1 e1] [b2 e2] [b3 e3] are from the same word,
distances between them are very small.
I concatenate them and now I have a full word [b1 e3]
The last thing that might annoy us are the boundaries of noise that we do not want to be treated as a word! In order to get rid of them I calculated minimal length of a word in my dictionary and counted it as a minimal length for a detected word to be counted as a word.

更多回答(1 个)

huda farooqui
huda farooqui 2018-11-1
I am facing the same problem .kindly help

类别

Help CenterFile Exchange 中查找有关 Multirate Signal Processing 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by