Active Speech Level

Active Speech Level

Is there an IPP primitive to efficiently estimate the active speech level of a microphone input? Not necessarily only speech, but audio energy similar to how Windows Vista/7 displays a a logarithmic scale for the current volume of a speaker/microphone. I would like to distinguish an active G.711 source from an inactive one, and give a volume percentage for the active ones.

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Naveen Gv (Intel)'s picture

Hi Martin,

Probably you are looking into some kind of Line Level functions, I dont think IPP has such type of function.

Thanks,

Naveen Gv

Naveen Gv (Intel)'s picture

Hi,

You can use following code to find audio signal level

{

Ipp32f tmpMinS,tmpMaxS;

Ipp32f m_PeakAmpdB;

ippsMinMax_32f(fileData, sizeSamples, &tmpMinS, &tmpMaxS);

Ipp32f maxAbsSample = IPP_MAX(fabs(tmpMinS),fabs(tmpMaxS));

if(maxAbsSample > 0) {

m_PeakAmpdB = 20.f * log10(maxAbsSample / 32768.f);

} else {

m_PeakAmpdB = -91.f;

}

}

Regards,

Naveen Gv

Thanks for the replies Naveen!

How does your code work? Could you explain where the 20.f and -91.f constants come from? Why do you measure dB negatively? I suppose -91dB represents silence whereas 0dB represents maximum volume; is that correct?

Naveen Gv (Intel)'s picture

Hi Martin,
You are right,

Amp(dB) = 20 lg(S/N), where S- random signal, N - noise

If S=1 then Amp(dB) = 20 lg(1/N) = -91 this is silence.

Thanks,
Naveen Gv

Hi,What is mean of 32768.f here. Also this is you used for the 32 bit data. If I have 16 bit data what value we have to use.Thanks,Bharat Agarwal

>>...Why do you measure dB negatively?

A signal strength is measured in dB ( dBm in case of a radio signal, likeWi-Fi, etc )and it means that
a -50 dBsignal is stronger than a-70 dB signal.

Here is anexample for some abstract signal:

-10 dB could be considered as"Excellent"
-25 dB could be considered as"Very Good"
-50 dB could be considered as"Good"
-70 dB could be considered as"Poor"
-90 dB could be considered as"No Signal"

Best regards,
Sergey

Hi,
Exactly, this is code for 16 bit data as32768.f is absolute maximum sample value for 16 bit sighned data.
You can change 32f function version to 16s to not doing data type convertion.

Igor S. Belyakov

Login to leave a comment.