Sign in

username:

password:



Not a member?

Search compdsp



Search tips

comp.dsp by Keywords

Adaptive Filter | ADPCM | ADSP | ADSP-2181 | Aliasing | AMR | Anti-Aliasing | ARMA | Autocorrelation | AutoCovariance | Beamforming | Bessel | Blackfin | Butterworth | C6713 | CCS | Chebyshev | CIC Filter | Circular Convolution | Code Composer Studio | Comb Filter | Compression | Convolution | Cross Correlation | DCT | Decimation | Deconvolution | Demodulation | DM642 | DSP Boards | DSP/BIOS | DTMF | Echo Cancellation | Equalization | Equalizer | ETSI | EZLITE (Ez-kit Lite) | FFT | FFTW | FIR Filter | Fixed Point | FSK | G.711 | G.723 | G.729 | Gaussian Noise | Goertzel | GPIO | Hilbert Transform | IFFT | IIR Filter | Interpolation | Invariance | JTAG | Kalman | Laplace Transform | Levinson | LPC | McBSP | MIPS | Modulation | MPEG | Multirate | Notch Filter | Nyquist | OFDM | Oversampling | Pink Noise | Pitch | PLL | Polyphase | QAM | QDMA | Quantization | Quantizer | Radar | Random Noise | Reed Solomon | Remez | Resampling | RTDX | Sampling | Sharc | TI C6711 | Undersampling | Viterbi | Wavelets | White Noise | Wiener Filter | Windowing | XDS510PP | Z Transform

Sponsor

Industry's highest performing at the lowest power DSPs now as low as $5.00*
Start development today!
*volume pricing for 10ku

Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Comp.DSP | VOIP Clock rate adaption

There are 13 messages in this thread.

You are currently looking at messages 0 to 10.


VOIP Clock rate adaption - Rocky - 2007-08-04 15:15:00

Hi All,

In the ISDN environment (T1, E1) there is a 'master' clock and every
satellite device derives its clocking from the next device up the
hierarchy so that the entire network is synchronised.

When using VOIP the clock link is broken. Party A and party B may have
the same nominal sample rate, but because they have independant clock
sources the actual sample rates may vary by a small amount.

If data is sent from A to B eventually there will be a buffer overflow
or a buffer underrun. Since the buffer size in the proposed system is
256 samples at 8000 Hz sample rate giving some 30 msec of buffering I
wondered if anyone could propose an effective sample rate adaption
scheme that could be used.

Or suggest any other method of handling the problem.

Rocky

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: VOIP Clock rate adaption - Steve Underwood - 2007-08-04 15:26:00



Rocky wrote:
> Hi All,
> 
> In the ISDN environment (T1, E1) there is a 'master' clock and every
> satellite device derives its clocking from the next device up the
> hierarchy so that the entire network is synchronised.
> 
> When using VOIP the clock link is broken. Party A and party B may have
> the same nominal sample rate, but because they have independant clock
> sources the actual sample rates may vary by a small amount.
> 
> If data is sent from A to B eventually there will be a buffer overflow
> or a buffer underrun. Since the buffer size in the proposed system is
> 256 samples at 8000 Hz sample rate giving some 30 msec of buffering I
> wondered if anyone could propose an effective sample rate adaption
> scheme that could be used.
> 
> Or suggest any other method of handling the problem.

256 samples is a really short buffer for VoIP. You must expect a very 
low level of jitter. Is this a pure LAN environment? Those are usually 
the only situations where 30ms has a hope of working consistently.

Various rate adaption strategies are used for VoIP. In the normal case, 
the jitter buffer will need to be able to grow to much more than 30ms, 
yet keeping the buffer large badly affects perceived call quality - 
large interactive latency is bad. This means the buffers are usually 
dynamic, and need to be adjusting the flow of samples continuously. The 
simplistic flow adjustment method is to drop or insert samples in the 
quiet periods. The smarter method is to dynamically adjust the playback 
rate, using a constant pitch rate adjusting algorithm, like PSOLA or PICOLA.

Its an interesting area, and one still subject to interesting research.

Regards,
Steve
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: VOIP Clock rate adaption - Rocky - 2007-08-05 03:10:00

On Aug 4, 9:26 pm, Steve Underwood <ste...@dis.org> wrote:
> Rocky wrote:
> > Hi All,
>
> > In the ISDN environment (T1, E1) there is a 'master' clock and every
> > satellite device derives its clocking from the next device up the
> > hierarchy so that the entire network is synchronised.
>
> > When using VOIP the clock link is broken. Party A and party B may have
> > the same nominal sample rate, but because they have independant clock
> > sources the actual sample rates may vary by a small amount.
>
> > If data is sent from A to B eventually there will be a buffer overflow
> > or a buffer underrun. Since the buffer size in the proposed system is
> > 256 samples at 8000 Hz sample rate giving some 30 msec of buffering I
> > wondered if anyone could propose an effective sample rate adaption
> > scheme that could be used.
>
> > Or suggest any other method of handling the problem.
>
> 256 samples is a really short buffer for VoIP. You must expect a very
> low level of jitter. Is this a pure LAN environment? Those are usually
> the only situations where 30ms has a hope of working consistently.
>
> Various rate adaption strategies are used for VoIP. In the normal case,
> the jitter buffer will need to be able to grow to much more than 30ms,
> yet keeping the buffer large badly affects perceived call quality -
> large interactive latency is bad. This means the buffers are usually
> dynamic, and need to be adjusting the flow of samples continuously. The
> simplistic flow adjustment method is to drop or insert samples in the
> quiet periods. The smarter method is to dynamically adjust the playback
> rate, using a constant pitch rate adjusting algorithm, like PSOLA or PICOLA.

The application is evisaged to be a dedicated replacement of an E1
card on Asterisk, so it would be a dedicated LAN card feeding one or
two of these 32 port units.

We currently have an E1 channel bank but have found that some of the
available E1 cards for Asterisk will lock up to the extent that a
power down reset is required to get it up again. Also, the E1 cards
are relatively expensive so we are exploring the idea of using a LAN
card instead of the E1 card and creating an IAX2 to PCM hiway.

I was thinking of using a scheme where we could change the PCM clock
by up to 0.1% - possibly only use up to 30 channels and add or deleted
a clock per frame. i.e. some frames with 255 or 257 bits. This would
be conrolled by attempting to keep the buffers half full (the ones in
use!).

Maybe each channel needs to be handle seperately - what if the
Asterisk unit is just a gateway?

Thanks for the input Steve.

Rocky

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: VOIP Clock rate adaption - Vladimir Vassilevsky - 2007-08-06 10:05:00


Rocky wrote:
> Hi All,
> 
> In the ISDN environment (T1, E1) there is a 'master' clock and every
> satellite device derives its clocking from the next device up the
> hierarchy so that the entire network is synchronised.
> 
> When using VOIP the clock link is broken. Party A and party B may have
> the same nominal sample rate, but because they have independant clock
> sources the actual sample rates may vary by a small amount.

The typical approach is to track the rate mismatch until the difference 
will reach +/- 1 sample, and then just drop or repeat a sample. If this 
does not happen very often, the effect is barely audible. Of course, an 
interpolation would be better, however the simple +/- sample is good enough.

Vladimir Vassilevsky

DSP and Mixed Signal Design Consultant

http://www.abvolt.com
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: VOIP Clock rate adaption - Steve Underwood - 2007-08-06 14:31:00

Vladimir Vassilevsky wrote:
> 
> 
> Rocky wrote:
>> Hi All,
>>
>> In the ISDN environment (T1, E1) there is a 'master' clock and every
>> satellite device derives its clocking from the next device up the
>> hierarchy so that the entire network is synchronised.
>>
>> When using VOIP the clock link is broken. Party A and party B may have
>> the same nominal sample rate, but because they have independant clock
>> sources the actual sample rates may vary by a small amount.
> 
> The typical approach is to track the rate mismatch until the difference 
> will reach +/- 1 sample, and then just drop or repeat a sample. If this 
> does not happen very often, the effect is barely audible. Of course, an 
> interpolation would be better, however the simple +/- sample is good 
> enough.

Inserting or dropping a sample generally causes a nasty click. The rates 
are likely to be sufficiently different that these clicks might happen 
once a second, though will generally be less frequent than that. In 
telephony this generally considered an unacceptable solution.

Steve
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: VOIP Clock rate adaption - Rocky - 2007-08-06 15:57:00

On Aug 6, 8:31 pm, Steve Underwood <ste...@dis.org> wrote:
> Vladimir Vassilevsky wrote:
>
> > Rocky wrote:
> >> Hi All,
>
> >> In the ISDN environment (T1, E1) there is a 'master' clock and every
> >> satellite device derives its clocking from the next device up the
> >> hierarchy so that the entire network is synchronised.
>
> >> When using VOIP the clock link is broken. Party A and party B may have
> >> the same nominal sample rate, but because they have independant clock
> >> sources the actual sample rates may vary by a small amount.
>
> > The typical approach is to track the rate mismatch until the difference
> > will reach +/- 1 sample, and then just drop or repeat a sample. If this
> > does not happen very often, the effect is barely audible. Of course, an
> > interpolation would be better, however the simple +/- sample is good
> > enough.
>
> Inserting or dropping a sample generally causes a nasty click. The rates
> are likely to be sufficiently different that these clicks might happen
> once a second, though will generally be less frequent than that. In
> telephony this generally considered an unacceptable solution.
>

Would it be reasonable to do minimal buffering for the VoIP TX path so
as to allocate more RAM to the RX path and let the remote receiver
'worry' about the rate adaption for TX, only taking care of the
locally received data?

Rocky

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: VOIP Clock rate adaption - Adrian Hey - 2007-08-06 16:01:00

Steve Underwood wrote:
> Vladimir Vassilevsky wrote:
>> The typical approach is to track the rate mismatch until the 
>> difference will reach +/- 1 sample, and then just drop or repeat a 
>> sample. If this does not happen very often, the effect is barely 
>> audible. Of course, an interpolation would be better, however the 
>> simple +/- sample is good enough.
> 
> Inserting or dropping a sample generally causes a nasty click. The rates 
> are likely to be sufficiently different that these clicks might happen 
> once a second, though will generally be less frequent than that. In 
> telephony this generally considered an unacceptable solution.

I believe SDH interfaces between telcos do allow such slips for
plesiosynchronous operation. But telcos use very accurate clocks
so I guess such slips are very rare (I'm not sure how rare).

Regards
--
Adrian Hey


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: VOIP Clock rate adaption - Adrian Hey - 2007-08-06 17:06:00

Rocky wrote:
> We currently have an E1 channel bank but have found that some of the
> available E1 cards for Asterisk will lock up to the extent that a
> power down reset is required to get it up again. Also, the E1 cards
> are relatively expensive so we are exploring the idea of using a LAN
> card instead of the E1 card and creating an IAX2 to PCM hiway.
> 
> I was thinking of using a scheme where we could change the PCM clock
> by up to 0.1% - possibly only use up to 30 channels and add or deleted
> a clock per frame. i.e. some frames with 255 or 257 bits. This would
> be conrolled by attempting to keep the buffers half full (the ones in
> use!).
> 
> Maybe each channel needs to be handle seperately - what if the
> Asterisk unit is just a gateway?

I dunno about Asterisk, but there are products that seem to be
doing what you want (AFAICT) available off the shelf. A quick
google reveals this..
  http://www.ghipsystems.com/en/Products/IPM-en/IPM-en.html
.. but I'm sure there are others.

If you want to do it yourself it shouldn't be to hard. I've done
something similar on Blackfin and I also designed it to cope
with +/- 0.1% clock freq errors, which seems generous even for
really cheap inaccurate crystals.

ADI have useful app notes about this kind of thing. A software
implementation should easily be able to deal with 30 channels
on 1 DSP. My implementation worked out at about 9 Mips per
channel, but that was bi-directional 16 KHz <-> 48 KHz
asynchronous resampling. If you only need it to work at 8 KHz
on the incoming network side I guess you will need less Mips.

I was fortunate enough to be dealing with TDM on both sides, and
in this case you can derive all the timing information you need by
time tagging the DMA interrupts and doing a few calculations.
I think you could do something similar, but with a network
interface on one side you need to deal with much higher jitter
in arrival times (of course).

BTW, if you're using E1 then I guess you're using G711 codec.
If so then you may also want to consider implementing the
packet loss concealment appendix..
  http://www.itu.int/rec/T-REC-G.711-199909-I!AppI/en

I'm not sure about using exotic constant pitch time stretching
or compressing algorithms. It seems like a lot of work to me.
If you find your jitter buffer getting dangerously near empty
or over full I would have thought it would be OK to temporarily
allow largish variation in your synthesised resampling clock (but
don't have sudden step changes in freq) e.g. +/- 5% would
probably sound OK for speech and allow you to play catch up or
slow down at 50mS/S (just guessing here, I've never actually
tried it).

Regards
--
Adrian Hey

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: VOIP Clock rate adaption - John - 2007-08-06 17:28:00

On Aug 6, 5:06 pm, Adrian Hey <a...@NoSpicedHam.iee.org> wrote:
> Rocky wrote:
> > We currently have an E1 channel bank but have found that some of the
> > available E1 cards for Asterisk will lock up to the extent that a
> > power down reset is required to get it up again. Also, the E1 cards
> > are relatively expensive so we are exploring the idea of using a LAN
> > card instead of the E1 card and creating an IAX2 to PCM hiway.
>
> > I was thinking of using a scheme where we could change the PCM clock
> > by up to 0.1% - possibly only use up to 30 channels and add or deleted
> > a clock per frame. i.e. some frames with 255 or 257 bits. This would
> > be conrolled by attempting to keep the buffers half full (the ones in
> > use!).
>
> > Maybe each channel needs to be handle seperately - what if the
> > Asterisk unit is just a gateway?
>
> I dunno about Asterisk, but there are products that seem to be
> doing what you want (AFAICT) available off the shelf. A quick
> google reveals this..
>  http://www.ghipsystems.com/en/Products/IPM-en/IPM-en.html
> .. but I'm sure there are others.
>
> If you want to do it yourself it shouldn't be to hard. I've done
> something similar on Blackfin and I also designed it to cope
> with +/- 0.1% clock freq errors, which seems generous even for
> really cheap inaccurate crystals.
>
> ADI have useful app notes about this kind of thing. A software
> implementation should easily be able to deal with 30 channels
> on 1 DSP. My implementation worked out at about 9 Mips per
> channel, but that was bi-directional 16 KHz <-> 48 KHz
> asynchronous resampling. If you only need it to work at 8 KHz
> on the incoming network side I guess you will need less Mips.
>
> I was fortunate enough to be dealing with TDM on both sides, and
> in this case you can derive all the timing information you need by
> time tagging the DMA interrupts and doing a few calculations.
> I think you could do something similar, but with a network
> interface on one side you need to deal with much higher jitter
> in arrival times (of course).
>
> BTW, if you're using E1 then I guess you're using G711 codec.
> If so then you may also want to consider implementing the
> packet loss concealment appendix..
>  http://www.itu.int/rec/T-REC-G.711-199909-I!AppI/en
>
> I'm not sure about using exotic constant pitch time stretching
> or compressing algorithms. It seems like a lot of work to me.
> If you find your jitter buffer getting dangerously near empty
> or over full I would have thought it would be OK to temporarily
> allow largish variation in your synthesised resampling clock (but
> don't have sudden step changes in freq) e.g. +/- 5% would
> probably sound OK for speech and allow you to play catch up or
> slow down at 50mS/S (just guessing here, I've never actually
> tried it).
>
> Regards
> --
> Adrian Hey

I worked on a system that did just that, but unfortunately it
could not decode DTMF when the rate was adapting.

John

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: VOIP Clock rate adaption - Steve Underwood - 2007-08-06 20:34:00

Adrian Hey wrote:
> Steve Underwood wrote:
>> Vladimir Vassilevsky wrote:
>>> The typical approach is to track the rate mismatch until the 
>>> difference will reach +/- 1 sample, and then just drop or repeat a 
>>> sample. If this does not happen very often, the effect is barely 
>>> audible. Of course, an interpolation would be better, however the 
>>> simple +/- sample is good enough.
>>
>> Inserting or dropping a sample generally causes a nasty click. The 
>> rates are likely to be sufficiently different that these clicks might 
>> happen once a second, though will generally be less frequent than 
>> that. In telephony this generally considered an unacceptable solution.
> 
> I believe SDH interfaces between telcos do allow such slips for
> plesiosynchronous operation. But telcos use very accurate clocks
> so I guess such slips are very rare (I'm not sure how rare).

Public exchanges use Rhubidium clocks, so slips are pretty rare. When 
you try allowing slips with a PBX it sounds bad. Also, for a pure PSTN 
application, regular slips would prevent almost any modem from working 
over the path.

Steve
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

| 1 | 2 | next