(如Matlab计算语音特性。RMS)

时间:2021-08-14 19:41:05

I need to calculate some features of speech in matlab. However I don't know which ones operations I need to perform after getting data from wavread function, before I can use feature formula(e.g. RMS formula).

我需要计算matlab中语音的一些特征。但是,我不知道在获得波读函数的数据之后,我需要执行哪些操作,然后才能使用特征公式(例如:RMS公式)。

One 1 website I just found this:

我刚刚发现的一个网站:

rmsVec(m) = sqrt(sum(wavData{m}(:).^2)/length(wavData{m}(:)));

But on the other one they used DFT and then some operations with real and imagine part of matrix/vector which I don't understand.

但是在另一个例子中,他们使用了DFT然后用实数做了一些运算想象出矩阵/向量的一部分我不明白。

So how should it be?

那么应该怎么做呢?

I have voicebox library, but I didn't found there calculating rms.
My matlab version: R2009b

我有语音信箱库,但是我没有在那里找到计算rms。我的matlab版本:R2009b

EDIT:

编辑:

http://www.edaboard.com/thread163664.html see hobgoblin and petejonze answers

http://www.edaboard.com/thread163664.html见hobgoblin和petejonze

Due to petejonze it shouldn't matter whether I use time or frequency domain but

由于petejonze我使用时间或频率域无关紧要。

[y, fs, aa] = wavread('C:\Users\lukasz\Desktop\semestr 7\inzynierka\dzwieki\uczace\dol\dol_50')
y1 = y(:,1)
Y1 = fft(y1)
rms1 = sqrt(mean(y1.^2))
rms2 = sqrt(sum(Y1.*conj(Y1))/size(Y1,1))

and the results:

结果:

rms1 =

0.0577

rms2 =

13.2706

So I'm little confused. Which one is correct?

所以我有些困惑了。哪一个是正确的?

EDIT 2:

编辑2:

Another example:

另一个例子:

>> y = [1;2;3]

y =

 1
 2
 3

>> Y = fft(y)

Y =

6.0000          
-1.5000 + 0.8660i
-1.5000 - 0.8660i

>> rms1 = sqrt(mean(y.^2))

rms1 =

2.1602

>> rms2 = sqrt(sum(Y.*conj(Y))/size(Y,1))

rms2 =

3.7417

>> size(Y,1)

ans =

 3

>> Y.*conj(Y)

ans =

36
 3
 3

So this formula

所以这个公式

sqrt(sum(Y1.*conj(Y1))/size(Y1,1))

is incorrect and it should be

是错误的,应该是错误的

sqrt(sum(Y1.*conj(Y1))/size(Y1,1)^2)

?

吗?

1 个解决方案

#1


1  

rmsVec(m) = sqrt(sum(wavData{m}(:).^2)/length(wavData{m}(:)));

rmsVec(m)=√总和wavData { m }(:)。^ 2)/长度(wavData { m }(:)));

This is correct.

这是正确的。

But on the other one they used DFT and then some operations with real and imagine part of matrix/vector which I don't understand.

但是在另一个例子中,他们使用了DFT然后用实数做了一些运算想象出矩阵/向量的一部分我不明白。

You can ask about it, however you need to provide more details. What other website are you talking about, what exactly you don't understand there.

你可以询问它,但是你需要提供更多的细节。你说的是什么网站,你不明白的是什么。

I have voicebox library, but I didn't found there calculating rms.

我有语音信箱库,但是我没有在那里找到计算rms。

If you use melcepst

如果你使用melcepst

http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/doc/voicebox/melcepst.html

http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/doc/voicebox/melcepst.html

You can specify E0dD to include energy (RMS)

您可以指定E0dD包括能源(RMS)

          (2) c=melcepst(s,fs,'E0dD')   % include log energy, 0th cepstral coef, delta and delta-delta coefs

You can analyze the code to see what happens under the hood

您可以分析代码,以查看在引擎盖下面发生了什么

rms1 = sqrt(mean(y1.^2))

rms1 =√意味着y1。^ 2))

This is correct

这是正确的

rms2 = sqrt(sum(Y1.*conj(Y1))/size(Y1,1))

rms2 =√总和(Y1。*连词(Y1))/尺寸(1)日元)

This is wrong, it has to be sqrt(sum(Y1.*conj(Y1)))/size(Y1,1) where division goes after sqrt. Because FFT function in matlab does not scale on 1/sqrt(n) and thus non-symmetric. So sum(y.^2) = sum (Y.*conj(Y)) / n you need to divide after sqrt.

这是错的,它必须是√(Y1.*conj(Y1)))/size(Y1,1)除以√之后的结果。因为matlab中的FFT函数在1/sqrt(n)上不能伸缩,因此不对称。所以和(y ^ 2)=和(y *连词(y))/ n后你需要将√。

#1


1  

rmsVec(m) = sqrt(sum(wavData{m}(:).^2)/length(wavData{m}(:)));

rmsVec(m)=√总和wavData { m }(:)。^ 2)/长度(wavData { m }(:)));

This is correct.

这是正确的。

But on the other one they used DFT and then some operations with real and imagine part of matrix/vector which I don't understand.

但是在另一个例子中,他们使用了DFT然后用实数做了一些运算想象出矩阵/向量的一部分我不明白。

You can ask about it, however you need to provide more details. What other website are you talking about, what exactly you don't understand there.

你可以询问它,但是你需要提供更多的细节。你说的是什么网站,你不明白的是什么。

I have voicebox library, but I didn't found there calculating rms.

我有语音信箱库,但是我没有在那里找到计算rms。

If you use melcepst

如果你使用melcepst

http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/doc/voicebox/melcepst.html

http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/doc/voicebox/melcepst.html

You can specify E0dD to include energy (RMS)

您可以指定E0dD包括能源(RMS)

          (2) c=melcepst(s,fs,'E0dD')   % include log energy, 0th cepstral coef, delta and delta-delta coefs

You can analyze the code to see what happens under the hood

您可以分析代码,以查看在引擎盖下面发生了什么

rms1 = sqrt(mean(y1.^2))

rms1 =√意味着y1。^ 2))

This is correct

这是正确的

rms2 = sqrt(sum(Y1.*conj(Y1))/size(Y1,1))

rms2 =√总和(Y1。*连词(Y1))/尺寸(1)日元)

This is wrong, it has to be sqrt(sum(Y1.*conj(Y1)))/size(Y1,1) where division goes after sqrt. Because FFT function in matlab does not scale on 1/sqrt(n) and thus non-symmetric. So sum(y.^2) = sum (Y.*conj(Y)) / n you need to divide after sqrt.

这是错的,它必须是√(Y1.*conj(Y1)))/size(Y1,1)除以√之后的结果。因为matlab中的FFT函数在1/sqrt(n)上不能伸缩,因此不对称。所以和(y ^ 2)=和(y *连词(y))/ n后你需要将√。