Summary of the invention
The technical problem that the present invention solves is, a kind of visible light communication method based on spread spectrum is provided, the method can significantly improve efficiency, the reduction transmission error rates of transmission of visible light, improve the reliability of visible light communication, the present invention also provides a kind of visible light communication system based on spread spectrum, this system configuration is simple, is easy to realize, and greatly improves the fail safe of visible light communication system.
The technical solution adopted for the present invention to solve the technical problems is, provides a kind of visible light communication method based on spread spectrum, comprises the following steps:
Base band data is sent to frequency multiplier by S 1., and the spectrum width of base band data is expanded by frequency multiplier, obtains the base band data after spread spectrum, and the PN code sequence that the base band data after spread spectrum and transmitting terminal PN code generator produce is sent to convolution coder jointly;
S2. the base band data after the spread spectrum in convolution coder and PN code sequence are carried out logical operation, obtain the data after computing, the data after computing are sent to modulator and carry out signal madulation, obtain the signal after modulating;
S3. the signal after modulation is sent to visible light generator, the signal after modulation is sent to the visible light receiver of receiving terminal by visible light generator with visible light signal form;
S4. the visible light signal received is converted into binary digital signal by visible light receiver, and binary digital signal is sent to demodulator;
S5. demodulator is by after binary digital signal demodulation, and the PN code sequence produced with receiving terminal PN code generator is sent to convolution decoder jointly;
S6. the binary digital signal after demodulation and PN code sequence carry out logical operation in convolution decoder, obtain the signal after computing, the signal after computing is sent to despreader;
S7. despreader is by the data despreading after computing in step S6, and carries out Soft decision decoding to the data after computing, and obtain the data identical with transmitting terminal base band data, namely receiving terminal is correctly decoded.
Preferably, in step S2 and step S6, logical operation is identical logical operation.
Preferably, logical operation is XOR.
Preferably, logical operation is NOR-operation.
Preferably, logical operation is same or computing.
Preferably, in step S3, visible light generator is LED.
Preferably, in step S4, visible light receiver is photodiode.
Preferably, the PN code sequence of transmitting terminal PN code generator generation is identical with the PN code sequence that receiving terminal PN code generator produces.
The present invention also provides a kind of visible light communication system based on spread spectrum, comprises with lower part,
Transmitting terminal: base band data is sent to frequency multiplier, the spectrum width of base band data is expanded by frequency multiplier, obtains the base band data after spread spectrum, and the PN code sequence that the base band data after spread spectrum and transmitting terminal PN code generator produce is sent to convolution coder jointly;
Base band data after spread spectrum in convolution coder and PN code sequence are carried out logical operation, obtain the data after computing, data after computing are sent to modulator and carry out signal madulation, obtain the signal after modulating, signal after modulation is sent to visible light generator, and the signal after modulation is sent to the visible light receiver of receiving terminal by visible light generator with visible light signal form;
Receiving terminal: the visible light signal received is converted into binary digital signal by visible light receiver, binary digital signal is sent to demodulator, demodulator is by after binary digital signal demodulation, and the PN code sequence produced with receiving terminal PN code generator is sent to convolution decoder jointly;
Binary digital signal after demodulation and PN code sequence carry out logical operation in convolution decoder, obtain the signal after computing, signal after computing is sent to despreader, despreader is by the data despreading after computing, and Soft decision decoding is carried out to the data after computing, obtain the data identical with transmitting terminal base band data, namely receiving terminal is correctly decoded.
Preferably, base band data is sequence of binary digits.
Beneficial effect of the present invention is, a kind of visible light communication method based on spread spectrum is provided, the method is simple, strong operability, significantly improve the efficiency of transmission of visible light, reduce transmission error rates, and then improve the reliability of visible light communication, the present invention also provides a kind of visible light communication system based on spread spectrum, and this system configuration is simple, be easy to realize, substantially increase the fail safe of visible light communication system.
Embodiment
Below in conjunction with drawings and the specific embodiments, the present invention will be further described.
See Fig. 1, the present invention is based on the visible light communication method flow schematic diagram of spread spectrum, the invention provides a kind of visible light communication method based on spread spectrum, comprise the following steps:
S1. base band data is sent to frequency multiplier 101, the spectrum width of base band data is expanded by frequency multiplier 101, obtain the base band data after spread spectrum, the PN code sequence that the base band data after spread spectrum and transmitting terminal PN code generator 102 produce is sent to convolution coder 103 jointly;
S2. the base band data after the spread spectrum in convolution coder 103 and PN code sequence are carried out logical operation, obtain the data after computing, the data after computing are sent to modulator 104 and carry out signal madulation, obtain the signal after modulating;
S3. the signal after modulation is sent to visible light generator 105, the signal after modulation is sent to the visible light receiver 201 of receiving terminal by visible light generator 105 with visible light signal form;
S4. the visible light signal received is converted into binary digital signal by visible light receiver 201, binary digital signal is sent to demodulator 202;
S5. demodulator 202 is by after binary digital signal demodulation, and the PN code sequence produced with receiving terminal PN code generator 204 is sent to convolution decoder 203 jointly;
S6. the binary digital signal after demodulation and PN code sequence carry out logical operation in convolution decoder 203, obtain the signal after computing, the signal after computing is sent to despreader 205;
S7. despreader 205 is by the data despreading after computing in step S6, and carries out Soft decision decoding to the data after computing, and obtain the data identical with transmitting terminal base band data, namely receiving terminal is correctly decoded.
Should be appreciated that in step S2 and step S6, logical operation is the logical operation that algorithm is identical, this logical operation be XOR, NOR-operation, with or computing etc.
In step S3, visible light generator is LED, is launched the visible ray comprising unlocking cipher by LED.
In step S4, visible light receiver is photodiode, and visible ray information is converted to binary code by photodiode.
Should be appreciated that the PN code sequence that transmitting terminal PN code generator produces is identical with the PN code sequence that receiving terminal PN code generator produces.
The present invention also provides a kind of visible light communication system based on spread spectrum, comprises with lower part,
See Fig. 2, the present invention is based on the visible light communication system transmitting terminal schematic diagram of spread spectrum,
Transmitting terminal: base band data is sent to frequency multiplier 101, the spectrum width of base band data is expanded by frequency multiplier 101, obtain the base band data after spread spectrum, the PN code sequence that the base band data after spread spectrum and transmitting terminal PN code generator 102 produce is sent to convolution coder 103 jointly;
Base band data after spread spectrum in convolution coder 103 and PN code are carried out logical operation, obtain the data after computing, data after computing are sent to modulator 104 and carry out signal madulation, obtain the signal after modulating, signal after modulation is sent to visible light generator 105, and the signal after modulation is sent to the visible light receiver 201 of receiving terminal by visible light generator 105 with visible light signal form;
See Fig. 3, the present invention is based on the visible light communication system receiving terminal schematic diagram of spread spectrum,
Receiving terminal: the visible light signal received is converted into binary digital signal by visible light receiver 201, binary digital signal is sent to demodulator 202, demodulator 202 is by after binary digital signal demodulation, and the PN code sequence produced with receiving terminal PN code generator is sent to convolution decoder 203 jointly;
Binary digital signal after demodulation and PN code sequence carry out logical operation in convolution decoder, obtain the signal after computing, signal after computing is sent to despreader 205, despreader 205 is by the data despreading after computing, and Soft decision decoding is carried out to the data after computing, obtain the data identical with transmitting terminal base band data, namely receiving terminal is correctly decoded.
Meanwhile, base band data is sequence of binary digits, and can be the Serial No.s such as PN code, Turbo code, Walsh code, Barker code, also can be user-defined sequence of binary digits.
See Fig. 4, spectrum spreading method schematic diagram of the present invention, example is spread to 4 times, if spread spectrum front signal is 10100011, split by each bit, obtain 1,0,1,0,0,0,1,1, be 4 identical bits by above each bit expanded, obtain 11110000111100000000000011111111.Therefore, after carrying out 4 times of spread spectrums by above-mentioned rule by 10100011, the signal obtained is 11110000111100000000000011111111, and base band data of the present invention all uses said method spread spectrum, does not repeat them here.
Embodiment 1
If the PN code that base band data is 1010, transmitting terminal PN code generator 102 produces and the PN code that receiving terminal PN code generator 204 produces are 1100110110011001, spread spectrum multiple is 4 times, then there are following steps:
S1. base band data 1010 is sent to frequency multiplier 101, base band data is expanded by 4 times of spectrum widths by frequency multiplier 101, namely the base band data after expansion is 1111000011110000, and the PN code sequence that the base band data after spread spectrum and transmitting terminal PN code generator 102 produce is sent to convolution coder 103 jointly;
S2. the base band data after the spread spectrum in convolution coder 103 and PN code sequence are carried out XOR:
Base band data after spread spectrum |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
PN code sequence |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
XOR result |
0 |
0 |
1 |
1 |
1 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
0 |
1 |
Obtain the data after computing 0011110101101001, the data after computing are sent to modulator 104 and carry out signal madulation, obtain the signal after modulating;
S3. the signal after modulation is sent to visible light generator 105, the signal after modulation is sent to the visible light receiver 201 of receiving terminal by visible light generator 105 with visible light signal form;
S4. the visible light signal received is converted into binary digital signal by visible light receiver 201, binary digital signal is sent to demodulator 202;
S5. demodulator 202 exports 0011110101101001 by after binary digital signal demodulation, and the PN code sequence 1100110110011001 produced with receiving terminal PN code generator 204 is sent to convolution decoder 203 jointly;
S6. the binary digital signal after demodulation and PN code sequence 1100110110011001 carry out XOR in convolution decoder 203:
Signal after demodulation |
0 |
0 |
1 |
1 |
1 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
0 |
1 |
PN code sequence |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
XOR result |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
Obtain the signal after computing 1111000011110000, identical with signal after spread spectrum in step S1, the signal after this computing is sent to despreader 205;
S7. despreader 205 is by the data despreading after computing in step S6, despreading multiple is 4 times, obtain 1111000011110000, it is one group by every 4 bits, be divided into 1111000011110000, and Soft decision decoding is carried out to these data, obtain the data 1010 identical with transmitting terminal base band data, namely receiving terminal is correctly decoded.
In visible light communication transmitting procedure, when the communication distance of transmitting terminal and receiving terminal increases to certain limit, the error rate can raise greatly, signal error rate in transmitting procedure is increased greatly, if base band data directly modulation is sent to receiving terminal, then be easy to the signal receiving mistake after receiving terminal modulation, reduce the fail safe of visible light communication.
The present invention is based on the method for the visible light communication of spread spectrum, in step S4, if signal makes a mistake in transmitting procedure, in step S5, demodulator 202 exports 1011110101101000 by after binary digital signal demodulation, the PN code sequence 1100110110011001 produced with receiving terminal PN code generator 204 is sent to convolution decoder 203 jointly, and in step S6, the binary digital signal after demodulation and PN code sequence 1100110110011001 carry out XOR in convolution decoder 203:
Bit error signal |
1 |
0 |
1 |
1 |
1 |
1 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
0 |
0 |
PN code sequence |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
XOR result |
0 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
1 |
Obtain the signal after computing 0111000011110001, these data are sent to despreader, be one group, be divided into 0111000011110001, carry out Soft decision decoding, obtain 1010 to these data by every 4 bits, receiving terminal will reduce by base band data, is correctly decoded.
Therefore, utilize the method that the present invention is based on the visible light communication of spread spectrum to communicate, even if transmitting procedure generation error code, receiving terminal still can correct decoding, and spread spectrum multiple is higher, and transmission gain is larger, the reliability transmitted, fail safe are higher.
Embodiment 2
If the PN code that base band data is 1010, transmitting terminal PN code generator 102 produces and the PN code that receiving terminal PN code generator 204 produces are 1100110110011001, spread spectrum multiple is 4 times, then there are following steps:
S1. base band data 1010 is sent to frequency multiplier 101, base band data is expanded by 4 times of spectrum widths by frequency multiplier 101, namely the base band data after expansion is 1111000011110000, and the PN code sequence that the base band data after spread spectrum and transmitting terminal PN code generator 102 produce is sent to convolution coder 103 jointly;
S2. the base band data after the spread spectrum in convolution coder 103 and PN code sequence are carried out NOR-operation:
Base band data after spread spectrum |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
PN code |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
NOR-operation result |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
0 |
Obtain the data after computing 0000001000000110, the data after computing are sent to modulator 104 and carry out signal madulation, obtain the signal after modulating;
S3. the signal after modulation is sent to visible light generator 105, the signal after modulation is sent to the visible light receiver 201 of receiving terminal by visible light generator 105 with visible light signal form;
S4. the visible light signal received is converted into binary digital signal by visible light receiver 201, binary digital signal is sent to demodulator 202;
S5. demodulator 202 exports 0000001000000110 by after binary digital signal demodulation, and the PN code sequence 1100110110011001 produced with receiving terminal PN code generator 204 is sent to convolution decoder 203 jointly;
S6. the binary digital signal after demodulation and PN code sequence 1100110110011001 carry out NOR-operation in convolution decoder 203:
Signal after demodulation |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
0 |
PN code sequence |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
NOR-operation result |
0 |
0 |
1 |
1 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
0 |
0 |
0 |
0 |
0 |
Obtain the signal after computing 0011000001100000, the signal after this computing is sent to despreader 205;
S7. despreader 205 is by the data despreading after computing in step S6, despreading multiple is 4 times, obtain 0011000001100000, it is one group by every 4 bits, be divided into 0011000001100000, and Soft decision decoding is carried out to these data, obtain the data 1010 identical with transmitting terminal base band data, namely receiving terminal is correctly decoded.
Embodiment 3
If the PN code that base band data is 1010, transmitting terminal PN code generator 102 produces and the PN code that receiving terminal PN code generator 204 produces are 1100110110011001, spread spectrum multiple is 4 times, then there are following steps:
S1. base band data 1010 is sent to frequency multiplier 101, base band data is expanded by 4 times of spectrum widths by frequency multiplier 101, namely the base band data after expansion is 1111000011110000, and the PN code sequence that the base band data after spread spectrum and transmitting terminal PN code generator 102 produce is sent to convolution coder 103 jointly;
S2. the base band data after the spread spectrum in convolution coder 103 and PN code sequence are carried out same or computing:
Base band data after spread spectrum |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
PN code |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
With or operation result |
1 |
1 |
0 |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
1 |
0 |
Obtain the data after computing 1100001010010110, the data after computing are sent to modulator 104 and carry out signal madulation, obtain the signal after modulating;
S3. the signal after modulation is sent to visible light generator 105, the signal after modulation is sent to the visible light receiver 201 of receiving terminal by visible light generator 105 with visible light signal form;
S4. the visible light signal received is converted into binary digital signal by visible light receiver 201, binary digital signal is sent to demodulator 202;
S5. demodulator 202 exports 1100001010010110 by after binary digital signal demodulation, and the PN code sequence 1100110110011001 produced with receiving terminal PN code generator 204 is sent to convolution decoder 203 jointly;
S6. the binary digital signal after demodulation and PN code sequence 1100110110011001 carry out same or computing in convolution decoder 203:
Signal after demodulation |
1 |
1 |
0 |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
1 |
0 |
PN code |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
With or operation result |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
Obtain the signal after computing 1111000011110000, the signal after this computing is sent to despreader 205;
S7. despreader 205 is by the data despreading after computing in step S6, despreading multiple is 4 times, obtain 1111000011110000, it is one group by every 4 bits, be divided into 1,111 0,000 1,111 0000, and Soft decision decoding is carried out to these data, obtain the data 1010 identical with transmitting terminal base band data, namely receiving terminal is correctly decoded.
Embodiment 4
If the PN code that base band data is 1010, transmitting terminal PN code generator 102 produces and the PN code that receiving terminal PN code generator 204 produces are 110011011001100111001100, spread spectrum multiple is 6 times, then there are following steps:
S1. base band data 1010 is sent to frequency multiplier 101, base band data is expanded by 6 times of spectrum widths by frequency multiplier 101, namely the base band data after expansion is 111111000000111111000000, and the PN code sequence that the base band data after spread spectrum and transmitting terminal PN code generator 102 produce is sent to convolution coder 103 jointly;
S2. the base band data after the spread spectrum in convolution coder 103 and PN code sequence are carried out XOR:
Base band data after spread spectrum |
1 |
1 |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
PN code |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
XOR result |
0 |
0 |
1 |
1 |
0 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
0 |
1 |
1 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
0 |
0 |
Obtain the data after computing 001100011001011000001100, the data after computing are sent to modulator 104 and carry out signal madulation, obtain the signal after modulating;
S3. the signal after modulation is sent to visible light generator 105, the signal after modulation is sent to the visible light receiver 201 of receiving terminal by visible light generator 105 with visible light signal form;
S4. the visible light signal received is converted into binary digital signal by visible light receiver 201, binary digital signal is sent to demodulator 202;
S5. demodulator 202 exports 001100011001011000001100 by after binary digital signal demodulation, and the PN code sequence 110011011001100111001100 produced with receiving terminal PN code generator 204 is sent to convolution decoder 203 jointly;
S6. the binary digital signal after demodulation and PN code sequence 110011011001100111001100 carry out XOR in convolution decoder 203:
Signal after demodulation |
0 |
0 |
1 |
1 |
0 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
0 |
1 |
1 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
0 |
0 |
PN code |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
XOR result |
1 |
1 |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
1 |
1 |
0 |
0 |
0 |
0 |
0 |
0 |
Obtain the signal after computing 111111000000111111000000, the signal after this computing is sent to despreader 205;
S7. despreader 205 is by the data despreading after computing in step S6, despreading multiple is 4 times, obtain 111111000000111111000000, it is one group by every 6 bits, be divided into 111,111 000,000 111111000000, and Soft decision decoding is carried out to these data, obtain the data 1010 identical with transmitting terminal base band data, namely receiving terminal is correctly decoded.
In sum, the invention provides a kind of visible light communication method based on spread spectrum, the method is simple, workable, the error rate in the efficiency of transmission of visible light, reduction transmitting procedure can be significantly improved, improve the reliability of visible light communication, the present invention also provides a kind of visible light communication system based on spread spectrum, and this system configuration is simple, be easy to realize, substantially increase the fail safe of visible light communication system.
By reference to the accompanying drawings embodiments of the invention are described above; but the present invention is not limited to above-mentioned embodiment; above-mentioned embodiment is only schematic; instead of it is restrictive; those of ordinary skill in the art is under enlightenment of the present invention; do not departing under the ambit that present inventive concept and claim protect, also can make a lot of form, these all belong within protection of the present invention.