A kind of apparatus and method of analog optical signal error code
Technical field
The present invention relates to the communications field, relate to a kind of apparatus and method of analog optical signal error code specifically, so that communication system is carried out performance test.
Background technology
Present many communication systems often will communicate with light signal, in this type systematic, and the influence that the error code that often needs the checking light signal to introduce in transmission course produces whole system.Because of light signal when transmitting, might produce error code because of factor such as chromatic dispersion, optical power attenuation, transmitted power fluctuation, receiving sensitivity fluctuation, optical signal transceiver clock are asynchronous, optical transmission medium is interfered destruction, and error code is inevitable under imperfect environment.Therefore when this type of communication system of design, need the performance of verification system under the different optical transmission error rates and the optical transmission error rate of the maximum that can tolerate of system.
And prior art be by utilize optical attenuator to increase decay, increase long haul optical transmission medium, artificial increasing disturb, and as plugging the optical transmission medium connector repeatedly fast, utilizes optical switch to carry out repeatedly that simulation that method such as switch is similar to realizes.
Obviously, the use of above-mentioned prior art is very inconvenient, has a lot of deficiencies, mainly comprises:
1, because the difference between different optical transceiver modules, the optical transmission error rate and light decrement, optical transmission medium length there is no clear and definite corresponding relation, when needing simulated bit error and do not know great attenuation of needs and optical transmission medium length, can't simulate the error rate of appointment;
2, since optical transceiver module transmitting power and receiving sensitivity can be in time, factors such as ambient temperature, supply power voltage fluctuate, even neither a determined value to the identical error rate that decay simulated of same optical module increase;
3, because the attenuation of existing optical attenuator is difficult to accomplish fine setting, optical transmission medium length is difficult to adjust more, and the error rate can't be accomplished fine setting when simulated bit error;
4, with artificial plug optical transmission medium or optical switch the break-make of optical transmission medium is controlled because response speed is slow, can only be simulated a large amount of error bursts, uncontrollable equally to the error rate.
Technology contents
At said circumstances, the present invention proposes a kind of apparatus and method of analog optical signal error code, can be efficiently, accurately, stable, communication system is carried out the validation test of transmission error code influence easily.
To achieve these goals, the present invention at first provides a kind of device of analog optical signal error code, and this device comprises:
Photoelectric conversion module is used for receiving optical signals and is converted into digital signal;
Clock Extraction module: be used to extract the clock signal identical with data signal rate;
Multichannel error code generation module is used to produce and comprises the digital signal of testing required error code;
Electrooptic conversion module is used for digital signal is converted to light signal;
After light signal enters this photoelectric conversion module and is converted into digital signal, enter this Clock Extraction module to extract the clock signal identical with data signal rate, enter described multichannel error code generation module simultaneously by the digital signal of this photoelectric conversion module output and the clock signal of exporting by this Clock Extraction module, generation comprises the digital signal of testing required error code, this digital signal is converted to light signal by described electrooptic conversion module, and output.
Said apparatus also further comprises:
Serial/parallel modular converter is used for the serial digital signal of two-forty is converted to the parallel digital signal of low rate;
Clock frequency division module is used for the clock signal frequency division is the clock signal identical with parallel digital signal speed;
Parallel/serial modular converter is used for the parallel digital signal of low rate is reduced to the serial digital signal of two-forty;
Enter this serial/parallel modular converter by the digital signal of described photoelectric conversion module output and carry out the conversion of digital signal, and enter the frequency division that this clock frequency division module carries out clock signal by the clock signal that described Clock Extraction module extracts, digital signal after the conversion and clock signal enter described multichannel error code generation module, enter the frequency retrieval that this parallel/serial modular converter carries out digital signal and clock signal by digital signal of testing required error code comprising of its output and clock signal, the digital signal after the recovery enters electrooptic conversion module to convert light signal output to.
Described multichannel error code generation module is made up of several single channel error code generation modules, and single channel error code generation module is made up of XOR gate, pseudorandom number generator, comparator, error rate setting apparatus, the error rate that the pseudo-random number sequence that is produced by this pseudorandom number generator and this error rate setting apparatus are set enters described comparator simultaneously and compares, comparative result that is produced by this comparator and digital signal value enter XOR gate and carry out XOR, and the result that generates exports as digital signal.
The present invention has also proposed a kind of method of analog optical signal error code simultaneously, comprises following steps:
A, receiving optical signals are converted into digital signal;
B, the extraction clock signal identical with data signal rate;
C, under the control of clock signal, by the error rate that sets digital signal is disturbed with generation to comprise the digital signal of testing required error code;
D, the digital signal of testing required error code that comprises that is produced is converted to light signal, and output.
Between described step b and described step c, also comprise step bc:
The speed of bc, judgement digital signal, when if this speed is low, go to step c, otherwise, the serial digital signal of two-forty is converted to the parallel digital signal of low rate, and the clock signal identical with this serial digital signal speed that will extract simultaneously is converted to the clock signal identical with parallel digital signal speed;
Between described step c and steps d, also comprise step cd:
If judge among the cd step bc when speed of digital signal is low, go to steps d, otherwise, with the digital signal of testing required error code is converted to two-forty by the parallel digital signal of low rate the serial digital signal that comprises that is produced.
The speed of the parallel digital signal after being converted among the described step bc becomes the ratio of former serial digital signal speed and parallel data line width, the frequency of the clock signal after being converted becomes the ratio of original clock signal frequency and parallel data line width, and the speed of the serial digital signal after being converted among the described step cd becomes the product of former parallel digital signal speed and parallel data line width.
Described step c specifically comprises following steps:
C1, generation pseudo-random number sequence and the required error rate set point of setting test;
C2, the two is compared;
C3, digital signal value and comparative result are carried out XOR comprise the digital signal of testing required error code with generation.
The method that compares among the described step c2 is to adopt, if described pseudo-random number sequence is less than or equal to described error rate set point, then comparative result is 1, otherwise comparative result is 0.
Adopt technical solutions according to the invention, not only can finish the performance of the simulation of light signal error code, and the error rate of being simulated can be set accurately with testing communication system; The error rate scope that can simulate is big, and from 0 to 100%; The error rate of simulation can not change because of the influence of environment; Make testing efficiency improve greatly; Reduced the cost of test.
Introduce the present invention in detail below in conjunction with description of drawings and specific implementation.
Description of drawings
Fig. 1 is the The general frame of the device of the described a kind of analog optical signal error code of the embodiment of the invention;
Fig. 2 is the structured flowchart of single channel error code generation module in the device of the described a kind of analog optical signal error code of the embodiment of the invention;
Fig. 3 is the method flow diagram of the described a kind of analog optical signal error code of the embodiment of the invention;
Fig. 4 is the flow chart of step 3 in the method for a kind of analog optical signal error code described in the embodiment of the invention.
Specific implementation
Be illustrated in figure 1 as the device of embodiment of the invention analog optical signal error code, its composition comprises:
Photoelectric conversion module 1 is used for receiving optical signals and is converted into binary digital signal;
Serial/parallel modular converter 2 is used for the serial digital signal of two-forty is converted to the parallel digital signal of low rate;
Clock Extraction module 3 is used to extract the clock signal identical with serial digital signal speed;
Clock frequency division module 4 is used for the clock signal frequency division is the clock signal identical with parallel digital signal speed;
Multichannel error code generation module 5 is used to produce and comprises the digital signal of testing required error code;
Parallel/serial modular converter 6 is used for the parallel digital signal of low rate is reduced to the serial digital signal of two-forty;
Electrooptic conversion module 7 is used for digital signal is converted to light signal, and output.
Wherein, described multichannel error code generation module 5 is made up of n single channel error code generation module 51, and single channel error code generation module 51 is made up of XOR gate 511, pseudorandom number generator 512, comparator 513, error rate setting apparatus 514, as shown in Figure 2.
The parallel data line width of supposing in the present embodiment to be adopted is n, and the light signal speed that is received is f.
Present embodiment is used for optical fiber telecommunications system such as gigabit Ethernet are carried out the validation test of transmission error code influence, and it is connected on the optical fiber into the optical fiber telecommunications system input optical signal.The method of the described a kind of analog optical signal error code of present embodiment comprises following steps:
One, receiving optical signals is converted into digital signal.
Receive the light signal on the optical fiber and be converted into serial digital signal by described photoelectric conversion module 1, the speed of the serial digital signal after be converted this moment is f.
Two, the extraction clock signal identical with data signal rate.
3 pairs of digital signals by photoelectric conversion module 1 output of Clock Extraction module are carried out the extraction of clock signal.
Three, judge the speed of digital signal, when if this speed is low, go to step 4, otherwise, the serial digital signal of two-forty is converted to the parallel digital signal of low rate, and the clock signal identical with this serial digital signal speed that will extract simultaneously is converted to the clock signal identical with parallel digital signal speed.
Serial/parallel modular converter 2 is converted to the parallel digital signal of low rate with the serial digital signal of the two-forty that receives, and its speed becomes the ratio of former serial digital signal speed and parallel data line width, i.e. f/n; The frequency inverted that clock frequency division module 4 is responsible for the clock signal that will be extracted by Clock Extraction module 3 is the ratio of original clock signal frequency and parallel data line width, i.e. f/n.
Four, under the control of clock signal, by the error rate that sets digital signal is disturbed with generation to comprise the digital signal of testing required error code.Specifically be divided into following three steps:
1, produces pseudo-random number sequence and the required error rate set point of setting test;
Under the control of clock signal, each single channel error code generation module 51 in the multichannel error code generation module 5 is each parallel digital signal position of Synchronous Processing respectively, generating a speed by the pseudorandom number generator in each single channel error code generation module 51 511 is f/n, the pseudo-random number sequence A of scope between 1 to 2^x-1, wherein x is the figure place of pseudo-random number sequence, and error rate setting apparatus 512 is set a ber value B.
2, the two is compared;
Obtain pseudo-random number sequence A and ber value B by comparator 513, and the two is compared, if A≤B, test result C=1 then, otherwise C=0.
3, digital signal value and comparative result are carried out XOR and comprise the digital signal of testing required error code with generation.
Digital signal value and enter XOR gate 514 by the comparative result that comparator 513 produces and carry out XOR, when C=0, the output of XOR gate 514 equals input, when C=1, the output of XOR gate 514 with import opposite.
The error rate R=B/ (2^x-1) * 100% of the digital signal of XOR gate 514 outputs, the size that changes B just can change error rate R, and the error rate meets normal distribution, when B=0, R=0; When B=2^x-1, R=100%.
If judge in five step 3 when speed of digital signal is low, go to step 6, otherwise, with the digital signal of testing required error code is converted to two-forty by the parallel digital signal of low rate the serial digital signal that comprises that is produced.
Parallel/serial modular converter 6 will be by the digital signal of testing required error code is converted to two-forty by the parallel digital signal of low rate the serial digital signal that comprises of multichannel error code generation module 5 generations, its speed becomes the product of former parallel digital signal speed and parallel data line width, promptly is reduced to f.
Six, the digital signal of testing required error code that comprises that is produced is converted to light signal, and output.
Electrooptic conversion module 7 will be converted to light signal by the digital signal of testing required error code that comprises that multichannel error code generation module 5 produces, and export optical fiber telecommunications system to, use for its performance of test.
Present embodiment is connected to the input of communication system in actual applications, disturbs the generation error code with the light signal to input, with the performance of validation test communication system under the different optical transmission error rates and the optical transmission error rate of the maximum that can tolerate of system.If when the optical signal frequency that receives is low, can omit wherein serial/parallel modular converter, clock frequency division module and parallel/serial modular converter.