Interpretation method and device thereof
Technical field
The present invention relates to a kind of telecommand interpretation method and device thereof, refer to a kind of infra-red remote control instruction decode method and the device thereof that can adjust the sample period automatically especially.
Background technology
Known remote control equipment institute operation technique is mainly infrared ray (IR) or less radio-frequency (RadioFrequency) technology.Wherein, volume is little, power consumption is lower and low cost and other advantages owing to possessing for infra-red remote control equipment, makes it become a kind of telecontrol engineering that more widely uses at present, numbers the 4th as United States Patent (USP), 426, No. 662 patents are a kind of suitable example of infra-red remote control opertaing device.
Infra-red remote control equipment generally has and sends and receive two ends, transmit in the instruction that sends and receive between two ends, one cover coding and coding standards must be arranged, could effectively transmit with identification and instruct, as above lift United States Patent (USP) the 4th, promptly disclose a kind of infra-red remote control decoding technique that is positioned at receiving end in 426, No. 662.The coded format of infrared remote controller instruction mainly is divided into two big classes, and the first kind is that an other class then is that widespread usage is at the NEC of the Far East Area sign indicating number 80 yards of the RC-5 of European Region widespread usage sign indicating number and RECS.
Fig. 1 shows a kind of infra-red remote control order number form of known NEC sign indicating number, it is to adopt pulse wave width modulation mode (Pulse Width Modulation), includes an initial pulse wave (leader pulse or initial pulse), 16 user code (8 user code and 8 bit complements thereof) and 16 numeric data code (8 numeric data code and 8 bit complements thereof).And the binary digit of form is represented mode as shown in Figure 2 among Fig. 1, with about 0.56 millisecond of pulse bandwidth (high levels) (ms, millisecond), about 0.56 millisecond of low level, the cycle is about 1.125 milliseconds of representatives binary " 0 "; With high levels about 0.56 millisecond, about 1.68 milliseconds of low level, the cycle is about 2.25 milliseconds of representatives binary " 1 ".In addition, about 9 milliseconds of the high levels of initial pulse wave, about 4.5 milliseconds of low level, the cycle is about 13.5 milliseconds of expressions.
After the infrared remote controller transmitting terminal sent the remote control steering order, receiving end must be at this telecommand decoding (to 16 numeric data codes, user code), with the meaning of identification instruction representative.Below be example just with above-mentioned NEC sign indicating number, a kind of interpretation method wherein is described, in a common interpretation method, be in the computations sequence code certain the waveform falling edge to adjacent waveform rising edge (be low level during) the number in signal cycle of process, with its pairing binary command of identification.As above-mentioned NEC sign indicating number coded format, suppose the frequency of utilization cycle be 1 microsecond (μ s, microsecond), " 0 " is 0.56 millisecond of high levels, 0.56 millisecond of low level; " 1 " is 0.56 millisecond of high levels, 1.68 milliseconds of low level, therefore, when the waveform falling edge to adjacent waveform rising edge the frequency number of process when being about 560 (0.56ms/1 μ s), then corresponding position is decoded as " 0 "; When the waveform falling edge to adjacent waveform rising edge the frequency number of process when being about 1680 (1.68ms/1 μ s), then corresponding position is decoded as " 1 ", so can calculate the binary condition of identification command bits by the frequency number purpose.
In the above-mentioned interpretation method, need preestablish two frequency number interval before the judgment data place value, an interval, frequency number 550~570 and 1670~1,690 two for example, when the waveform falling edge to adjacent waveform rising edge the frequency number of process drop on 550~570 interval in the time, promptly represent place value " 0 ", otherwise, when the waveform falling edge to adjacent waveform rising edge the frequency number of process drop on 1670~1690 interval in the time, represent place value " 1 ", yet, the infra-red remote control instruction causes the change of pulse wave waveform sometimes after process transmits, for example: pulse bandwidth is elongated or shorten, in this case, known techniques uses the interpretation method of fixed frequency number interval can't decipher out correct instruction place value.
Summary of the invention
Technical matters to be solved by this invention provides a kind of interpretation method and device thereof, can solve the problem of sequence code with deformed decoding.
In order to solve above technical matters, the invention provides following technical scheme:
The invention provides a kind of interpretation method, be used to decipher a sequence code, this sequence code comprises at least one initial pulse wave and complex data pulse wave, and this interpretation method comprises the following step: receive a sequence code; Detect this initial pulse wave of this sequence code; After detecting this initial pulse wave, determine a sample period according to the pulse bandwidth of the data pulse wave in those data pulse waves; And those data pulse waves are deciphered according to this sample period.
In the step of above-mentioned this initial pulse wave of detecting, when the pulse bandwidth of a pulse wave surpasses this default value, judge that this pulse wave is this initial pulse wave.And in the step of those data pulse waves being deciphered according to this sample period,, produce one first place value when the interval of the data pulse wave adjacent with next of the data pulse wave in those complex data pulse waves is not more than one predetermined should the sample period time; When the interval of the data pulse wave adjacent of the data pulse wave in those plural data pulse waves with next greater than this predetermined should the sample period time, produce one second place value.
The present invention more provides a kind of code translator, is used to decipher a sequence code, and this sequence code comprises at least one initial pulse wave and complex data pulse wave, and this code translator includes: a detecting unit is used for detecting this initial pulse wave, to produce a notice signal; One decision unit is used for determining a sample period according to the pulse bandwidth of the data pulse wave in this notice signal and those data pulse waves; And a decoding unit, be used for those data pulse waves being deciphered according to this sample period.
In the above-mentioned code translator, when the pulse bandwidth of a pulse wave during greater than this default value, this detecting unit judges that this pulse wave is this initial pulse wave.Preferably, above-mentioned code translator more comprises a mnemon, in order to store the decoding data of this decoding unit output.
The pulse bandwidth of the sequence code that interpretation method that the present invention adopts and device utilization thereof are received produces the sample period, and sequence code is deciphered according to this sample period, therefore can solve the problem of sequence code with deformed decoding.Even if the pulse wave waveform of infra-red remote control instruction has the distortion of generation in transport process, still decodable code goes out correct command value.
Description of drawings
Fig. 1 shows known a kind of infra-red remote control order number form synoptic diagram.
The binary digit of Fig. 2 displayed map one coded format is represented synoptic diagram.
Fig. 3 shows the process flow diagram of an embodiment of interpretation method of the present invention.
Fig. 4 (a), 4 (b) show the binary decoding method synoptic diagram according to one embodiment of the invention respectively.
Fig. 5 shows an embodiment calcspar of code translator of the present invention.
Fig. 6 shows a preferred embodiment calcspar of code translator of the present invention.
[primary clustering symbol description]
500 code translators, 510 detecting units
520 decision unit, 530 decoding units
600 code translators, 610 detecting units
620 decision unit, 621 counters
622 latch units, 630 decoding units
640 mnemons
Embodiment
For further understanding the above-mentioned purpose of the present invention, function, characteristics and advantage, hereinafter will cooperate the appended graphic preferred embodiment of the present invention that further specifies.
Fig. 3 is the process flow diagram of interpretation method that shows the infra-red remote control instruction of one embodiment of the invention, and interpretation method of the present invention for convenience of description all is to be that example illustrates with the NEC sign indicating number hereinafter among the embodiment, but is not to be in order to restriction the present invention.
After infra-red remote control instruction sequence sign indicating number input (reception), step 301 is the initial pulse wave of detecting sequence code earlier, generally speaking, the pulse bandwidth of the initial pulse wave of infrared ray instruction sequence sign indicating number is the several times of the pulse bandwidth of data pulse wave, therefore, when the pulse bandwidth of a pulse wave is a lot of above the data pulse bandwidth in detecting sequence code, can judge that this pulse wave is initial pulse wave, with the NEC sign indicating number is example, about 9 milliseconds of the pulse bandwidth of the initial pulse wave of NEC sign indicating number, and about 0.56 millisecond of the pulse bandwidth of data pulse wave, therefore, if the pulse bandwidth (during the high levels) that detects surpasses a default value (for example 2 milliseconds), judge that then this pulse wave is initial pulse wave.
In step 302, it is the sample period of calculating in order to the decoding sequence code.After confirming initial pulse wave, calculate the pulse bandwidth of the data pulse wave that initial pulse wave occurs later, and with this pulse bandwidth as sample period in order to decoding sequence code data bit.In the coded format of NEC sign indicating number, the pulse bandwidth of its data pulse wave (during the high levels) is fixed, generally be to represent binary " 0 " or " 1 " place value respectively during changing low level, therefore, sample period is the pulse bandwidth (during the high levels) of each sequence code position, promptly 0.56 millisecond, if the waveform of sequence code produces distortion because of transport process, then step 302 can calculate the pulse bandwidth after the distortion, and with the sample period of this pulse bandwidth as decoding.In one embodiment, the sample period is that to calculate the pulse bandwidth of first data pulse wave that initial pulse wave occurs later resulting.
In step 303, the data bit in the sequence code (being the data pulse waves) to be deciphered with the resulting sample period of step 302, meaning is promptly judged user code or numeric data code position representative binary " 0 " or " 1 " place value in the sequence code.In the present embodiment, step 303 is to detect the interval between per two pulse waves in the sequence code (for example in the sequence code falling edge of a data pulse wave to the waveform rising edge of adjacent pulse wave) the sample period number that passes through according to the sample period, with its pairing place value of identification, please refer to the synoptic diagram shown in Fig. 4 (a), it is that the data bit with the NEC sign indicating number is that example describes, when detecting interval between two pulse waves less than 2 sample periods, this position representative binary " 0 ", shown in Fig. 4 (b), as the result who is detected during more than or equal to 2 sample periods, binary " 1 " is promptly represented in this position.In another embodiment, the rising edge that also can detect a data pulse wave according to the sample period to the rising edge of adjacent pulse wave or falling edge the sample period number of process judge the place value of this data bit representative.In the interpretation method of the present invention, the sample period of decoding institute foundation is produced by the actual pulse bandwidth of receiving, even if infrared ray instruction sequence sign indicating number has the situation that the waveform distortion takes place at transport process, under the normal condition, the pulse wave distortion is an equal proportion, therefore, be used as the foundation of decoding with the sample period that pulse bandwidth was produced after the distortion, still can obtain correct decode results.
Fig. 5 shows the embodiment synoptic diagram according to the code translator of infrared ray control instruction of the present invention, and as shown in Figure 5, code translator 500 of the present invention comprises a detecting unit 510, a decision unit 520 and a decoding unit 530.Detecting unit 510 is the initial pulse waves that are used for detecting sequence code, and whether its pulse bandwidth of detecting pulse wave in the sequence code according to a frenquency signal surpasses a default value, if the pulse bandwidth that detects surpasses this default value, judges that then this pulse wave is initial pulse wave.The difference of pulse bandwidth and data pulse bandwidth from tomorrow begins so that the NEC sign indicating number is example, in the NEC sign indicating number, pulse bandwidth during the initial pulse wave high levels is 9 milliseconds, and the data pulse bandwidth is 0.56 millisecond, therefore, when the pulse bandwidth of a pulse wave in the sequence code is a lot of above data pulse bandwidth (0.56 millisecond), can determine that this pulse wave is initial pulse wave, in the present embodiment, default value is made as 2 milliseconds, when detecting unit 510 detects the pulse bandwidth of a pulse wave above 2 milliseconds, detecting unit judges that promptly this pulse wave is initial pulse wave, after detecting unit 510 detects an initial pulse wave, can produce a notice signal INIT_PS, in order to notice decision unit 520 and decoding unit 530.
Decision unit 520 is the sample period S_P that is used for calculating the decoding sequence code, after the notice signal INIT_PS of detecting unit 510 is received in decision unit 520, promptly begin to calculate the pulse bandwidth of the data pulse wave that comes across initial pulse wave back, and this pulse bandwidth is regarded in order to decipher the sample period S_P of sequence code data bit.With the NEC sign indicating number is example, behind decision unit 520 notified signal INIT_PS, promptly begin the pulse bandwidth of a pulse wave in the sequence of calculation sign indicating number, meaning is promptly calculated during the high levels of pulse wave, in standard N EC sign indicating number, pulse bandwidth is 0.56 millisecond, so decision unit 520 can calculate 0.56 millisecond sample period value.Yet, the infra-red remote control instruction may be interfered in transport process, and make the pulse wave of telecommand sequence code produce distortion, at this moment, decision unit 520 still can calculate the pulse bandwidth after the distortion, and is used as sample period S_P with this pulse bandwidth, therefore, decision of the present invention unit can accurately calculate the pulse bandwidth of the telecommand sequence code reality of being received, and this pulse bandwidth is used as the sample period in when decoding.
Decoding unit 530 is the binary value that is comprised that is used for deciphering sequence code, after decoding unit 530 is received notice signal INIT_PS from detecting unit, promptly decipher the sequence code of being received with the decision sample period S_P that the unit was calculated, in one embodiment, decoding unit 530 be according to sample period S_P detect the interval between per two pulse waves in the sequence code the sample period number of process, with its pairing binary value of identification, decoding unit 530 can by the falling edge of a data pulse wave in the detecting sequence code between the waveform rising edge of adjacent pulse wave the sample period number of process, or the rising edge of detecting a data pulse wave to the rising edge of adjacent pulse wave or falling edge the sample period number of process come the binary value of each pulse wave representative in the identification sequence code.Please refer to the synoptic diagram shown in Fig. 4 (a), it is that the data bit with the NEC sign indicating number is that example describes, when the falling edge that detects a data pulse wave between the waveform rising edge of adjacent pulse wave the sample period number of process during less than 2 sample period S_P, this pulse wave representative binary " 0 ", on the other hand, shown in Fig. 4 (b), as the result who is detected during more than or equal to 2 sample period S_P, this pulse wave is promptly represented binary " 1 ".In addition, the sample period of 530 foundations of decoding unit is produced by the actual pulse bandwidth of receiving, therefore, no matter sequence code is that the distortion of generation is arranged in transport process, and decoding unit 530 still can correctly be deciphered the sequence code of receiving.
Fig. 6 is the synoptic diagram of a preferred embodiment of code translator of the present invention, in code translator 600, detecting unit 610 is the initial pulse wave of detecting sequence code earlier, when the pulse bandwidth that detects surpasses a default value, judge that then this pulse wave is initial pulse wave, and notify decoding unit 630 and decision unit 620 respectively with notification signal INIT_PS, carry out decoded operation to start 830 pairs of sequence codes of decoding unit, and make decision unit 620 produce a sample period according to sequence code and frequency signal.Decision unit 620 comprises a counter 621 and a latch unit 622, counter 621 is behind the notice signal INIT_PS that receives detecting unit 610, promptly calculate the pulse bandwidth of first data pulse wave behind the initial pulse wave according to frenquency signal, meaning be during the high levels of calculating chart pulse wave the frequency number of process, and the frequency number that will calculate at last offers latch unit 622, latch unit 622 can breech locks receives that frequency number is with as sample period S_P, and sample period S_P outputed to decoding unit 630,630 of decoding units are deciphered the data pulse wave of sequence code according to sample period S_P, simultaneously, decoding unit 630 can be temporary to mnemon 640 with the resulting place value of decoding sequence code, after waiting to finish the decoding of a sequence code, again by the complete command value of output in the mnemon 640.
In sum, the pulse bandwidth of the sequence code that utilization of the present invention is received produces the sample period, and sequence code is deciphered according to this sample period, therefore can solve the problem of sequence code with deformed decoding.
Though the present invention has utilized above-mentioned preferred embodiment to disclose in detail; right its is not in order to limiting the present invention, allly has the knack of this technology personage, without departing from the spirit and scope of the present invention; can carry out various changes and modification, so protection scope of the present invention is when being as the criterion with claim.