A kind of AMBE-2000 vocoder coding data code flow control method
(1) technical field
The present invention relates to the communications field, be specifically related to a kind of AMBE-2000 vocoder coding data code flow control method, its control method can guarantee that the data code flow that external devices reads can not cause the decoder decode mistake when vocoder coding output speed and external devices reading rate out of true are coincide.
(2) background technology
The AMBE-2000 vocoder is high-performance, the low-power consumption of a employings AMBE (Advanced Multi-Band Excitation, the senior many bands encourage) algorithm of DVSI company research and development, the compress speech chip of full duplex variable bit rate.This chip compressibility can be between 2.0kbps-9.6kbps free adjustment, and have that forward error correction (FEC), voice activation detect (VAD), touch-tone signal detects functions such as (DTMF) and echo cancellation.
The AMBE-2000 vocoder is made of the encoder two independent parts.Scrambler receives the speech data of 8kHz sampling rate (can be 16 bit linear, 8 A rules or 8 μ rules) and realizes voice coding in the sheet, and to specify code check output.The code stream decoding of demoder received code device output becomes voice signal, and the interface sequence of encoder is fully asynchronous.
In conventional design, external devices is when reading AMBE-2000 vocoder coding data, its processing clock should be in full accord with AMBE-2000 vocoder coding output speed, otherwise when external devices reads clock greater than AMBE-2000 vocoder coding output speed, the FIFO of AMBE-2000 vocoder coding device (First In First Out, the FIFO data buffering device) can be read sky, cause external devices can't continue to read continuous data code flow; When external devices read clock less than AMBE-2000 vocoder coding output speed, the FIFO of AMBE-2000 vocoder coding device can be write full, and this moment, the AMBE-2000 vocoder can abandon the Frame of not reading automatically.
Because the coded data code stream form of AMBE-2000 vocoder is also unexposed, when the external devices reading rate coincide with vocoder coding output speed out of true, can't be on the data code flow structure increase and decrease continuity with the assurance data code flow to data.Data code flow blindly deletes that operation can cause AMBE-2000 vocoder demoder to lose synchronously, causes the interruption of sound hundreds of millisecond.The present invention proposes a kind of AMBE-2000 vocoder coding data code flow control method, data code flow after can guaranteeing to handle can not cause AMBE-2000 vocoder demoder to lose synchronously, the nearly 20 milliseconds dumb sound of voice signal of demoder output, little to the influence of sound total quality.
(3) summary of the invention
The technical problem to be solved in the present invention provides a kind of AMBE-2000 vocoder coding data code flow control method, its control method can guarantee that the data code flow that external devices reads can not cause the decoder decode mistake when vocoder coding output speed and external devices reading rate out of true are coincide.
The AMBE-2000 vocoder is when work, change at level of EPR (Encoder Packet Ready) pin output every about 20 milliseconds of meetings by high step-down, finish with the indication encoder encodes, at this moment, external devices can be according to the data read sequential sense data of AMBE-2000 vocoder.
Having under the format pattern, per 20 milliseconds of output one frame data of scrambler comprise 24 Word, and each Word comprises 16 Bit datas.Wherein preceding 12 Word are frame head information, and back 12 Word are coded data.
Under unformatted pattern, per 20 milliseconds of output one frame data of scrambler comprise N Word, and each Word comprises 16 Bit datas.N=BPS*0.02/BPW wherein, BPS represent the scrambler bit rate output that presets, and scope is 2.0k-9.6k, the significant bit number that each Word that BPW represents to preset comprises, and value is 1-4.
According to an aspect of the present invention, provide a kind of AMBE-2000 vocoder coding data code flow control method, comprised the following steps:
1) after the system reset, external devices is waited for the negative edge of AMBE-2000 vocoder epr signal;
2) interim when the epr signal negative edge, encoded the finishing of one frame data of expression AMBE-2000 vocoder, external devices deposits data in data buffer according to the data read sequential, finish when these frame data are about to read, external devices continues to detect the negative edge of AMBE-2000 vocoder epr signal;
3) repeating step 2) described method continues to read the next code frame and deposits the data buffer in;
In said method, described step 2) also comprise:
21) when external devices reads clock greater than AMBE-2000 vocoder coding output speed, after running through a frame coded data, the AMBE-2000 vocoder does not provide the negative edge of epr signal, encoded the finishing of indication next frame data, cause external devices can't continue to read continuous data code flow, 0 of one group of whole frame length of the automatic generation of external devices this moment reads clock rate as the data infilled frame according to external devices and deposits buffer zone in, during this period, if the negative edge of epr signal arrives, then store follow-up the resuming studies that finish and get AMBE-2000 vocoder coding data at infilled frame;
22) when external devices reads clock less than AMBE-2000 vocoder coding output speed, the AMBE-2000 vocoder still can provide the negative edge of epr signal after every frame end-of-encode, the flow performing that external devices only need read a Frame in strict accordance with the negative edge of an epr signal gets final product, cause FIFO to be write completely if AMBE-2000 vocoder coding device data overstock, the AMBE-2000 vocoder can abandon the Frame of not reading automatically;
In said method, external devices is Spartan 3 FPGA of Xilinx company in the described step 1);
In said method, described step 2) standard that the data read sequential is mentioned for the AMBE-2000 user manual in reads sequential;
In said method, described step 2) data buffer is FIFO in, and the degree of depth is 1024, and width is 1 bit;
In said method, described step 21) the whole frame length calculation method is as follows in:
Having under the format pattern, frame data comprise 24 Word, and each Word comprises 16 Bit datas, altogether the 24*16=384 bit; Under unformatted pattern, frame data comprise N Word, and each Word comprises 16 Bit datas, N=BPS*0.02/BPW wherein, BPS represent the scrambler bit rate output that presets, and scope is 2.0k-9.6k, the significant bit number that each Word that BPW represents to preset comprises, value is 1-4.
A kind of AMBE-2000 vocoder coding data code flow control method provided by the invention, can guarantee when vocoder coding output speed and external devices reading rate out of true are coincide, the data code flow that external devices reads can not cause the decoder decode mistake, the nearly 20 milliseconds dumb sound of voice signal of demoder output, little to the influence of sound total quality.
(4) description of drawings
Figure 1A MBE-2000 vocoder coding data code flow control method entire block diagram;
Fig. 2 AMBE-2000 vocoder coding data code flow control method process flow diagram.
(5) embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, AMBE-2000 vocoder coding data code flow control method is according to an embodiment of the invention further described below in conjunction with accompanying drawing.The invention provides a kind of AMBE-2000 vocoder coding data code flow control method, its entire block diagram comprises the following steps: 1 referring to accompanying drawing 1) after the system reset, external devices is waited for the negative edge of AMBE-2000 vocoder epr signal; 2) next interim when the epr signal negative edge, external devices deposits data in data buffer according to the data read sequential, finishes when these frame data are about to read, and external devices continues to detect the negative edge of AMBE-2000 vocoder epr signal; 3) when vocoder coding output speed and external devices reading rate out of true are coincide, adopt the method for infilled frame to guarantee the continuity of data code flow.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
AMBE-2000 vocoder mode of operation is unformatted in the present embodiment, and the scrambler bit rate output is 8kbps, and it is 1 that each Word comprises effective bit number; External devices is the Spartan 3FPGA of Xilinx company, opens a degree of depth 1024 on the sheet, the FIFO of width 1 bit, and the preferred circuit that FPGA adopts the AMBE-2000 user manual to mention is connected with the AMBE-2000 vocoder, finishes initial configuration.
Figure is referring to accompanying drawing 2 for this system works flow process.
Behind the system power-on reset, FPGA detects the negative edge of AMBE-2000 vocoder epr signal.
When the epr signal negative edge comes temporarily, FPGA enters read states, coded data is read and deposited in FIFO on the sheet with the clock of 8k, meanwhile, FPGA continues to detect the negative edge of AMBE-2000 vocoder epr signal, after FPGA jumps out this frame read states, proceeds reading of next frame.
When the 8k of FPGA clock during greater than the coding output speed of AMBE-2000 vocoder, after running through a frame coded data, the AMBE-2000 vocoder does not provide the negative edge of next frame epr signal, FPGA generated 8k*0.02/1=160 0 automatically and deposited FIFO as the data infilled frame in the speed of 8k this moment, during this period, if FPGA detects the negative edge of epr signal, then store follow-up the resuming studies that finish and get AMBE-2000 vocoder coding data at infilled frame.
When external devices reads clock less than AMBE-2000 vocoder coding output speed, the AMBE-2000 vocoder still can provide the negative edge of epr signal after every frame end-of-encode, the flow performing that FPGA only need read a Frame in strict accordance with the negative edge of an epr signal gets final product, cause FIFO to be write completely if AMBE-2000 vocoder coding device data overstock, the AMBE-2000 vocoder can abandon the Frame of not reading automatically.
When this data code flow was delivered to AMBE-2000 vocoder demoder and decoded, 160 0 of the data infilled frame can not caused demoder to lose synchronously, only can produce one 20 milliseconds dumb sound, little to the quality of speech signal influence.
Should be noted that and understand, under the situation that does not break away from the desired the spirit and scope of the present invention of accompanying Claim, can make various modifications and improvement the present invention of foregoing detailed description.Therefore, the scope of claimed technical scheme is not subjected to given any specific exemplary teachings and restriction.