CN101751768B - Decoding method and device thereof - Google Patents
Decoding method and device thereof Download PDFInfo
- Publication number
- CN101751768B CN101751768B CN200810182610.2A CN200810182610A CN101751768B CN 101751768 B CN101751768 B CN 101751768B CN 200810182610 A CN200810182610 A CN 200810182610A CN 101751768 B CN101751768 B CN 101751768B
- Authority
- CN
- China
- Prior art keywords
- pulse wave
- data pulse
- decoding
- data
- code
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 230000000630 rising effect Effects 0.000 claims description 12
- 238000005070 sampling Methods 0.000 abstract description 48
- 238000001514 detection method Methods 0.000 abstract description 14
- 238000010586 diagram Methods 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 6
- 230000000295 complement effect Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
Landscapes
- Selective Calling Equipment (AREA)
Abstract
本发明公开了一种译码方法及其装置,可解决译码变形的序列码的问题。本发明之的译码装置用于译码一序列码,该序列码包含至少一起始脉波及复数数据脉波,该译码装置包含有:一侦测单元,用来侦测该起始脉波,以产生一通知讯号;一决定单元,用来根据该通知讯号及该些数据脉波中之的一数据脉波之的脉波宽度决定一取样周期;以及一译码单元,用来根据该取样周期对该些数据脉波进行译码。
The invention discloses a decoding method and a device thereof, which can solve the problem of decoding deformed sequence codes. The decoding device of the present invention is used to decode a sequence code, the sequence code includes at least one initial pulse wave and a plurality of data pulse waves, and the decoding device includes: a detection unit for detecting the initial pulse wave , to generate a notification signal; a determination unit, used to determine a sampling period according to the notification signal and the pulse width of a data pulse among the data pulses; and a decoding unit, used to determine a sampling period according to the data pulse The sampling period decodes the data pulses.
Description
技术领域technical field
本发明涉及一种遥控指令译码方法及其装置,尤指一种可自动调整取样周期的红外线遥控指令译码方法及其装置。The invention relates to a remote control command decoding method and its device, in particular to an infrared remote control command decoding method and its device which can automatically adjust the sampling period.
背景技术Background technique
习知遥控设备所使用技术主要为红外线(IR)或无线射频(RadioFrequency)技术。其中,红外线遥控设备由于具备体积小、功率消耗较低以及成本低等优点,使其成为目前较广为使用的一种遥控技术,如美国专利编号第4,426,662号专利即为一种红外线遥控控制设备的适例。The technology used by conventional remote control devices is mainly infrared (IR) or radio frequency (Radio Frequency) technology. Among them, the infrared remote control device has become a widely used remote control technology due to its advantages of small size, low power consumption and low cost. For example, US Patent No. 4,426,662 is an infrared remote control device. example.
红外线遥控设备一般会有发送及接收二端,在发送及接收二端间的指令传送,须有一套编码及译码标准,才能有效传送与辨识指令,如上举美国专利第4,426,662号中即揭示位于接收端的一种红外线遥控译码技术。红外线遥控器指令的编码格式主要分为两大类,第一类是在欧洲地区普遍应用的RC-5码和RECS80码,另外一类则是普遍应用在远东地区的NEC码。Infrared remote control devices generally have two terminals, sending and receiving. The transmission of instructions between the two terminals requires a set of encoding and decoding standards in order to effectively transmit and identify instructions. As disclosed in US Patent No. 4,426,662 An infrared remote control decoding technology at the receiving end. The encoding formats of infrared remote control commands are mainly divided into two categories. The first category is the RC-5 code and RECS80 code commonly used in Europe, and the other is the NEC code commonly used in the Far East.
图1显示习知NEC码的一种红外线遥控指令编码格式,其系采脉波宽度调变方式(Pulse Width Modulation),包括有一起始脉波(leader pulse或initial pulse)、16位的用户码(8位的用户码及其8位补码)、以及16位的数据码(8位的数据码及其8位补码)。而图1中格式的二进制位表示方式如图2所示,以脉波宽度(高位准)约0.56毫秒(ms,millisecond),低位准约0.56毫秒,周期约为1.125毫秒代表二进制的“0”;以高位准约0.56毫秒,低位准约1.68毫秒,周期约为2.25毫秒代表二进制的“1”。此外,起始脉波的高位准约9毫秒,低位准约4.5毫秒,周期约为13.5毫秒表示。Figure 1 shows an infrared remote control command encoding format of the known NEC code, which adopts the Pulse Width Modulation method (Pulse Width Modulation), including a leader pulse (or initial pulse) and a 16-digit user code (8-bit user code and its 8-bit complement), and 16-bit data code (8-bit data code and its 8-bit complement). The binary representation of the format in Figure 1 is shown in Figure 2. The pulse width (high level) is about 0.56 milliseconds (ms, millisecond), the low level is about 0.56 milliseconds, and the period is about 1.125 milliseconds to represent binary "0". ; The high level is about 0.56 milliseconds, the low level is about 1.68 milliseconds, and the period is about 2.25 milliseconds to represent binary "1". In addition, the high level of the initial pulse wave is about 9 milliseconds, the low level is about 4.5 milliseconds, and the period is about 13.5 milliseconds.
在红外线遥控器发送端发出遥控控制指令后,接收端必须针对该遥控指令译码(对16位的数据码、用户码),以辨识指令代表的意义。以下就以上述NEC码为例,说明其中的一种译码方法,在一常见的译码方法中,系计算指令序列码中某位的波形下降缘至相邻的波形上升缘(即低位准期间)所经过的讯号周期的数目,以辨识其所对应的二进制指令。如上述的NEC码编码格式,假设使用频率周期为1微秒(μs,microsecond),“0”为高位准0.56毫秒,低位准0.56毫秒;“1”为高位准0.56毫秒,低位准1.68毫秒,因此,当波形下降缘至相邻的波形上升缘所经过的频率数约为560(0.56ms/1μs)时,则对应的位译码为“0”;当波形下降缘至相邻的波形上升缘所经过的频率数约为1680(1.68ms/1μs)时,则对应的位译码为“1”,如此即可藉由频率数目的计算来辨识指令位的二进制状态。After the sending end of the infrared remote control sends out the remote control command, the receiving end must decode the remote control command (for 16-bit data code and user code) to identify the meaning of the command. Taking the above-mentioned NEC code as an example, one of the decoding methods is described below. In a common decoding method, it is calculated from the falling edge of the waveform of a certain bit in the instruction sequence code to the rising edge of the adjacent waveform (that is, the low level period) to identify the corresponding binary instruction. As in the above-mentioned NEC code encoding format, assuming that the frequency period used is 1 microsecond (μs, microsecond), "0" is 0.56 milliseconds in the high level and 0.56 milliseconds in the low level; "1" is 0.56 milliseconds in the high level and 1.68 milliseconds in the low level. Therefore, when the frequency from the falling edge of the waveform to the rising edge of the adjacent waveform is about 560 (0.56ms/1μs), the corresponding bit is decoded as "0"; when the falling edge of the waveform to the rising edge of the adjacent waveform When the number of frequencies passed by the edge is about 1680 (1.68ms/1μs), the corresponding bit is decoded as "1", so that the binary state of the command bit can be identified through the calculation of the number of frequencies.
上述的译码方法中,判断数据位值前需预先设定两个的频率数区间,例如频率数550~570及1670~1690两个区间,当波形下降缘至相邻的波形上升缘所经过的频率数落在550~570区间内时,即代表位值“0”,反之,当波形下降缘至相邻的波形上升缘所经过的频率数落在1670~1690区间内时,代表位值“1”,然而,红外线遥控指令在经过传送后有时会导致脉波波形的改变,例如:脉波宽度变长或变短,在这种情况下,习知技术使用固定频率数区间的译码方法将无法译码出正确的指令位值。In the above decoding method, two frequency intervals need to be preset before judging the data bit value. For example, the frequency intervals are 550-570 and 1670-1690. When the frequency number falls within the interval of 550-570, it represents the bit value "0". On the contrary, when the frequency number passed by the falling edge of the waveform to the rising edge of the adjacent waveform falls within the interval of 1670-1690, it represents the bit value "1". "However, the infrared remote control command sometimes causes the change of the pulse waveform after being transmitted, for example: the pulse width becomes longer or shorter. In this case, the conventional technology uses a decoding method with a fixed frequency interval to convert Unable to decode correct instruction bit value.
发明内容Contents of the invention
本发明所要解决的技术问题是提供一种译码方法及其装置,可解决译码变形的序列码的问题。The technical problem to be solved by the present invention is to provide a decoding method and its device, which can solve the problem of decoding deformed sequence codes.
为了解决以上技术问题,本发明提供了如下技术方案:In order to solve the above technical problems, the present invention provides the following technical solutions:
本发明提供一种译码方法,用于译码一序列码,该序列码包含至少一起始脉波及复数数据脉波,该译码方法包含下列步骤:接收一序列码;侦测该序列码的该起始脉波;于侦测到该起始脉波后,根据该些数据脉波中的一数据脉波的脉波宽度决定一取样周期;以及根据该取样周期对该些数据脉波进行译码。The present invention provides a decoding method for decoding a sequence code, the sequence code includes at least one initial pulse wave and complex data pulse waves, the decoding method includes the following steps: receiving a sequence code; detecting the sequence code the initial pulse; after detecting the initial pulse, determine a sampling period according to the pulse width of a data pulse in the data pulses; and perform a sampling cycle on the data pulses according to the sampling period decoding.
在上述侦测该起始脉波的步骤中,当一脉波的脉波宽度超过该默认值时,判定该脉波为该起始脉波。而根据该取样周期对该些数据脉波进行译码的步骤中,当该些复数数据脉波中的一数据脉波与下一相邻的数据脉波的间隔不大于一预定个该取样周期时,产生一第一位值;当该些复数数据脉波中的一数据脉波与下一相邻的数据脉波的间隔大于该预定个该取样周期时,产生一第二位值。In the above step of detecting the initial pulse wave, when the pulse width of a pulse wave exceeds the default value, it is determined that the pulse wave is the initial pulse wave. In the step of decoding the data pulses according to the sampling period, when the interval between a data pulse in the complex data pulses and the next adjacent data pulse is not greater than a predetermined sampling period When a first bit value is generated; when the interval between a data pulse wave and the next adjacent data pulse wave among the plurality of data pulse waves is greater than the predetermined sampling period, a second bit value is generated.
本发明更提供一种译码装置,用于译码一序列码,该序列码包含至少一起始脉波及复数数据脉波,该译码装置包含有:一侦测单元,用来侦测该起始脉波,以产生一通知讯号;一决定单元,用来根据该通知讯号及该些数据脉波中的一数据脉波的脉波宽度决定一取样周期;以及一译码单元,用来根据该取样周期对该些数据脉波进行译码。The present invention further provides a decoding device for decoding a sequence code, the sequence code includes at least one start pulse and a plurality of data pulses, the decoding device includes: a detection unit for detecting the start start pulse, to generate a notification signal; a determination unit, used to determine a sampling period according to the notification signal and the pulse width of a data pulse in the data pulses; and a decoding unit, used to determine a sampling period according to The sampling period decodes the data pulses.
上述的译码装置中,当一脉波的脉波宽度大于该默认值时,该侦测单元判断该脉波为该起始脉波。较佳地,上述的译码装置更包含一记忆单元,用以储存该译码单元输出的译码数据。In the above-mentioned decoding device, when the pulse width of a pulse is greater than the default value, the detection unit determines that the pulse is the initial pulse. Preferably, the above-mentioned decoding device further includes a memory unit for storing the decoded data output by the decoding unit.
本发明采用的译码方法及其装置利用所收到的序列码的脉波宽度产生取样周期,并根据此取样周期对序列码进行译码,因此可解决译码变形的序列码的问题。而且纵使红外线遥控指令的脉波波形在传送过程中有产生变形,仍可译码出正确的指令值。The decoding method and device adopted in the present invention utilize the pulse width of the received serial code to generate a sampling period, and decode the serial code according to the sampling period, thus solving the problem of decoding deformed serial codes. Moreover, even if the pulse waveform of the infrared remote control command is deformed during transmission, the correct command value can still be decoded.
附图说明Description of drawings
图1显示习知的一种红外线遥控指令编码格式示意图。FIG. 1 shows a schematic diagram of a conventional infrared remote control instruction encoding format.
图2显示图一编码格式的二进制位表示示意图。FIG. 2 shows a schematic representation of binary bits in the encoding format of FIG. 1 .
图3显示本发明的译码方法的一实施例的流程图。FIG. 3 shows a flowchart of an embodiment of the decoding method of the present invention.
图4(a)、4(b)分别显示依本发明的一实施例的二进制译码方法示意图。4(a) and 4(b) respectively show schematic diagrams of a binary decoding method according to an embodiment of the present invention.
图5显示本发明的译码装置的一实施例方块图。FIG. 5 shows a block diagram of an embodiment of the decoding device of the present invention.
图6显示本发明的译码装置的一较佳实施例方块图。FIG. 6 shows a block diagram of a preferred embodiment of the decoding device of the present invention.
【主要组件符号说明】[Description of main component symbols]
500 译码装置 510 侦测单元500 decoding device 510 detection unit
520 决定单元 530 译码单元520 decision unit 530 decoding unit
600 译码装置 610 侦测单元600 decoding device 610 detection unit
620 决定单元 621 计数器620 decision unit 621 counter
622 闩锁器 630 译码单元622 latch 630 decoding unit
640 记忆单元640 memory cells
具体实施方式Detailed ways
为更进一步了解本发明上述的目的、功能、特点和优点,下文将配合所附图式进一步说明本发明的较佳实施例。In order to further understand the above-mentioned purpose, functions, features and advantages of the present invention, preferred embodiments of the present invention will be further described below in conjunction with the accompanying drawings.
图3系显示本发明的一实施例的红外线遥控指令的译码方法的流程图,为方便说明本发明的译码方法,在下文实施例中皆是以NEC码为例来说明,但并非是用以限制本发明。Fig. 3 is a flow chart showing the decoding method of an infrared remote control instruction according to an embodiment of the present invention. For the convenience of explaining the decoding method of the present invention, the following embodiments are all illustrated with NEC codes as an example, but not used to limit the invention.
在红外线遥控指令序列码输入(接收)后,步骤301先侦测序列码的起始脉波,一般而言,红外线指令序列码起始脉波的脉波寛度是数据脉波的脉波寛度的数倍,因此,当侦测到序列码中一脉波的脉波宽度超过数据脉波寛度甚多时,即可判断该脉波为起始脉波,以NEC码为例,NEC码的起始脉波的脉波宽度约9毫秒,而数据脉波的脉波宽度约0.56毫秒,因此,若侦测到的脉波宽度(高位准期间)超过一默认值(例如2毫秒),则判定该脉波为起始脉波。After the infrared remote control command serial code is input (received), step 301 first detects the initial pulse wave of the serial code. Generally speaking, the pulse width of the initial pulse wave of the infrared command serial code is the pulse width of the data pulse wave Therefore, when it is detected that the pulse width of a pulse wave in the serial code exceeds the data pulse width by a large amount, it can be judged that the pulse wave is the initial pulse wave. Taking the NEC code as an example, the NEC code The pulse width of the initial pulse is about 9 milliseconds, and the pulse width of the data pulse is about 0.56 milliseconds. Therefore, if the detected pulse width (high level period) exceeds a default value (for example, 2 milliseconds), Then it is determined that the pulse wave is the initial pulse wave.
在步骤302中,系计算用以译码序列码的取样周期。在确认起始脉波后,计算起始脉波后面出现的数据脉波的脉波寛度,并将此脉波寛度当做用以译码序列码数据位的取样周期。在NEC码的编码格式中,其数据脉波的脉波宽度(高位准期间)是固定的,一般是改变低位准期间来分别表示二进制的“0”或“1”位值,因此,取样周期即各个序列码位的脉波宽度(高位准期间),即0.56毫秒,若序列码的波形因传送过程而产生变形,则步骤302可计算出变形后的脉波宽度,并以此脉波宽度作为译码的取样周期。在一实施例中,取样周期是计算起始脉波后面出现的第一个数据脉波的脉波宽度所得到的。In step 302, the sampling period for decoding the sequence code is calculated. After the initial pulse is confirmed, the pulse width of the data pulse following the initial pulse is calculated, and the pulse width is used as the sampling period for decoding the sequence code data bits. In the encoding format of the NEC code, the pulse width of the data pulse (high level period) is fixed, and the low level period is generally changed to represent the binary "0" or "1" bit value respectively. Therefore, the sampling period That is, the pulse width (high level period) of each serial code bit, that is, 0.56 milliseconds, if the waveform of the serial code is deformed due to the transmission process, then step 302 can calculate the pulse width after deformation, and use the pulse width As the sampling period for decoding. In one embodiment, the sampling period is obtained by calculating the pulse width of the first data pulse following the initial pulse.
在步骤303中,以步骤302所得到的取样周期对序列码中的数据位(即数据脉波)进行译码,意即进行判断序列码中的用户码或数据码位所代表二进制的“0”或“1”位值。在本实施例中,步骤303是根据取样周期来侦测序列码中每两脉波间的间隔(例如序列码中一数据脉波的下降缘至相邻脉波的波形上升缘)所经过取样周期数,以辨识其所对应的位值,请参照图4(a)所示的示意图,其系以NEC码的数据位为例进行说明,当侦测到两脉波间的间隔小于2个取样周期时,该位代表二进制的“0”,如图4(b)所示,当所侦测的结果大于或等于2个取样周期时,该位即代表二进制的“1”。在另一实施例中,亦可根据取样周期来侦测一数据脉波的上升缘至相邻脉波的上升缘或下降缘所经过的取样周期数来判断此数据位所代表的位值。本发明的译码方法中,译码所依据的取样周期是由实际收到的脉波宽度所产生,即便是红外线指令序列码在传送过程有发生波形变形的情况,正常情况下,脉波变形是等比例的,因此,以变形后的脉波宽度所产生的取样周期来当作译码的依据,仍可得到正确的译码结果。In step 303, the data bit (i.e. data pulse wave) in the sequence code is decoded with the sampling period obtained in step 302, which means to judge the binary "0" represented by the user code or data code bit in the sequence code " or "1" bit value. In this embodiment, step 303 is to detect the interval between every two pulses in the serial code (for example, the falling edge of a data pulse in the serial code to the rising edge of the waveform of the adjacent pulse) through sampling according to the sampling period. The number of cycles, to identify the corresponding bit value, please refer to the schematic diagram shown in Figure 4(a), which is described by taking the data bits of the NEC code as an example. When the interval between two pulse waves is detected to be less than 2 During the sampling period, this bit represents a binary "0", as shown in Figure 4(b), when the detected result is greater than or equal to 2 sampling periods, this bit represents a binary "1". In another embodiment, the number of sampling periods elapsed from the rising edge of a data pulse to the rising or falling edge of an adjacent pulse can be detected according to the sampling period to determine the bit value represented by the data bit. In the decoding method of the present invention, the sampling period on which the decoding is based is generated by the actually received pulse width. Even if the infrared command sequence code has a waveform deformation during the transmission process, under normal circumstances, the pulse wave deformation Therefore, the correct decoding result can still be obtained by taking the sampling period generated by the deformed pulse width as the basis for decoding.
图5显示依本发明的红外线控制指令的译码装置的一实施例示意图,如图5所示,本发明的译码装置500包含一侦测单元510、一决定单元520以及一译码单元530。侦测单元510是用来侦测序列码的起始脉波,其根据一频率讯号来侦测序列码中脉波的脉波寛度是否超过一默认值,若侦测到的脉波宽度超过该默认值,则判定该脉波为起始脉波。以NEC码为例来说明起始脉波宽度与数据脉波宽度的差异,在NEC码中,起始脉波高位准期间的脉波宽度为9毫秒,而数据脉波宽度为0.56毫秒,因此,当序列码中一脉波的脉波宽度超过数据脉波寛度(0.56毫秒)甚多时,即可确定该脉波即为起始脉波,在本实施例中,将默认值设为2毫秒,当侦测单元510侦测到一脉波的脉波宽度超过2毫秒,侦测单元即判定该脉波为起始脉波,侦测单元510侦测到一起始脉波后,会产生一通知讯号INIT_PS,用以通知决定单元520及译码单元530。FIG. 5 shows a schematic diagram of an embodiment of a decoding device for infrared control commands according to the present invention. As shown in FIG. 5 , the decoding device 500 of the present invention includes a detection unit 510, a decision unit 520, and a decoding unit 530 . The detection unit 510 is used to detect the initial pulse wave of the serial code. It detects whether the pulse width of the pulse wave in the serial code exceeds a default value according to a frequency signal. If the detected pulse width exceeds the If the default value is set, the pulse wave is determined as the initial pulse wave. Take the NEC code as an example to illustrate the difference between the initial pulse width and the data pulse width. In the NEC code, the pulse width during the high level period of the initial pulse is 9 milliseconds, while the data pulse width is 0.56 milliseconds. Therefore, , when the pulse width of a pulse in the sequence code exceeds the data pulse width (0.56 milliseconds) a lot, it can be determined that the pulse is the initial pulse. In this embodiment, the default value is set to 2 Milliseconds, when the detection unit 510 detects that the pulse width of a pulse wave exceeds 2 milliseconds, the detection unit determines that the pulse wave is the initial pulse wave. After the detection unit 510 detects an initial pulse wave, it will generate A notification signal INIT_PS is used to notify the determination unit 520 and the decoding unit 530 .
决定单元520系用来计算译码序列码的取样周期S_P,当决定单元520收到侦测单元510的通知讯号INIT_PS后,即开始计算出现于起始脉波后面的数据脉波的脉波寛度,并将此脉波寛度当做用以译码序列码数据位的取样周期S_P。以NEC码为例,当决定单元520收到通知讯号INIT_PS后,即开始计算序列码中一脉波的脉波宽度,意即计算脉波的高位准期间,在标准的NEC码中,脉波宽度为0.56毫秒,故决定单元520会计算出0.56毫秒的取样周期值。然而,红外线遥控指令在传送过程中可能会受到干扰,而使得遥控指令序列码的脉波产生变形,此时,决定单元520仍可计算出变形后的脉波宽度,并以此脉波宽度当作取样周期S_P,因此,本发明的决定单元可精确地计算出所收到的遥控指令序列码实际的脉波宽度,并将此脉波宽度当作译码时的取样周期。The decision unit 520 is used to calculate the sampling period S_P of the decoding sequence code. When the decision unit 520 receives the notification signal INIT_PS from the detection unit 510, it starts to calculate the pulse width of the data pulse that appears behind the initial pulse. degrees, and take this pulse width as the sampling period S_P for decoding the sequence code data bits. Taking the NEC code as an example, when the decision unit 520 receives the notification signal INIT_PS, it starts to calculate the pulse width of a pulse wave in the sequence code, which means to calculate the high level period of the pulse wave. In the standard NEC code, the pulse wave width The width is 0.56 milliseconds, so the determining unit 520 calculates a sampling period value of 0.56 milliseconds. However, the infrared remote control command may be disturbed during the transmission process, causing the pulse wave of the remote control command sequence code to be deformed. At this time, the decision unit 520 can still calculate the deformed pulse width, and use the pulse width as As the sampling period S_P, therefore, the decision unit of the present invention can accurately calculate the actual pulse width of the received remote command sequence code, and use this pulse width as the sampling period for decoding.
译码单元530系用来译码序列码的所包含的二进制值,当译码单元530收到来自侦测单元的通知讯号INIT_PS后,即以决定单元所计算出的取样周期S_P来译码所收到的序列码,在一实施例中,译码单元530系根据取样周期S_P来侦测序列码中每两脉波间的间隔所经过的取样周期数,以辨识其所对应的二进制值,译码单元530可藉由侦测序列码中一数据脉波的下降缘至相邻脉波的波形上升缘间所经过的取样周期数,或侦测一数据脉波的上升缘至相邻脉波的上升缘或下降缘所经过的取样周期数来辨识序列码中每一脉波所代表的二进制值。请参照图4(a)所示的示意图,其系以NEC码的数据位为例进行说明,当侦测到一数据脉波的下降缘至相邻脉波的波形上升缘间所经过的取样周期数小于2个取样周期S_P时,该脉波代表二进制的“0”,另一方面,如图4(b)所示,当所侦测的结果大于或等于2个取样周期S_P时,该脉波即代表二进制的“1”。此外,译码单元530所依据的取样周期是由实际收到的脉波宽度所产生,因此,无论序列码在传送过程中是有产生变形,译码单元530仍可正确地译码收到的序列码。The decoding unit 530 is used to decode the binary value contained in the sequence code. When the decoding unit 530 receives the notification signal INIT_PS from the detection unit, it decodes all the values with the sampling period S_P calculated by the determination unit. For the received serial code, in one embodiment, the decoding unit 530 detects the number of sampling periods passed by every interval between two pulses in the serial code according to the sampling period S_P, so as to identify its corresponding binary value, The decoding unit 530 can detect the number of sampling cycles elapsed between the falling edge of a data pulse and the rising edge of an adjacent pulse in the sequence code, or detect the rising edge of a data pulse to an adjacent pulse. The number of sampling cycles passed by the rising edge or falling edge of the wave is used to identify the binary value represented by each pulse wave in the sequence code. Please refer to the schematic diagram shown in Figure 4(a), which uses the data bits of the NEC code as an example for illustration. When the number of cycles is less than 2 sampling periods S_P, the pulse wave represents binary "0". On the other hand, as shown in Figure 4(b), when the detected result is greater than or equal to 2 sampling periods S_P, the pulse wave The wave represents a binary "1". In addition, the sampling period on which the decoding unit 530 is based is generated by the actual received pulse width. Therefore, no matter whether the serial code is deformed during transmission, the decoding unit 530 can still correctly decode the received pulse width. serial number.
图6系本发明译码装置的一较佳实施例的示意图,在译码装置600中,侦测单元610先侦测序列码的起始脉波,当侦测到的脉波宽度超过一默认值,则判定该脉波为起始脉波,并以通知信号INIT_PS分别通知译码单元630及决定单元620,以启动译码单元830对序列码进行译码操作,且使决定单元620根据序列码及频率信号产生一取样周期。决定单元620包含一计数器621及一闩锁器622,计数器621于收到侦测单元610的通知讯号INIT_PS后,即根据频率讯号计算起始脉波后第一个数据脉波的脉波宽度,意即计算数据脉波的高位准期间所经过的频率数,并将最后计算出来的频率数提供给闩锁器622,闩锁器622会闩锁收到频率数以作为取样周期S_P,并将取样周期S_P输出到译码单元630,译码单元630则依据取样周期S_P对序列码的数据脉波进行译码,同时,译码单元630会将译码序列码所得到的位值暂存至记忆单元640中,待完成一序列码的译码后,再由记忆单元640中输出完整的指令值。FIG. 6 is a schematic diagram of a preferred embodiment of the decoding device of the present invention. In the decoding device 600, the detection unit 610 first detects the initial pulse wave of the sequence code, and when the detected pulse width exceeds a default value, then it is determined that the pulse wave is the initial pulse wave, and the notification signal INIT_PS is used to notify the decoding unit 630 and the decision unit 620 respectively, so as to start the decoding unit 830 to decode the sequence code, and make the decision unit 620 according to the sequence code The code and frequency signals generate a sampling period. The determination unit 620 includes a counter 621 and a latch 622. After the counter 621 receives the notification signal INIT_PS from the detection unit 610, it calculates the pulse width of the first data pulse after the initial pulse according to the frequency signal. That is to calculate the frequency number passed during the high level period of the data pulse, and provide the last calculated frequency number to the latch 622, and the latch 622 will latch the received frequency number as the sampling period S_P, and The sampling period S_P is output to the decoding unit 630, and the decoding unit 630 decodes the data pulse wave of the serial code according to the sampling period S_P. At the same time, the decoding unit 630 temporarily stores the bit value obtained by decoding the serial code in In the memory unit 640 , after decoding a sequence of codes, the memory unit 640 outputs a complete command value.
综上所述,本发明利用所收到的序列码的脉波宽度产生取样周期,并根据此取样周期对序列码进行译码,因此可解决译码变形的序列码的问题。To sum up, the present invention utilizes the pulse width of the received serial code to generate a sampling period, and decodes the serial code according to the sampling period, thus solving the problem of decoding deformed serial codes.
虽然本发明已利用上述的较佳实施例予以详细揭示,然其并非用以限定本发明,凡熟习此技术人士,在不脱离本发明的精神和范围内,可进行各种更动及修改,因此本发明的保护范围当以权利要求为准。Although the present invention has been disclosed in detail using the above-mentioned preferred embodiments, it is not intended to limit the present invention. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention should be determined by the claims.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200810182610.2A CN101751768B (en) | 2008-12-09 | 2008-12-09 | Decoding method and device thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200810182610.2A CN101751768B (en) | 2008-12-09 | 2008-12-09 | Decoding method and device thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101751768A CN101751768A (en) | 2010-06-23 |
CN101751768B true CN101751768B (en) | 2015-06-17 |
Family
ID=42478695
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN200810182610.2A Active CN101751768B (en) | 2008-12-09 | 2008-12-09 | Decoding method and device thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101751768B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102957503A (en) * | 2011-08-31 | 2013-03-06 | 北京中电华大电子设计有限责任公司 | MMC (Multi Media Card) code type data decoding method applicable to different duty ratios |
TWI446301B (en) * | 2012-04-13 | 2014-07-21 | Giga Byte Tech Co Ltd | Infrared signal composite decoding method and device thereof |
CN102904640B (en) * | 2012-11-05 | 2016-08-10 | 珠海横琴华策光通信科技有限公司 | The update method of geocoding and updating device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5140256A (en) * | 1990-01-10 | 1992-08-18 | Kojiro Hara | PWM signal demodulation method and apparatus |
EP0808028A1 (en) * | 1995-10-30 | 1997-11-19 | SMK Corporation | Pulse modulating method, pulse modulator, and pulse demodulator |
TW200539023A (en) * | 2004-05-28 | 2005-12-01 | Chyau Yuan Technology Co Ltd | Encoding and decoding methods of an infrared remote control |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001145184A (en) * | 1999-11-17 | 2001-05-25 | Nec Corp | Remote control signal receiver |
CN1168267C (en) * | 2000-10-30 | 2004-09-22 | 大金工业株式会社 | Data transmission method and data transmission equipment |
CN101127156B (en) * | 2006-08-17 | 2012-02-08 | 晨星半导体股份有限公司 | Universal decoding and identification device for universal remote control receiver |
-
2008
- 2008-12-09 CN CN200810182610.2A patent/CN101751768B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5140256A (en) * | 1990-01-10 | 1992-08-18 | Kojiro Hara | PWM signal demodulation method and apparatus |
EP0808028A1 (en) * | 1995-10-30 | 1997-11-19 | SMK Corporation | Pulse modulating method, pulse modulator, and pulse demodulator |
TW200539023A (en) * | 2004-05-28 | 2005-12-01 | Chyau Yuan Technology Co Ltd | Encoding and decoding methods of an infrared remote control |
Non-Patent Citations (3)
Title |
---|
张建军,穆远祥,韩江洪.一种16 位码红外遥控器的解码方法.《合肥工业大学学报(自然科学版)》.2008,第31卷(第2期),171-174. * |
戴培山,冯成德,刘栋.基于keil c51的红外遥控器解码设计.《自动化与仪器仪表》.2003,(第6期),11-13,23. * |
肖圣兵,仲兴荣,徐清源,曲波.一种红外遥控信号的解码方法.《苏州大学学报(自然科学)》.2002,第18卷(第2期),101-106. * |
Also Published As
Publication number | Publication date |
---|---|
CN101751768A (en) | 2010-06-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI389064B (en) | A decoding method and apparatus for infrared remote control commands | |
JP5767462B2 (en) | COMMUNICATION MODE DETECTION METHOD BY RECEIVING DEVICE FOR NEAR RANGE COMMUNICATION | |
CN100545882C (en) | Adaptive decoding method for wireless remote control receiving chip | |
RU2001105535A (en) | Device and method for controlling forward link power in discontinuous transmission mode in a mobile communication system | |
KR20140063831A (en) | Method and device for sending and receiving data | |
CN101751768B (en) | Decoding method and device thereof | |
CN103825675A (en) | Coding method and apparatus in secondary ultrasonic communication | |
CN102298565A (en) | Method for decoding and triggering asynchronous serial bus signals | |
CN203574663U (en) | Automatic baud rate detection module | |
US10990348B2 (en) | Detection method and detection device for audio signal | |
US7676003B2 (en) | Carrier frequency-independent receiver | |
JPH07288516A (en) | Serial data transmission / reception circuit | |
KR101192327B1 (en) | Decoder for manchester code and control method thereof, data receiving appatatus including the same decoder | |
CN111104166A (en) | Register writing method and device | |
JPH07264263A (en) | Serial communication interface device | |
KR100832462B1 (en) | Data processing method of infrared communication system and device therefor | |
CN101414883B (en) | Receiver Independent of Carrier Frequency | |
JPH0918461A (en) | Data receiver | |
JP2004328103A (en) | Error detector circuit | |
CN113824545B (en) | Asynchronous communication method, device and related equipment | |
US20240267267A1 (en) | Signal transmission and reception system, reception device, and reception method | |
JP6779113B2 (en) | Waveform measuring device | |
US20100014621A1 (en) | Synchronization Determining Circuit, Receiver Including the Synchronization Determining Circuit, and Method of the Receiver | |
JP2004336629A (en) | Remote control receiver | |
US12267190B2 (en) | Decoding systems and methods for mitigating distortions in digital signals |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20201023 Address after: No. 1, Xingzhu Road, Hsinchu Science Park, Taiwan, China Patentee after: MEDIATEK Inc. Address before: 405, 4th floor, 1st District, Shenzhen Bay science and technology ecological park, Aohai street, Nanshan District, Shenzhen City, Guangdong Province Patentee before: Mstar Semiconductor,Inc. Patentee before: MEDIATEK Inc. Effective date of registration: 20201023 Address after: 405, 4th floor, 1st District, Shenzhen Bay science and technology ecological park, Aohai street, Nanshan District, Shenzhen City, Guangdong Province Patentee after: Mstar Semiconductor,Inc. Patentee after: MEDIATEK Inc. Address before: 4 building 518057, block C, Institute of international technology innovation, South tech ten road, Shenzhen hi tech Zone, Guangdong Patentee before: Mstar Semiconductor,Inc. Patentee before: MSTAR SEMICONDUCTOR Inc. |
|
TR01 | Transfer of patent right |