- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Martin,
You are right,
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>...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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page