Alexander Chemeris
2009-Jun-29 17:57 UTC
[Speex-dev] Delays estimation in Speex algorithms
Hi, I want to do a careful measure of mic-to-net and net-to-spkr delays in sip media engine and to make it really precise I need to know delays, introduced by Speex algorithms. In particular, I'm interested in delays of: 1) encoder in NB, WB and UWB modes, 2) decoder (I guess it should be 0?) 3) resampler. I think it varies depending on input rate to output rate ratio. Any generic formula or at least values for specific ratios available? 4) AEC 5) preprocessor If anyone knows delays added by at least some of these algorithms, please, share this knowledge. I believe that this is worth doing and I promise to compile a patch to Speex documentation with obtained values and formulas. In VoIP we fight for every ms of latency, so lets make people more aware of the actual values. -- Regards, Alexander Chemeris. SIPez LLC. SIP VoIP, IM and Presence Consulting http://www.SIPez.com tel: +1 (617) 273-4000
Alexander Chemeris a ?crit :> I want to do a careful measure of mic-to-net and net-to-spkr delays > in sip media engine and to make it really precise I need to know > delays, introduced by Speex algorithms. In particular, I'm interested > in delays of: > 1) encoder in NB, WB and UWB modes,NB: 25 ms, WB: ~28 ms, UWB: ~30 ms> 2) decoder (I guess it should be 0?)5 ms> 3) resampler. I think it varies depending on input rate to output rate > ratio. Any generic formula or at least values for specific ratios available?The higher the quality, the higher the delay> 4) AEC0 ms> 5) preprocessor1 frame extra delay (i.e. you get back the last frame you sent the last time) Jean-Marc
Alexander Chemeris
2009-Jul-01 16:02 UTC
[Speex-dev] Delays estimation in Speex algorithms
Thank you for clarification. I attached a patch which (IMHO) makes it more clear for everyone who just read Doxygen docs. Resampler latency docs wording was just ambiguous IMO, so I made it more robust to fast reading. On Wed, Jul 1, 2009 at 5:16 PM, Jean-Marc Valin<jean-marc.valin at usherbrooke.ca> wrote:> Alexander Chemeris a ?crit : >> On Tue, Jun 30, 2009 at 4:38 AM, Jean-Marc >> Valin<jean-marc.valin at usherbrooke.ca> wrote: >>> Alexander Chemeris a ?crit : >>>> 2) decoder (I guess it should be 0?) >>> 5 ms >> >> Hum, interesting. So, e.g. for NB mode delay is >> 20 (packet size) + 5 (encoder lookahead) + 5 (decoder delay) = 30, right? > > Correct > >>>> 3) resampler. I think it varies depending on input rate to output rate >>>> ratio. Any generic formula or at least values for specific ratios available? >>> The higher the quality, the higher the delay >> >> Seems we need to update our Speex sources. Our version has no >> speex_resampler_get_[out|in]put_latency() functions. Should I >> sum values of input and output latency to get overall latency? >> Actually, why do you separate input and output latency? For >> a user, resampler is a black-box, which logically has a single >> latency value. Two latencies are confusing. > > You don't sum them, you just get the latency in different units. > speex_resampler_get_input_latency() will return the latency in input > samples, while the other will give you the same value, but expressed as > a number of output samples. > > ? ? ? ?Jean-Marc >-- Regards, Alexander Chemeris. SIPez LLC. SIP VoIP, IM and Presence Consulting http://www.SIPez.com tel: +1 (617) 273-4000 -------------- next part -------------- A non-text attachment was scrubbed... Name: speex-latency-comments.diff Type: text/x-diff Size: 1458 bytes Desc: not available Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20090701/90366ff0/attachment.diff
Alexander Chemeris
2009-Jul-01 17:59 UTC
[Speex-dev] Delays estimation in Speex algorithms
First patch fixes two typos in manual. Second patch adds few notes about latency, as promised. Hopefully I haven't added any typos and grammar errors :) On Wed, Jul 1, 2009 at 8:02 PM, Alexander Chemeris<Alexander.Chemeris at sipez.com> wrote:> Thank you for clarification. I attached a patch which (IMHO) > makes it more clear for everyone who just read Doxygen > docs. Resampler latency docs wording was just ambiguous > IMO, so I made it more robust to fast reading. > > On Wed, Jul 1, 2009 at 5:16 PM, Jean-Marc > Valin<jean-marc.valin at usherbrooke.ca> wrote: >> Alexander Chemeris a ?crit : >>> On Tue, Jun 30, 2009 at 4:38 AM, Jean-Marc >>> Valin<jean-marc.valin at usherbrooke.ca> wrote: >>>> Alexander Chemeris a ?crit : >>>>> 2) decoder (I guess it should be 0?) >>>> 5 ms >>> >>> Hum, interesting. So, e.g. for NB mode delay is >>> 20 (packet size) + 5 (encoder lookahead) + 5 (decoder delay) = 30, right? >> >> Correct >> >>>>> 3) resampler. I think it varies depending on input rate to output rate >>>>> ratio. Any generic formula or at least values for specific ratios available? >>>> The higher the quality, the higher the delay >>> >>> Seems we need to update our Speex sources. Our version has no >>> speex_resampler_get_[out|in]put_latency() functions. Should I >>> sum values of input and output latency to get overall latency? >>> Actually, why do you separate input and output latency? For >>> a user, resampler is a black-box, which logically has a single >>> latency value. Two latencies are confusing. >> >> You don't sum them, you just get the latency in different units. >> speex_resampler_get_input_latency() will return the latency in input >> samples, while the other will give you the same value, but expressed as >> a number of output samples. >> >> ? ? ? ?Jean-Marc >> > > > > -- > Regards, > Alexander Chemeris. > > SIPez LLC. > SIP VoIP, IM and Presence Consulting > http://www.SIPez.com > tel: +1 (617) 273-4000 >-- Regards, Alexander Chemeris. SIPez LLC. SIP VoIP, IM and Presence Consulting http://www.SIPez.com tel: +1 (617) 273-4000 -------------- next part -------------- A non-text attachment was scrubbed... Name: speex-manual-typos.diff Type: text/x-diff Size: 897 bytes Desc: not available Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20090701/1a2e4703/attachment-0002.diff -------------- next part -------------- A non-text attachment was scrubbed... Name: speex-manual-addons.diff Type: text/x-diff Size: 2838 bytes Desc: not available Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20090701/1a2e4703/attachment-0003.diff