WO2015124047A1 - Method and device for waveform analysis - Google Patents

Method and device for waveform analysis Download PDF

Info

Publication number
WO2015124047A1
WO2015124047A1 PCT/CN2015/070739 CN2015070739W WO2015124047A1 WO 2015124047 A1 WO2015124047 A1 WO 2015124047A1 CN 2015070739 W CN2015070739 W CN 2015070739W WO 2015124047 A1 WO2015124047 A1 WO 2015124047A1
Authority
WO
WIPO (PCT)
Prior art keywords
period
pulse width
square wave
bit
waveform
Prior art date
Application number
PCT/CN2015/070739
Other languages
French (fr)
Chinese (zh)
Inventor
李东声
Original Assignee
天地融科技股份有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 天地融科技股份有限公司 filed Critical 天地融科技股份有限公司
Publication of WO2015124047A1 publication Critical patent/WO2015124047A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04KSECRET COMMUNICATION; JAMMING OF COMMUNICATION
    • H04K1/00Secret communication
    • H04K1/003Secret communication by varying carrier frequency at or within predetermined or random intervals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/34User authentication involving the use of external additional devices, e.g. dongles or smart cards
    • G06F21/35User authentication involving the use of external additional devices, e.g. dongles or smart cards communicating wirelessly

Definitions

  • the present invention relates to the field of electronic technologies, and in particular, to a method and apparatus for analyzing waveforms.
  • the smart key device is a secure device with a signature function and/or a dynamic password generation function.
  • a mobile terminal such as a mobile phone or a tablet through an audio interface
  • the smart key device samples the received waveform and parses out the bit corresponding to the waveform.
  • the present invention provides a method and apparatus for analyzing waveforms, the primary object of which is to provide an analysis scheme for waveforms when transmitting waveforms through an audio interface.
  • a method for analyzing a waveform according to the first aspect of the present invention includes: receiving a sine wave waveform, wherein the sine wave waveform includes a period of Ta for sine wave representing bit 0 and b periods of Tb a sine wave representing bit 1, wherein period Ta and period Tb are not equal, a and b are positive integers; sampling the sine wave waveform to obtain a square wave waveform; obtaining an ith rise in the square wave waveform a pulse width Mi between the edge and the i-th falling edge, where i is a positive integer less than or equal to the sum of a and b; the pulse width Mi is half of the pre-acquired period T1 and half of the pre-acquired period T0 Comparing, obtaining a comparison result; determining, according to the comparison result, a bit represented by a square wave corresponding to the pulse width Mi; wherein, according to the comparison result, determining a bit represented by the square wave corresponding to the pulse width Mi, comprising: if the pulse width Mi is equal
  • determining the bit of the square wave representation of the pulse width Mi comprises: if the pulse width Mi is not equal to half of the period T1, nor equal to half of the period T0, determining whether the pulse width Mi is Within the error range of the pre-acquired period T1 or half of the period T0, if the pulse width Mi is within the error range of half of the period T1, it is determined that the square wave corresponding to the pulse width Mi represents the bit 1 if the pulse width Mi Within the error range of half of the period T0, it is determined that the square wave corresponding to the pulse width Mi represents bit 0.
  • a method for analyzing a waveform according to a second aspect of the present invention includes: receiving a sine wave waveform, wherein the sine wave waveform includes a sine wave for indicating bit 0 and b periods of Tb for period Ta a sine wave representing bit 1, wherein period Ta and period Tb are not equal, a and b are positive integers; and the sine wave waveform is taken Obtaining a square wave waveform; acquiring a pulse width Mi between the i-th rising edge and the i+1th rising edge of the square waveform, or acquiring the i-th falling edge and the first wave of the square wave waveform a pulse width Ni between i+1 falling edges, where i is a positive integer less than or equal to the sum of a and b; each pulse width obtained is compared with a pre-acquired period T1 and a pre-acquired period T0 And obtaining a comparison result; determining, according to the comparison result, a bit represented by a square wave corresponding to each pulse width; wherein,
  • the determining, according to the comparison result, the bit represented by the square wave corresponding to each pulse width includes: if a certain pulse width is not equal to the period T1 or the period T0, determining whether the certain pulse width is In the error range of the pre-acquisition period T1 or the period T0, if the certain pulse width Mi is within the error range of the period T1, it is determined that the square wave corresponding to the certain pulse width represents the bit 1, if the certain one The pulse width Mi is within the error range of the period T0, and it is determined that the square wave corresponding to the certain pulse width Mi represents the bit 0.
  • the method further comprises: determining the pulse width Mi and the pulse Whether the width Ni is between the period T0 and the period T1; if the pulse width Mi is between the period T0 and the period T1, the pulse width Ni is used as compared with the period T1 and the period T0 If the pulse width Ni is between the period T0 and the period T1, the pulse width Mi is taken as the pulse width used when comparing the period T1 and the period T0.
  • An apparatus for analyzing a waveform according to a third aspect of the present invention includes: a receiving module, configured to receive a sine wave waveform, wherein the sine wave waveform includes a sine wave and a plurality of periods Ta representing a bit 0 a sine wave representing a bit 1 of a period Tb, wherein the period Ta and the period Tb are not equal, a and b are positive integers; a sampling module for sampling the sine wave waveform to obtain a square wave waveform; a module for acquiring a pulse width Mi between an i-th rising edge and an i-th falling edge of the square waveform, wherein i is a positive integer less than or equal to a sum of a and b; a comparison module, configured to The pulse width Mi is compared with half of the pre-acquired period T1 and half of the pre-acquired period T0 to obtain a comparison result; and a determining module is configured to determine a bit represented by the square wave corresponding to the pulse width Mi according to the
  • the determining module includes: a determining unit, configured to determine whether the pulse width Mi is in a pre-acquisition period T1 or a period if the pulse width Mi is not equal to half of the period T1 or half of the period T0. a half of the error range of T0; a determining unit for determining that the square wave corresponding to the pulse width Mi represents bit 1 if the pulse width Mi is within an error range of half of the period T1, if the pulse width Mi is in a period Half of T0 Within the error range, it is determined that the square wave corresponding to the pulse width Mi represents bit 0.
  • An apparatus for analyzing a waveform includes: a receiving module, configured to receive a sine wave waveform, wherein the sine wave waveform includes a sine wave and a plurality of periods Ta representing a bit 0 a sine wave representing a bit 1 of a period Tb, wherein the period Ta and the period Tb are not equal, a and b are positive integers; a sampling module for sampling the sine wave waveform to obtain a square wave waveform; a module, configured to acquire a pulse width Mi between an i th rising edge and an i+1 th rising edge of the square waveform, or obtain an i th falling edge and an i+1 in the square wave waveform a pulse width Ni between the falling edges, where i is a positive integer less than or equal to the sum of a and b; a comparison module for respectively obtaining each pulse width obtained with the pre-acquired period T1 and the pre-acquired period T0 Comparing, obtaining a comparison result;
  • the determining module includes: a determining unit, configured to determine whether the pulse width is not equal to the period T1 or the period T0, and determine whether the pulse width is in the pre-acquired period T1 or the period T0. a determining unit, configured to determine, if the certain pulse width Mi is within an error range of the period T1, determining a square wave corresponding to the one pulse width to represent the bit 1 if the certain pulse width Mi is in a period Within the error range of T0, it is determined that the square wave corresponding to the certain pulse width Mi represents bit 0.
  • the device further includes: a determining module, configured to determine, after acquiring the pulse width Mi or the pulse width Ni, each pulse width obtained before comparing with the pre-acquired period T1 and the pre-acquired period T0 Whether the pulse width Mi and the pulse width Ni are between the period T0 and the period T1; and a selection module for using the pulse width Ni as the pulse width Mi between the period T0 and the period T1
  • a determining module configured to determine, after acquiring the pulse width Mi or the pulse width Ni, each pulse width obtained before comparing with the pre-acquired period T1 and the pre-acquired period T0 Whether the pulse width Mi and the pulse width Ni are between the period T0 and the period T1
  • a selection module for using the pulse width Ni as the pulse width Mi between the period T0 and the period T1
  • a storage medium comprising: a method for storing an application for performing the method of analyzing a waveform according to the first aspect of the present invention.
  • a storage medium comprising: a method for storing an application for performing the method of analyzing a waveform according to the second aspect of the present invention.
  • the bits represented by the square wave are determined by acquiring the pulse width of the square wave waveform, thereby realizing the analysis of the waveform.
  • FIG. 1 is a schematic flow chart of an embodiment of a method for analyzing a waveform according to the present invention
  • FIG. 2 is a schematic diagram of a method for determining a bit according to Embodiment 1 of the present invention
  • FIG. 3 is a schematic flow chart of another embodiment of a method for analyzing a waveform according to the present invention.
  • FIG. 4 is a schematic diagram of a method for determining a bit according to Embodiment 2 of the present invention.
  • FIG. 5 is a schematic structural diagram of an apparatus for analyzing waveforms according to the present invention.
  • FIG. 6 is a schematic structural diagram of another embodiment of an apparatus for analyzing waveforms according to the present invention.
  • FIG. 1 is a schematic flow chart of an embodiment of a method for analyzing a waveform according to the present invention.
  • the method embodiment shown in Figure 1 includes:
  • Step 101 Receive a sine wave waveform, wherein the sine wave waveform includes a sine wave for indicating bit 0 and a sine wave for indicating bit 1 with period B being Ta, wherein period Ta and The periods Tb are not equal, and a and b are positive integers.
  • the sinusoidal waveform is sent by the mobile terminal through the audio interface, and the smart key device is connected to the mobile terminal through the audio interface to achieve the purpose of receiving the sine wave waveform.
  • the sine wave waveform includes two sine waves of different periods, representing bit 1 and bit 0, respectively.
  • Step 102 Sampling the sine wave waveform to obtain a square wave waveform.
  • the smart key device samples the received sinusoidal waveform according to a local sampling period, and obtains a square wave waveform according to the sampling result of the sampling point position.
  • Step 103 Acquire a pulse width Mi between the i-th rising edge and the i-th falling edge of the square wave waveform, where i ⁇ a+b, and i is a positive integer.
  • the detection of the rising edge and the falling edge can be detected by a level change, the pulse width of which can be determined according to the clock used by the waveform, and the pulse width Mi between the i-th rising edge and the i-th falling edge represents one Square wave period Half of it.
  • the pulse width of the sum of a and b can be obtained.
  • Step 104 Comparing the pulse width Mi with half of the pre-acquired period T1 and half of the pre-acquired period T0 to obtain a comparison result;
  • the period T0 and the period T1 are obtained as follows:
  • the square wave waveform sequentially includes a waveform of the test data and a waveform of the valid data, wherein the bit sequence represented by the waveform of the test data is pre-negotiated, and the smart key device can acquire the bit in the waveform of the test data according to the bit sequence.
  • a period corresponding to 0 and bit 1 is further obtained according to a period corresponding to bit 0 and bit 1 in the test data, and a period corresponding to bit 0 and bit 1 in the square wave waveform is obtained.
  • Step 105 Determine, according to the comparison result, a bit represented by a square wave corresponding to the pulse width Mi.
  • FIG. 2 is a schematic diagram of a method for determining a bit according to Embodiment 1 of the present invention.
  • the process shown in Figure 2 includes:
  • Step 1051 determining whether the pulse width Mi is equal to half of the period T1 or half of the period T0;
  • step 1052 and step 1053 are performed;
  • Step 1052 if the pulse width Mi is equal to half of the period T1, the square wave corresponding to the pulse width Mi represents bit 1;
  • Step 1053 If the pulse width Mi is equal to half of the period T0, the square wave corresponding to the pulse width Mi represents bit 0.
  • Step 1054 if the pulse width Mi is not equal to half of the period T1 and is not equal to half of the period T0, it is determined whether the pulse width Mi is within an error range of a pre-acquired period T1 or a half of the period T0;
  • Step 1055 if the pulse width Mi is within the error range of one half of the period T1, it is determined that the square wave corresponding to the pulse width Mi represents the bit 1;
  • Step 1056 if the pulse width Mi is within an error range of half of the period T0, it is determined that the square wave corresponding to the pulse width Mi represents bit 0.
  • the error range is caused by operations such as transmission delay.
  • the pulse width Mi is not equal to any one of T0 and T1
  • the bit represented by the square wave waveform can be effectively analyzed to ensure complete analysis of the square wave.
  • the method embodiment provided by the present invention determines the bit represented by the square wave by acquiring the pulse width Mi between the i-th rising edge and the i-th falling edge when the bits 0 and 1 are represented by transmitting waveforms of different periods. Achieve the analysis of the waveform.
  • FIG. 3 is a schematic flow chart of another embodiment of a method for analyzing waveforms according to the present invention.
  • Method embodiment shown in FIG. include:
  • Steps 201 and 202 are the same as steps 101 and 102, and are not described here.
  • Step 203 Acquire a pulse width Mi between the i-th rising edge and the i+1th rising edge of the square wave waveform, or obtain an i-th falling edge and an i+1th of the square wave waveform.
  • a pulse width Ni between falling edges where i ⁇ a + b, and i is a positive integer;
  • the pulse width between two adjacent rising edges or the pulse width between two adjacent falling edges represents a square wave period.
  • the pulse width of the sum of a and b can be obtained.
  • the selection of the rising edge or the falling edge depends on the level of the starting position of the first period of the square wave waveform, and if the level of the starting position of the first period is the rising edge, the two adjacent rising edges are acquired.
  • Step 204 Compare each obtained pulse width with a pre-acquired period T1 and a pre-acquired period T0 to obtain a comparison result.
  • the period T0 and the period T1 are obtained as follows:
  • the square wave waveform sequentially includes a waveform of the test data and a waveform of the valid data, wherein the bit sequence represented by the waveform of the test data is pre-negotiated, and the smart key device can acquire the bit in the waveform of the test data according to the bit sequence.
  • a period corresponding to 0 and bit 1 is further obtained according to a period corresponding to bit 0 and bit 1 in the test data, and a period corresponding to bit 0 and bit 1 in the square wave waveform is obtained.
  • Step 205 Determine, according to the comparison result, a bit represented by a square wave corresponding to each pulse width.
  • FIG. 4 is a schematic diagram of a method for determining a bit according to Embodiment 2 of the present invention.
  • the process shown in Figure 4 includes:
  • Step 2051 determining whether the pulse width Mi is equal to half of the period T1 or half of the period T0;
  • step 2052 and step 2053 are performed;
  • Step 2052 if the pulse width Mi is equal to the period T1, the square wave corresponding to the pulse width Mi represents the bit 1;
  • Step 2053 if the pulse width Mi is equal to the period T0, the square wave corresponding to the pulse width Mi represents bit 0.
  • Step 2054 a certain pulse width is not equal to the period T1, and is not equal to the period T0, and it is determined whether the certain pulse width is within the error range of the pre-acquired period T1 or the period T0;
  • Step 2055 if the certain pulse width Mi is within the error range of the period T1, it is determined that the square wave corresponding to the certain pulse width represents the bit 1;
  • Step 2056 if the certain pulse width Mi is within the error range of the period T0, it is determined that the square wave corresponding to the certain pulse width Mi represents the bit 0.
  • the error range is caused by operations such as transmission delay.
  • the pulse width Mi is not equal to any one of T0 and T1
  • the square wave waveform representation can be effectively resolved by judging whether the pulse width is within the allowable error range.
  • the bit ensures the complete resolution of the square wave.
  • the method further includes:
  • the pulse width Ni is taken as the pulse width used when comparing the period T1 and the period T0; if the pulse width Ni is in the period T0 and the period T1 In between, the pulse width Mi is taken as the pulse width used when comparing the period T1 and the period T0.
  • the error pulse width is eliminated by judging whether the pulse width is within the two values, thereby obtaining how to correctly acquire a square wave period and improving the decoding precision.
  • the method provided by the present invention realizes the analysis of the waveform by determining the bit width of the square wave period by acquiring the pulse width of one square wave period when the bits 0 and 1 are represented by transmitting waveforms of different periods.
  • the bit represented by the square wave waveform is acquired by the pulse width of one cycle, and the bit width of the square wave waveform is acquired with the pulse width of one half cycle, and the determined bit is more accurate.
  • FIG. 5 is a schematic structural diagram of an apparatus for analyzing waveforms according to the present invention.
  • the embodiment shown in Figure 5 includes:
  • the receiving module 301 is configured to receive a sine wave waveform, where the sine wave waveform includes a sine wave for indicating bit 0 and a sine wave for indicating bit 1 with period B being Ta, wherein The period Ta and the period Tb are not equal, and a and b are positive integers;
  • the sampling module 302 is connected to the receiving module 301, and is configured to sample the sine wave waveform to obtain a square wave waveform;
  • the obtaining module 303 is connected to the sampling module 302, and configured to acquire a pulse width Mi between the i-th rising edge and the i-th falling edge of the square wave waveform, where i ⁇ a+b, and i is a positive integer;
  • the comparison module 304 is connected to the acquisition module 303 for comparing the pulse width Mi with half of the pre-acquired period T1 and half of the pre-acquired period T0 to obtain a comparison result;
  • the determining module 305 is connected to the comparing module 304, and configured to determine, according to the comparison result, a bit represented by a square wave corresponding to the pulse width Mi;
  • the determining module is configured to: if the pulse width Mi is equal to half of the period T1, the square wave corresponding to the pulse width Mi represents the bit 1; if the pulse width Mi is equal to half of the period T0, the pulse width Mi corresponds to The square wave represents bit 0.
  • the determining module 305 includes:
  • a judging unit configured to determine whether the pulse width Mi is within an error range of a pre-acquired period T1 or a half of the period T0 if the pulse width Mi is not equal to half of the period T1 or equal to half of the period T0;
  • the smart key device may further include: a receiving module, an acquiring module, an obtaining module, a comparing module, and a determining module, the receiving module performing a function related to receiving, the collecting module performing a function related to the collecting, acquiring the module performing and acquiring data, etc.
  • the comparison module performs the functions related to the comparison and the functions related to the determination module execution and determination, as long as the module division capable of achieving the object of the present invention falls within the scope of protection of the present invention.
  • the method embodiment provided by the present invention determines the bit represented by the square wave by acquiring the pulse width Mi between the i-th rising edge and the i-th falling edge when the bits 0 and 1 are represented by transmitting waveforms of different periods. Achieve the analysis of the waveform.
  • FIG. 6 is a schematic structural diagram of another apparatus for analyzing waveforms according to the present invention.
  • the embodiment shown in Figure 6 includes:
  • the receiving module 401 is configured to receive a sine wave waveform, where the sine wave waveform includes a sine wave for indicating bit 0 and a sine wave for indicating bit 1 with period B being Ta, where The period Ta and the period Tb are not equal, and a and b are positive integers;
  • a sampling module 402 configured to sample the sine wave waveform to obtain a square wave waveform
  • the obtaining module 403 is configured to acquire a pulse width Mi between the i-th rising edge and the i+1th rising edge of the square wave waveform, or obtain an i-th falling edge and an ith of the square wave waveform a pulse width Ni between +1 falling edges, where i ⁇ a+b, and i is a positive integer;
  • the comparison module 404 is configured to compare each of the obtained pulse widths with the pre-acquired period T1 and the pre-acquired period T0 to obtain a comparison result;
  • the determining module 405 is configured to determine, according to the comparison result, a bit of the square wave representation corresponding to each pulse width.
  • the determining module 405 includes:
  • a determining unit configured to determine whether the one pulse width is within an error range of the pre-acquired period T1 or the period T0 if the obtained one pulse width is not equal to the period T1 or the period T0;
  • Determining a unit if the certain pulse width Mi is within the error range of the period T1, determining that the square wave corresponding to the certain pulse width represents the bit 1 if the error of the certain pulse width Mi is in the period T0 Within the range, determining that the square wave corresponding to the certain pulse width Mi represents bit 0;
  • the determining module is configured to: if the pulse width Mi is equal to the period T1, the square corresponding to the pulse width Mi The wave represents bit 1; if the pulse width Mi is equal to the period T0, the square wave corresponding to the pulse width Mi represents bit 0.
  • the device further comprises:
  • a judging module configured to determine a pulse width Mi and a pulse before comparing each of the obtained pulse widths with the pre-acquired period T1 and the pre-acquired period T0 after acquiring the pulse width Mi or the pulse width Ni Whether the width Ni is between the period T0 and the period T1;
  • a selection module for using a pulse width Ni as a pulse width used when compared with the period T1 and the period T0 if the pulse width Mi is between the period T0 and the period T1; if the pulse width Ni is in the Between the period T0 and the period T1, the pulse width Mi is used as the pulse width used when comparing the period T1 and the period T0.
  • the smart key device may further include: a receiving module, an acquiring module, an obtaining module, a comparing module, and a determining module, the receiving module performing a function related to receiving, the collecting module performing a function related to the collecting, acquiring the module performing and acquiring data, etc.
  • the comparison module performs the functions related to the comparison and the functions related to the determination module execution and determination, as long as the module division capable of achieving the object of the present invention falls within the scope of protection of the present invention.
  • the method provided by the present invention realizes the analysis of the waveform by determining the bit width of the square wave period by acquiring the pulse width of one square wave period when the bits 0 and 1 are represented by transmitting waveforms of different periods.
  • the bit represented by the square wave waveform is acquired by the pulse width of one cycle, and the bit width of the square wave waveform is acquired with the pulse width of one half cycle, and the determined bit is more accurate.
  • the present invention also provides a storage medium comprising: a method for storing an application for executing the parsed waveform shown in the first embodiment.
  • the present invention further provides a storage medium, comprising: a method for storing an application for executing the parsing waveform shown in the second embodiment.
  • portions of the invention may be implemented in hardware, software, firmware or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
  • each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules, if implemented in the form of software functional modules and sold or used as stand-alone products, may also be stored in a computer readable storage medium.
  • the above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Measuring Pulse, Heart Rate, Blood Pressure Or Blood Flow (AREA)

Abstract

A method and device for waveform analysis are provided. The method comprises: receiving sinusoidal waveforms comprising a number a of sinusoidal waves with the cycle Ta and for representing bits 0 and a number b of sinusoidal waves with the cycle Tb and for representing bits 1, wherein the cycle Ta is not equal to the cycle Tb and a and b are positive integers (101); obtaining square waveforms by sampling the sinusoidal waveforms (102); acquiring a pulse width Mi between an i-th rising edge and an i-th falling edge in the square waveform, wherein i is a positive integer smaller than or equal to the sum of a and b (103); comparing the pulse width Mi with half of a cycle T1 obtained in advance and with half of a cycle T0 obtained in advance to obtain a comparative result (104); and determining the bit represented by the square wave corresponding to the pulse width Mi according to the comparative result (105), which includes: if the pulse width Mi is equal to half of the cycle T1, the square wave corresponding to the pulse width Mi represents a bit 1; and if the pulse width Mi is equal to half of the cycle T0, the square wave corresponding to the pulse width Mi represents a bit 0.

Description

一种解析波形的方法和装置Method and device for analyzing waveform 技术领域Technical field
本发明涉及电子技术领域,尤其涉及一种解析波形方法和装置。The present invention relates to the field of electronic technologies, and in particular, to a method and apparatus for analyzing waveforms.
背景技术Background technique
智能密钥设备为具有签名功能和/或动态口令生成功能的安全设备。在智能密钥设备与手机、平板电脑等移动终端通过音频接口进行通信时,在移动终端输出波形后,智能密钥设备会对接收的波形进行采样,解析出波形对应的比特。The smart key device is a secure device with a signature function and/or a dynamic password generation function. When the smart key device communicates with a mobile terminal such as a mobile phone or a tablet through an audio interface, after the mobile terminal outputs a waveform, the smart key device samples the received waveform and parses out the bit corresponding to the waveform.
而现有技术中没有提供一种解析音频信号对应的波形的方案。However, there is no solution in the prior art for parsing a waveform corresponding to an audio signal.
发明内容Summary of the invention
本发明提供一种解析波形的方法和装置,主要目的在于提供在通过音频接口传输波形时对波形的解析方案。The present invention provides a method and apparatus for analyzing waveforms, the primary object of which is to provide an analysis scheme for waveforms when transmitting waveforms through an audio interface.
本发明第一方面提出的一种解析波形的方法,包括:接收正弦波波形,其中所述正弦波波形包括a个周期为Ta的用于表示比特0的正弦波和b个周期为Tb的用于表示比特1的正弦波,其中,周期Ta和周期Tb不相等,a和b为正整数;对所述正弦波波形进行采样,得到方波波形;获取所述方波波形中第i个上升沿与第i个下降沿之间的脉冲宽度Mi,其中i为小于或等于a和b的总和的正整数;将脉冲宽度Mi与预先获取的周期T1的一半和预先获取的周期T0的一半进行比较,得到比较结果;根据比较结果,确定脉冲宽度Mi对应的方波表示的比特;其中根据比较结果,确定脉冲宽度Mi对应的方波表示的比特,包括:如果所述脉冲宽度Mi等于周期T1的一半,则脉冲宽度Mi对应的方波表示比特1;如果所述脉冲宽度Mi等于周期T0的一半,则脉冲宽度Mi对应的方波表示比特0。A method for analyzing a waveform according to the first aspect of the present invention includes: receiving a sine wave waveform, wherein the sine wave waveform includes a period of Ta for sine wave representing bit 0 and b periods of Tb a sine wave representing bit 1, wherein period Ta and period Tb are not equal, a and b are positive integers; sampling the sine wave waveform to obtain a square wave waveform; obtaining an ith rise in the square wave waveform a pulse width Mi between the edge and the i-th falling edge, where i is a positive integer less than or equal to the sum of a and b; the pulse width Mi is half of the pre-acquired period T1 and half of the pre-acquired period T0 Comparing, obtaining a comparison result; determining, according to the comparison result, a bit represented by a square wave corresponding to the pulse width Mi; wherein, according to the comparison result, determining a bit represented by the square wave corresponding to the pulse width Mi, comprising: if the pulse width Mi is equal to the period T1 In the half, the square wave corresponding to the pulse width Mi represents the bit 1; if the pulse width Mi is equal to half of the period T0, the square wave corresponding to the pulse width Mi represents the bit 0.
其中,所述根据比较结果,确定脉冲宽度Mi的方波表示的比特,包括:如果所述脉冲宽度Mi不等于周期T1的一半,也不等于周期T0的一半,判断所述脉冲宽度Mi是否在预先获取的周期T1或周期T0的一半的误差范围内,如果所述脉冲宽度Mi在周期T1的一半的误差范围内,则确定脉冲宽度Mi对应的方波表示比特1,如果所述脉冲宽度Mi在周期T0的一半的误差范围内,则确定脉冲宽度Mi对应的方波表示比特0。Wherein, according to the comparison result, determining the bit of the square wave representation of the pulse width Mi comprises: if the pulse width Mi is not equal to half of the period T1, nor equal to half of the period T0, determining whether the pulse width Mi is Within the error range of the pre-acquired period T1 or half of the period T0, if the pulse width Mi is within the error range of half of the period T1, it is determined that the square wave corresponding to the pulse width Mi represents the bit 1 if the pulse width Mi Within the error range of half of the period T0, it is determined that the square wave corresponding to the pulse width Mi represents bit 0.
本发明第二方面提出的一种解析波形的方法,包括:接收正弦波波形,其中所述正弦波波形包括a个周期为Ta的用于表示比特0的正弦波和b个周期为Tb的用于表示比特1的正弦波,其中,周期Ta和周期Tb不相等,a和b为正整数;对所述正弦波波形进行采 样,得到方波波形;获取所述方波波形中第i个上升沿与第i+1个上升沿之间的脉冲宽度Mi,或者,获取所述方波波形中第i个下降沿与第i+1个下降沿之间的脉冲宽度Ni,其中i为小于或等于a和b的总和的正整数;将得到的每个脉冲宽度分别与预先获取的周期T1和预先获取的周期T0进行比较,得到比较结果;根据比较结果,确定每个脉冲宽度对应的方波表示的比特;其中,根据比较结果,确定每个脉冲宽度对应的方波表示的比特,包括:如果所述脉冲宽度Mi等于周期T1,则脉冲宽度Mi对应的方波表示比特1;如果所述脉冲宽度Mi等于周期T0,则脉冲宽度Mi对应的方波表示比特0。A method for analyzing a waveform according to a second aspect of the present invention includes: receiving a sine wave waveform, wherein the sine wave waveform includes a sine wave for indicating bit 0 and b periods of Tb for period Ta a sine wave representing bit 1, wherein period Ta and period Tb are not equal, a and b are positive integers; and the sine wave waveform is taken Obtaining a square wave waveform; acquiring a pulse width Mi between the i-th rising edge and the i+1th rising edge of the square wave waveform, or acquiring the i-th falling edge and the first wave of the square wave waveform a pulse width Ni between i+1 falling edges, where i is a positive integer less than or equal to the sum of a and b; each pulse width obtained is compared with a pre-acquired period T1 and a pre-acquired period T0 And obtaining a comparison result; determining, according to the comparison result, a bit represented by a square wave corresponding to each pulse width; wherein, according to the comparison result, determining a bit of the square wave corresponding to each pulse width, including: if the pulse width Mi is equal to In the period T1, the square wave corresponding to the pulse width Mi represents the bit 1; if the pulse width Mi is equal to the period T0, the square wave corresponding to the pulse width Mi represents the bit 0.
其中,所述根据比较结果,确定每个脉冲宽度对应的方波表示的比特,包括:如果得到的某一个脉冲宽度不等于周期T1,也不等于周期T0,判断所述某一个脉冲宽度否在预先获取的周期T1或周期T0的误差范围内,如果所述某一脉冲宽度Mi在周期T1的误差范围内,则确定所述某一个脉冲宽度对应的方波表示比特1,如果所述某一脉冲宽度Mi在周期T0的误差范围内,则确定所述某一个脉冲宽度Mi对应的方波表示比特0。The determining, according to the comparison result, the bit represented by the square wave corresponding to each pulse width, includes: if a certain pulse width is not equal to the period T1 or the period T0, determining whether the certain pulse width is In the error range of the pre-acquisition period T1 or the period T0, if the certain pulse width Mi is within the error range of the period T1, it is determined that the square wave corresponding to the certain pulse width represents the bit 1, if the certain one The pulse width Mi is within the error range of the period T0, and it is determined that the square wave corresponding to the certain pulse width Mi represents the bit 0.
其中,在获取脉冲宽度Mi或脉冲宽度Ni之后,在将得到的每个脉冲宽度分别与预先获取的周期T1和预先获取的周期T0进行比较之前,所述方法还包括:判断脉冲宽度Mi和脉冲宽度Ni是否在所述周期T0和所述周期T1之间;如果脉冲宽度Mi在所述周期T0与所述周期T1之间,则将脉冲宽度Ni作为与周期T1和周期T0进行比较时所使用的脉冲宽度;如果脉冲宽度Ni在所述周期T0与周期T1之间,则将脉冲宽度Mi作为与周期T1和周期T0进行比较时所使用的脉冲宽度。Wherein, after acquiring the pulse width Mi or the pulse width Ni, before comparing each of the obtained pulse widths with the pre-acquired period T1 and the pre-acquired period T0, the method further comprises: determining the pulse width Mi and the pulse Whether the width Ni is between the period T0 and the period T1; if the pulse width Mi is between the period T0 and the period T1, the pulse width Ni is used as compared with the period T1 and the period T0 If the pulse width Ni is between the period T0 and the period T1, the pulse width Mi is taken as the pulse width used when comparing the period T1 and the period T0.
本发明第三方面提出的一种解析波形的装置,包括:接收模块,用于接收正弦波波形,其中所述正弦波波形包括a个周期为Ta的用于表示比特0的正弦波和b个周期为Tb的用于表示比特1的正弦波,其中,周期Ta和周期Tb不相等,a和b为正整数;采样模块,用于对所述正弦波波形进行采样,得到方波波形;获取模块,用于获取所述方波波形中第i个上升沿与第i个下降沿之间的脉冲宽度Mi,其中i为小于或等于a和b的总和的正整数;比较模块,用于将脉冲宽度Mi与预先获取的周期T1的一半和预先获取的周期T0的一半进行比较,得到比较结果;确定模块,用于根据比较结果,确定脉冲宽度Mi对应的方波表示的比特;其中,所述确定模块用于如果所述脉冲宽度Mi等于周期T1的一半,则脉冲宽度Mi对应的方波表示比特1;如果所述脉冲宽度Mi等于周期T0的一半,则脉冲宽度Mi对应的方波表示比特0。An apparatus for analyzing a waveform according to a third aspect of the present invention includes: a receiving module, configured to receive a sine wave waveform, wherein the sine wave waveform includes a sine wave and a plurality of periods Ta representing a bit 0 a sine wave representing a bit 1 of a period Tb, wherein the period Ta and the period Tb are not equal, a and b are positive integers; a sampling module for sampling the sine wave waveform to obtain a square wave waveform; a module for acquiring a pulse width Mi between an i-th rising edge and an i-th falling edge of the square wave waveform, wherein i is a positive integer less than or equal to a sum of a and b; a comparison module, configured to The pulse width Mi is compared with half of the pre-acquired period T1 and half of the pre-acquired period T0 to obtain a comparison result; and a determining module is configured to determine a bit represented by the square wave corresponding to the pulse width Mi according to the comparison result; The determining module is configured to: if the pulse width Mi is equal to half of the period T1, the square wave corresponding to the pulse width Mi represents bit 1; if the pulse width Mi is equal to half of the period T0, the pulse width Mi is Bit 0 represents the square wave.
其中,所述确定模块,包括:判断单元,用于如果所述脉冲宽度Mi不等于周期T1的一半,也不等于周期T0的一半,判断所述脉冲宽度Mi是否在预先获取的周期T1或周期T0的一半的误差范围内;确定单元,用于如果所述脉冲宽度Mi在周期T1的一半的误差范围内,则确定脉冲宽度Mi对应的方波表示比特1,如果所述脉冲宽度Mi在周期T0的一半 的误差范围内,则确定脉冲宽度Mi对应的方波表示比特0。The determining module includes: a determining unit, configured to determine whether the pulse width Mi is in a pre-acquisition period T1 or a period if the pulse width Mi is not equal to half of the period T1 or half of the period T0. a half of the error range of T0; a determining unit for determining that the square wave corresponding to the pulse width Mi represents bit 1 if the pulse width Mi is within an error range of half of the period T1, if the pulse width Mi is in a period Half of T0 Within the error range, it is determined that the square wave corresponding to the pulse width Mi represents bit 0.
本发明第四方面提出的一种解析波形的装置,包括:接收模块,用于接收正弦波波形,其中所述正弦波波形包括a个周期为Ta的用于表示比特0的正弦波和b个周期为Tb的用于表示比特1的正弦波,其中,周期Ta和周期Tb不相等,a和b为正整数;采样模块,用于对所述正弦波波形进行采样,得到方波波形;获取模块,用于获取所述方波波形中第i个上升沿与第i+1个上升沿之间的脉冲宽度Mi,或者,获取所述方波波形中第i个下降沿与第i+1个下降沿之间的脉冲宽度Ni,其中i为小于或等于a和b的总和的正整数;比较模块,用于将得到的每个脉冲宽度分别与预先获取的周期T1和预先获取的周期T0进行比较,得到比较结果;确定模块,用于根据比较结果,确定每个脉冲宽度对应的方波表示的比特;其中,所述确定模块用于如果所述脉冲宽度Mi等于周期T1,则脉冲宽度Mi对应的方波表示比特1;如果所述脉冲宽度Mi等于周期T0,则脉冲宽度Mi对应的方波表示比特0。An apparatus for analyzing a waveform according to a fourth aspect of the present invention includes: a receiving module, configured to receive a sine wave waveform, wherein the sine wave waveform includes a sine wave and a plurality of periods Ta representing a bit 0 a sine wave representing a bit 1 of a period Tb, wherein the period Ta and the period Tb are not equal, a and b are positive integers; a sampling module for sampling the sine wave waveform to obtain a square wave waveform; a module, configured to acquire a pulse width Mi between an i th rising edge and an i+1 th rising edge of the square wave waveform, or obtain an i th falling edge and an i+1 in the square wave waveform a pulse width Ni between the falling edges, where i is a positive integer less than or equal to the sum of a and b; a comparison module for respectively obtaining each pulse width obtained with the pre-acquired period T1 and the pre-acquired period T0 Comparing, obtaining a comparison result; determining a module, configured to determine, according to the comparison result, a bit of a square wave representation corresponding to each pulse width; wherein the determining module is configured to: if the pulse width Mi is equal to the period T1, the pulse width Mi corresponds 1 represents a bit square wave; and if the pulse width is equal to Mi cycle T0, the pulse width of the square wave corresponding to Mi represents 0 bits.
其中,所述确定模块包括:判断单元,用于如果得到的某一个脉冲宽度不等于周期T1,也不等于周期T0,判断所述某一个脉冲宽度否在预先获取的周期T1或周期T0的误差范围内;确定单元,用于如果所述某一脉冲宽度Mi在周期T1的误差范围内,则确定所述某一个脉冲宽度对应的方波表示比特1,如果所述某一脉冲宽度Mi在周期T0的误差范围内,则确定所述某一个脉冲宽度Mi对应的方波表示比特0。The determining module includes: a determining unit, configured to determine whether the pulse width is not equal to the period T1 or the period T0, and determine whether the pulse width is in the pre-acquired period T1 or the period T0. a determining unit, configured to determine, if the certain pulse width Mi is within an error range of the period T1, determining a square wave corresponding to the one pulse width to represent the bit 1 if the certain pulse width Mi is in a period Within the error range of T0, it is determined that the square wave corresponding to the certain pulse width Mi represents bit 0.
其中,所述装置还包括:判断模块,用于在获取脉冲宽度Mi或脉冲宽度Ni之后,在将得到的每个脉冲宽度分别与预先获取的周期T1和预先获取的周期T0进行比较之前,判断脉冲宽度Mi和脉冲宽度Ni是否在所述周期T0和所述周期T1之间;选择模块,用于如果脉冲宽度Mi在所述周期T0与所述周期T1之间,则将脉冲宽度Ni作为与周期T1和周期T0进行比较时所使用的脉冲宽度;如果脉冲宽度Ni在所述周期T0与周期T1之间,则将脉冲宽度Mi作为与周期T1和周期T0进行比较时所使用的脉冲宽度。The device further includes: a determining module, configured to determine, after acquiring the pulse width Mi or the pulse width Ni, each pulse width obtained before comparing with the pre-acquired period T1 and the pre-acquired period T0 Whether the pulse width Mi and the pulse width Ni are between the period T0 and the period T1; and a selection module for using the pulse width Ni as the pulse width Mi between the period T0 and the period T1 The pulse width used when comparing the period T1 and the period T0; if the pulse width Ni is between the period T0 and the period T1, the pulse width Mi is used as the pulse width used when comparing the period T1 and the period T0.
本发明第五方面提出的一种存储介质,包括:用于存储应用程序,所述应用程序用于执行本发明第一方面所述的解析波形的方法。A storage medium according to a fifth aspect of the present invention, comprising: a method for storing an application for performing the method of analyzing a waveform according to the first aspect of the present invention.
本发明第六方面提出的一种存储介质,包括:用于存储应用程序,所述应用程序用于执行本发明第二方面所述的解析波形的方法。A storage medium according to a sixth aspect of the present invention, comprising: a method for storing an application for performing the method of analyzing a waveform according to the second aspect of the present invention.
本发明提供的方法实施例,在通过传输不同周期的波形来表示比特0和1时,通过获取方波波形的脉冲宽度来确定方波表示的比特,实现对波形的解析。According to the method embodiment provided by the present invention, when bits 0 and 1 are represented by transmitting waveforms of different periods, the bits represented by the square wave are determined by acquiring the pulse width of the square wave waveform, thereby realizing the analysis of the waveform.
附图说明DRAWINGS
为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附 图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following description of the embodiments is required. BRIEF DESCRIPTION OF THE DRAWINGS The drawings in the following description are merely illustrative of some embodiments of the present invention and may be obtained by those of ordinary skill in the art Other drawings.
图1为本发明提供一种解析波形的方法实施例的流程示意图;1 is a schematic flow chart of an embodiment of a method for analyzing a waveform according to the present invention;
图2为本发明实施例一中确定比特的方法示意图;2 is a schematic diagram of a method for determining a bit according to Embodiment 1 of the present invention;
图3为本发明提供另一种解析波形的方法实施例的流程示意图;3 is a schematic flow chart of another embodiment of a method for analyzing a waveform according to the present invention;
图4为本发明实施例二中确定比特的方法示意图;4 is a schematic diagram of a method for determining a bit according to Embodiment 2 of the present invention;
图5为本发明提供一种解析波形的装置实施例的结构示意图;FIG. 5 is a schematic structural diagram of an apparatus for analyzing waveforms according to the present invention; FIG.
图6为本发明提供另一种解析波形的装置实施例的结构示意图。FIG. 6 is a schematic structural diagram of another embodiment of an apparatus for analyzing waveforms according to the present invention.
具体实施方式detailed description
下面结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明的保护范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
下面将结合附图对本发明实施例作进一步地详细描述。The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
实施例一Embodiment 1
图1为本发明提供一种解析波形的方法实施例的流程示意图。图1所示方法实施例包括:FIG. 1 is a schematic flow chart of an embodiment of a method for analyzing a waveform according to the present invention. The method embodiment shown in Figure 1 includes:
步骤101、接收正弦波波形,其中所述正弦波波形包括a个周期为Ta的用于表示比特0的正弦波和b个周期为Tb的用于表示比特1的正弦波,其中,周期Ta和周期Tb不相等,a和b为正整数。Step 101: Receive a sine wave waveform, wherein the sine wave waveform includes a sine wave for indicating bit 0 and a sine wave for indicating bit 1 with period B being Ta, wherein period Ta and The periods Tb are not equal, and a and b are positive integers.
其中,该正弦波波形是移动终端通过音频接口发送的,智能密钥设备通过音频接口与移动终端相连,实现接收该正弦波波形的目的。该正弦波波形包括两个不同周期的正弦波,分别来表示比特1和比特0。The sinusoidal waveform is sent by the mobile terminal through the audio interface, and the smart key device is connected to the mobile terminal through the audio interface to achieve the purpose of receiving the sine wave waveform. The sine wave waveform includes two sine waves of different periods, representing bit 1 and bit 0, respectively.
步骤102、对所述正弦波波形进行采样,得到方波波形。Step 102: Sampling the sine wave waveform to obtain a square wave waveform.
其中,智能密钥设备按照本地的采样周期对接收到的正弦波波形进行采样,根据采样点位置的采样结果,得到方波波形。The smart key device samples the received sinusoidal waveform according to a local sampling period, and obtains a square wave waveform according to the sampling result of the sampling point position.
步骤103、获取所述方波波形中第i个上升沿与第i个下降沿之间的脉冲宽度Mi,其中i≤a+b,且i为正整数。Step 103: Acquire a pulse width Mi between the i-th rising edge and the i-th falling edge of the square wave waveform, where i≤a+b, and i is a positive integer.
其中,上升沿和下降沿的检测可以通过电平变化来检测,其脉冲宽度可以根据波形所使用的时钟来确定,而第i个上升沿与第i个下降沿之间的脉冲宽度Mi表示一个方波周期 的一半。此步骤,可以获取到个数为a和b的总和的脉冲宽度。Wherein, the detection of the rising edge and the falling edge can be detected by a level change, the pulse width of which can be determined according to the clock used by the waveform, and the pulse width Mi between the i-th rising edge and the i-th falling edge represents one Square wave period Half of it. In this step, the pulse width of the sum of a and b can be obtained.
步骤104、将脉冲宽度Mi与预先获取的周期T1的一半和预先获取的周期T0的一半进行比较,得到比较结果;Step 104: Comparing the pulse width Mi with half of the pre-acquired period T1 and half of the pre-acquired period T0 to obtain a comparison result;
其中,周期T0和周期T1是通过如下方式获取的:The period T0 and the period T1 are obtained as follows:
其中所述方波波形依次包括测试数据的波形和有效数据的波形,其中测试数据的波形所表示的比特顺序是预先协商的,智能密钥设备可以根据该比特顺序,获取测试数据的波形中比特0和比特1对应的周期,再根据测试数据中比特0和比特1对应的周期,得到所述方波波形中比特0和比特1对应的周期。The square wave waveform sequentially includes a waveform of the test data and a waveform of the valid data, wherein the bit sequence represented by the waveform of the test data is pre-negotiated, and the smart key device can acquire the bit in the waveform of the test data according to the bit sequence. A period corresponding to 0 and bit 1 is further obtained according to a period corresponding to bit 0 and bit 1 in the test data, and a period corresponding to bit 0 and bit 1 in the square wave waveform is obtained.
步骤105、根据比较结果,确定脉冲宽度Mi对应的方波表示的比特。Step 105: Determine, according to the comparison result, a bit represented by a square wave corresponding to the pulse width Mi.
图2为本发明实施例一中确定比特的方法示意图。图2所示流程包括:FIG. 2 is a schematic diagram of a method for determining a bit according to Embodiment 1 of the present invention. The process shown in Figure 2 includes:
步骤1051、判断所述脉冲宽度Mi是否等于周期T1的一半或周期T0的一半; Step 1051, determining whether the pulse width Mi is equal to half of the period T1 or half of the period T0;
如果所述脉冲宽度Mi等于周期T1的一半和周期T0的一半中的一个,则执行步骤1052和步骤1053;If the pulse width Mi is equal to one of the half of the period T1 and the half of the period T0, then step 1052 and step 1053 are performed;
步骤1052、如果所述脉冲宽度Mi等于周期T1的一半,则脉冲宽度Mi对应的方波表示比特1; Step 1052, if the pulse width Mi is equal to half of the period T1, the square wave corresponding to the pulse width Mi represents bit 1;
步骤1053、如果所述脉冲宽度Mi等于周期T0的一半,则脉冲宽度Mi对应的方波表示比特0。Step 1053: If the pulse width Mi is equal to half of the period T0, the square wave corresponding to the pulse width Mi represents bit 0.
步骤1054、如果所述脉冲宽度Mi不等于周期T1的一半,也不等于周期T0的一半,判断所述脉冲宽度Mi是否在预先获取的周期T1或周期T0的一半的误差范围内; Step 1054, if the pulse width Mi is not equal to half of the period T1 and is not equal to half of the period T0, it is determined whether the pulse width Mi is within an error range of a pre-acquired period T1 or a half of the period T0;
步骤1055、如果所述脉冲宽度Mi在周期T1的一半的误差范围内,则确定脉冲宽度Mi对应的方波表示比特1; Step 1055, if the pulse width Mi is within the error range of one half of the period T1, it is determined that the square wave corresponding to the pulse width Mi represents the bit 1;
步骤1056、如果所述脉冲宽度Mi在周期T0的一半的误差范围内,则确定脉冲宽度Mi对应的方波表示比特0。 Step 1056, if the pulse width Mi is within an error range of half of the period T0, it is determined that the square wave corresponding to the pulse width Mi represents bit 0.
其中,该误差范围是由传输时延等操作造成的。在脉冲宽度Mi不等于T0和T1的任意一个值时,通过判断该脉冲宽度是否在允许的误差范围内,可以有效的解析方波波形表示的比特,保证方波的完整解析。The error range is caused by operations such as transmission delay. When the pulse width Mi is not equal to any one of T0 and T1, by judging whether the pulse width is within the allowable error range, the bit represented by the square wave waveform can be effectively analyzed to ensure complete analysis of the square wave.
本发明提供的方法实施例,在通过传输不同周期的波形来表示比特0和1时,通过获取第i个上升沿与第i个下降沿之间的脉冲宽度Mi来确定方波表示的比特,实现对波形的解析。The method embodiment provided by the present invention determines the bit represented by the square wave by acquiring the pulse width Mi between the i-th rising edge and the i-th falling edge when the bits 0 and 1 are represented by transmitting waveforms of different periods. Achieve the analysis of the waveform.
实施例二Embodiment 2
图3为本发明提供另一种解析波形的方法实施例的流程示意图。图3所示方法实施例 包括:FIG. 3 is a schematic flow chart of another embodiment of a method for analyzing waveforms according to the present invention. Method embodiment shown in FIG. include:
步骤201和步骤202与步骤101和步骤102相同,此处不再赘述。 Steps 201 and 202 are the same as steps 101 and 102, and are not described here.
步骤203、获取所述方波波形中第i个上升沿与第i+1个上升沿之间的脉冲宽度Mi,或者,获取所述方波波形中第i个下降沿与第i+1个下降沿之间的脉冲宽度Ni,其中i≤a+b,且i为正整数;Step 203: Acquire a pulse width Mi between the i-th rising edge and the i+1th rising edge of the square wave waveform, or obtain an i-th falling edge and an i+1th of the square wave waveform. a pulse width Ni between falling edges, where i ≤ a + b, and i is a positive integer;
其中,相邻的两个上升沿之间的脉冲宽度或相邻的两个下降沿之间的脉冲宽度表示一个方波周期。此步骤,可以获取到个数为a和b的总和的脉冲宽度。其中选择上升沿或下降沿取决于该方波波形的第一个周期的起始位置的电平,如果第一个周期的起始位置的电平为上升沿,则获取相邻的两个上升沿之间的脉冲宽度,如果第一个周期的起始位置的电平为下降沿,则获取相邻的两个下降沿之间的脉冲宽度。Wherein, the pulse width between two adjacent rising edges or the pulse width between two adjacent falling edges represents a square wave period. In this step, the pulse width of the sum of a and b can be obtained. The selection of the rising edge or the falling edge depends on the level of the starting position of the first period of the square wave waveform, and if the level of the starting position of the first period is the rising edge, the two adjacent rising edges are acquired. The pulse width between the edges, if the level of the start position of the first cycle is a falling edge, the pulse width between the adjacent two falling edges is acquired.
步骤204、将得到的每个脉冲宽度分别与预先获取的周期T1和预先获取的周期T0进行比较,得到比较结果。Step 204: Compare each obtained pulse width with a pre-acquired period T1 and a pre-acquired period T0 to obtain a comparison result.
其中,周期T0和周期T1是通过如下方式获取的:The period T0 and the period T1 are obtained as follows:
其中所述方波波形依次包括测试数据的波形和有效数据的波形,其中测试数据的波形所表示的比特顺序是预先协商的,智能密钥设备可以根据该比特顺序,获取测试数据的波形中比特0和比特1对应的周期,再根据测试数据中比特0和比特1对应的周期,得到所述方波波形中比特0和比特1对应的周期。The square wave waveform sequentially includes a waveform of the test data and a waveform of the valid data, wherein the bit sequence represented by the waveform of the test data is pre-negotiated, and the smart key device can acquire the bit in the waveform of the test data according to the bit sequence. A period corresponding to 0 and bit 1 is further obtained according to a period corresponding to bit 0 and bit 1 in the test data, and a period corresponding to bit 0 and bit 1 in the square wave waveform is obtained.
步骤205、根据比较结果,确定每个脉冲宽度对应的方波表示的比特。Step 205: Determine, according to the comparison result, a bit represented by a square wave corresponding to each pulse width.
图4为本发明实施例二中确定比特的方法示意图。图4所示流程包括:FIG. 4 is a schematic diagram of a method for determining a bit according to Embodiment 2 of the present invention. The process shown in Figure 4 includes:
步骤2051、判断所述脉冲宽度Mi是否等于周期T1的一半或周期T0的一半; Step 2051, determining whether the pulse width Mi is equal to half of the period T1 or half of the period T0;
如果所述脉冲宽度Mi等于周期T1的一半和周期T0的一半中的一个,则执行步骤2052和步骤2053;If the pulse width Mi is equal to one of the half of the period T1 and one half of the period T0, then step 2052 and step 2053 are performed;
步骤2052、如果所述脉冲宽度Mi等于周期T1,则脉冲宽度Mi对应的方波表示比特1; Step 2052, if the pulse width Mi is equal to the period T1, the square wave corresponding to the pulse width Mi represents the bit 1;
步骤2053、如果所述脉冲宽度Mi等于周期T0,则脉冲宽度Mi对应的方波表示比特0。 Step 2053, if the pulse width Mi is equal to the period T0, the square wave corresponding to the pulse width Mi represents bit 0.
步骤2054、某一个脉冲宽度不等于周期T1,也不等于周期T0,判断所述某一个脉冲宽度否在预先获取的周期T1或周期T0的误差范围内; Step 2054, a certain pulse width is not equal to the period T1, and is not equal to the period T0, and it is determined whether the certain pulse width is within the error range of the pre-acquired period T1 or the period T0;
步骤2055、如果所述某一脉冲宽度Mi在周期T1的误差范围内,则确定所述某一个脉冲宽度对应的方波表示比特1; Step 2055, if the certain pulse width Mi is within the error range of the period T1, it is determined that the square wave corresponding to the certain pulse width represents the bit 1;
步骤2056、如果所述某一脉冲宽度Mi在周期T0的误差范围内,则确定所述某一个脉冲宽度Mi对应的方波表示比特0。 Step 2056, if the certain pulse width Mi is within the error range of the period T0, it is determined that the square wave corresponding to the certain pulse width Mi represents the bit 0.
其中,该误差范围是由传输时延等操作造成的。在脉冲宽度Mi不等于T0和T1的任意一个值时,通过判断该脉冲宽度是否在允许的误差范围内,可以有效的解析方波波形表示 的比特,保证方波的完整解析。The error range is caused by operations such as transmission delay. When the pulse width Mi is not equal to any one of T0 and T1, the square wave waveform representation can be effectively resolved by judging whether the pulse width is within the allowable error range. The bit ensures the complete resolution of the square wave.
可选的,在获取脉冲宽度Mi或脉冲宽度Ni之后,在将得到的每个脉冲宽度分别与预先获取的周期T1和预先获取的周期T0进行比较之前,所述方法还包括:Optionally, after the pulse width Mi or the pulse width Ni is obtained, before each pulse width obtained is compared with the pre-acquired period T1 and the pre-acquired period T0, the method further includes:
判断脉冲宽度Mi和脉冲宽度Ni是否在所述周期T0和所述周期T1之间;Determining whether the pulse width Mi and the pulse width Ni are between the period T0 and the period T1;
如果脉冲宽度Mi在所述周期T0与所述周期T1之间,则将脉冲宽度Ni作为与周期T1和周期T0进行比较时所使用的脉冲宽度;如果脉冲宽度Ni在所述周期T0与周期T1之间,则将脉冲宽度Mi作为与周期T1和周期T0进行比较时所使用的脉冲宽度。If the pulse width Mi is between the period T0 and the period T1, the pulse width Ni is taken as the pulse width used when comparing the period T1 and the period T0; if the pulse width Ni is in the period T0 and the period T1 In between, the pulse width Mi is taken as the pulse width used when comparing the period T1 and the period T0.
为进一步精确的确定所使用的脉冲宽度,通过判断该脉冲宽度是否在该两个数值内,来排除错误的脉冲宽度,从而得到如何正确获取一个方波周期,提高解码精度。In order to further accurately determine the pulse width used, the error pulse width is eliminated by judging whether the pulse width is within the two values, thereby obtaining how to correctly acquire a square wave period and improving the decoding precision.
本发明提供的方法实施例,在通过传输不同周期的波形来表示比特0和1时,通过获取一个方波周期的脉冲宽度来确定方波表示的比特,实现对波形的解析。与实施例一不同的是,本实施例是以一个周期的脉冲宽度来获取方波波形表示的比特,与半个周期的脉冲宽度来获取方波波形表示的比特,确定的比特更加准确。The method provided by the present invention realizes the analysis of the waveform by determining the bit width of the square wave period by acquiring the pulse width of one square wave period when the bits 0 and 1 are represented by transmitting waveforms of different periods. Different from the first embodiment, in this embodiment, the bit represented by the square wave waveform is acquired by the pulse width of one cycle, and the bit width of the square wave waveform is acquired with the pulse width of one half cycle, and the determined bit is more accurate.
实施例三Embodiment 3
图5为本发明提供的一种解析波形的装置实施例的结构示意图。图5所示实施例包括:FIG. 5 is a schematic structural diagram of an apparatus for analyzing waveforms according to the present invention. The embodiment shown in Figure 5 includes:
接收模块301,用于接收正弦波波形,其中所述正弦波波形包括a个周期为Ta的用于表示比特0的正弦波和b个周期为Tb的用于表示比特1的正弦波,其中,周期Ta和周期Tb不相等,a和b为正整数;The receiving module 301 is configured to receive a sine wave waveform, where the sine wave waveform includes a sine wave for indicating bit 0 and a sine wave for indicating bit 1 with period B being Ta, wherein The period Ta and the period Tb are not equal, and a and b are positive integers;
采样模块302,与接收模块301相连,用于对所述正弦波波形进行采样,得到方波波形;The sampling module 302 is connected to the receiving module 301, and is configured to sample the sine wave waveform to obtain a square wave waveform;
获取模块303,与采样模块302相连,用于获取所述方波波形中第i个上升沿与第i个下降沿之间的脉冲宽度Mi,其中i≤a+b,且i为正整数;The obtaining module 303 is connected to the sampling module 302, and configured to acquire a pulse width Mi between the i-th rising edge and the i-th falling edge of the square wave waveform, where i≤a+b, and i is a positive integer;
比较模块304,与获取模块303相连,用于将脉冲宽度Mi与预先获取的周期T1的一半和预先获取的周期T0的一半进行比较,得到比较结果;The comparison module 304 is connected to the acquisition module 303 for comparing the pulse width Mi with half of the pre-acquired period T1 and half of the pre-acquired period T0 to obtain a comparison result;
确定模块305,与比较模块304相连,用于根据比较结果,确定脉冲宽度Mi对应的方波表示的比特;The determining module 305 is connected to the comparing module 304, and configured to determine, according to the comparison result, a bit represented by a square wave corresponding to the pulse width Mi;
其中,所述确定模块用于如果所述脉冲宽度Mi等于周期T1的一半,则脉冲宽度Mi对应的方波表示比特1;如果所述脉冲宽度Mi等于周期T0的一半,则脉冲宽度Mi对应的方波表示比特0。Wherein the determining module is configured to: if the pulse width Mi is equal to half of the period T1, the square wave corresponding to the pulse width Mi represents the bit 1; if the pulse width Mi is equal to half of the period T0, the pulse width Mi corresponds to The square wave represents bit 0.
其中,所述确定模块305包括:The determining module 305 includes:
判断单元,用于如果所述脉冲宽度Mi不等于周期T1的一半,也不等于周期T0的一半,判断所述脉冲宽度Mi是否在预先获取的周期T1或周期T0的一半的误差范围内; a judging unit, configured to determine whether the pulse width Mi is within an error range of a pre-acquired period T1 or a half of the period T0 if the pulse width Mi is not equal to half of the period T1 or equal to half of the period T0;
确定单元,用于如果所述脉冲宽度Mi在周期T1的一半的误差范围内,则确定脉冲宽度Mi对应的方波表示比特1,如果所述脉冲宽度Mi在周期T0的一半的误差范围内,则确定脉冲宽度Mi对应的方波表示比特0。Determining unit for determining that the square wave corresponding to the pulse width Mi represents bit 1 if the pulse width Mi is within an error range of one half of the period T1, and if the pulse width Mi is within an error range of half of the period T0, Then, it is determined that the square wave corresponding to the pulse width Mi represents bit 0.
当然,上述模块划分只是一种示意划分,本发明并不局限于此。该智能密钥设备还可以仅包括:接收模块、采集模块、获取模块、比较模块和确定模块,接收模块执行与接收相关的功能,采集模块执行与采集相关的功能,获取模块执行与获取数据等相关的功能,比较模块执行与比较相关的功能和确定模块执行与确定相关的功能,只要能实现本发明的目的的模块划分,均应属于本发明的保护范围。Of course, the above module division is only a schematic division, and the present invention is not limited thereto. The smart key device may further include: a receiving module, an acquiring module, an obtaining module, a comparing module, and a determining module, the receiving module performing a function related to receiving, the collecting module performing a function related to the collecting, acquiring the module performing and acquiring data, etc. Related functions, the comparison module performs the functions related to the comparison and the functions related to the determination module execution and determination, as long as the module division capable of achieving the object of the present invention falls within the scope of protection of the present invention.
本发明提供的方法实施例,在通过传输不同周期的波形来表示比特0和1时,通过获取第i个上升沿与第i个下降沿之间的脉冲宽度Mi来确定方波表示的比特,实现对波形的解析。The method embodiment provided by the present invention determines the bit represented by the square wave by acquiring the pulse width Mi between the i-th rising edge and the i-th falling edge when the bits 0 and 1 are represented by transmitting waveforms of different periods. Achieve the analysis of the waveform.
实施例四Embodiment 4
图6为本发明提供的另一种解析波形的装置实施例的结构示意图。图6所示实施例包括:FIG. 6 is a schematic structural diagram of another apparatus for analyzing waveforms according to the present invention. The embodiment shown in Figure 6 includes:
接收模块401,用于接收正弦波波形,其中所述正弦波波形包括a个周期为Ta的用于表示比特0的正弦波和b个周期为Tb的用于表示比特1的正弦波,其中,周期Ta和周期Tb不相等,a和b为正整数;The receiving module 401 is configured to receive a sine wave waveform, where the sine wave waveform includes a sine wave for indicating bit 0 and a sine wave for indicating bit 1 with period B being Ta, where The period Ta and the period Tb are not equal, and a and b are positive integers;
采样模块402,用于对所述正弦波波形进行采样,得到方波波形;a sampling module 402, configured to sample the sine wave waveform to obtain a square wave waveform;
获取模块403,用于获取所述方波波形中第i个上升沿与第i+1个上升沿之间的脉冲宽度Mi,或者,获取所述方波波形中第i个下降沿与第i+1个下降沿之间的脉冲宽度Ni,其中i≤a+b,且i为正整数;The obtaining module 403 is configured to acquire a pulse width Mi between the i-th rising edge and the i+1th rising edge of the square wave waveform, or obtain an i-th falling edge and an ith of the square wave waveform a pulse width Ni between +1 falling edges, where i ≤ a+b, and i is a positive integer;
比较模块404,用于将得到的每个脉冲宽度分别与预先获取的周期T1和预先获取的周期T0进行比较,得到比较结果;The comparison module 404 is configured to compare each of the obtained pulse widths with the pre-acquired period T1 and the pre-acquired period T0 to obtain a comparison result;
确定模块405,用于根据比较结果,确定每个脉冲宽度对应的方波表示的比特。The determining module 405 is configured to determine, according to the comparison result, a bit of the square wave representation corresponding to each pulse width.
其中,所述确定模块405包括:The determining module 405 includes:
判断单元,用于如果得到的某一个脉冲宽度不等于周期T1,也不等于周期T0,判断所述某一个脉冲宽度否在预先获取的周期T1或周期T0的误差范围内;a determining unit, configured to determine whether the one pulse width is within an error range of the pre-acquired period T1 or the period T0 if the obtained one pulse width is not equal to the period T1 or the period T0;
确定单元,用于如果所述某一脉冲宽度Mi在周期T1的误差范围内,则确定所述某一个脉冲宽度对应的方波表示比特1,如果所述某一脉冲宽度Mi在周期T0的误差范围内,则确定所述某一个脉冲宽度Mi对应的方波表示比特0;Determining a unit, if the certain pulse width Mi is within the error range of the period T1, determining that the square wave corresponding to the certain pulse width represents the bit 1 if the error of the certain pulse width Mi is in the period T0 Within the range, determining that the square wave corresponding to the certain pulse width Mi represents bit 0;
其中,所述确定模块用于如果所述脉冲宽度Mi等于周期T1,则脉冲宽度Mi对应的方 波表示比特1;如果所述脉冲宽度Mi等于周期T0,则脉冲宽度Mi对应的方波表示比特0。Wherein the determining module is configured to: if the pulse width Mi is equal to the period T1, the square corresponding to the pulse width Mi The wave represents bit 1; if the pulse width Mi is equal to the period T0, the square wave corresponding to the pulse width Mi represents bit 0.
其中,所述装置还包括:Wherein, the device further comprises:
判断模块,与所述用于在获取脉冲宽度Mi或脉冲宽度Ni之后,在将得到的每个脉冲宽度分别与预先获取的周期T1和预先获取的周期T0进行比较之前,判断脉冲宽度Mi和脉冲宽度Ni是否在所述周期T0和所述周期T1之间;a judging module, configured to determine a pulse width Mi and a pulse before comparing each of the obtained pulse widths with the pre-acquired period T1 and the pre-acquired period T0 after acquiring the pulse width Mi or the pulse width Ni Whether the width Ni is between the period T0 and the period T1;
选择模块,用于如果脉冲宽度Mi在所述周期T0与所述周期T1之间,则将脉冲宽度Ni作为与周期T1和周期T0进行比较时所使用的脉冲宽度;如果脉冲宽度Ni在所述周期T0与周期T1之间,则将脉冲宽度Mi作为与周期T1和周期T0进行比较时所使用的脉冲宽度。a selection module for using a pulse width Ni as a pulse width used when compared with the period T1 and the period T0 if the pulse width Mi is between the period T0 and the period T1; if the pulse width Ni is in the Between the period T0 and the period T1, the pulse width Mi is used as the pulse width used when comparing the period T1 and the period T0.
当然,上述模块划分只是一种示意划分,本发明并不局限于此。该智能密钥设备还可以仅包括:接收模块、采集模块、获取模块、比较模块和确定模块,接收模块执行与接收相关的功能,采集模块执行与采集相关的功能,获取模块执行与获取数据等相关的功能,比较模块执行与比较相关的功能和确定模块执行与确定相关的功能,只要能实现本发明的目的的模块划分,均应属于本发明的保护范围。Of course, the above module division is only a schematic division, and the present invention is not limited thereto. The smart key device may further include: a receiving module, an acquiring module, an obtaining module, a comparing module, and a determining module, the receiving module performing a function related to receiving, the collecting module performing a function related to the collecting, acquiring the module performing and acquiring data, etc. Related functions, the comparison module performs the functions related to the comparison and the functions related to the determination module execution and determination, as long as the module division capable of achieving the object of the present invention falls within the scope of protection of the present invention.
本发明提供的方法实施例,在通过传输不同周期的波形来表示比特0和1时,通过获取一个方波周期的脉冲宽度来确定方波表示的比特,实现对波形的解析。与实施例三不同的是,本实施例是以一个周期的脉冲宽度来获取方波波形表示的比特,与半个周期的脉冲宽度来获取方波波形表示的比特,确定的比特更加准确。The method provided by the present invention realizes the analysis of the waveform by determining the bit width of the square wave period by acquiring the pulse width of one square wave period when the bits 0 and 1 are represented by transmitting waveforms of different periods. Different from the third embodiment, in this embodiment, the bit represented by the square wave waveform is acquired by the pulse width of one cycle, and the bit width of the square wave waveform is acquired with the pulse width of one half cycle, and the determined bit is more accurate.
实施例五Embodiment 5
本发明还提出了一种存储介质,包括:用于存储应用程序,应用程序用于执行上述实施例一所示的解析波形的方法。The present invention also provides a storage medium comprising: a method for storing an application for executing the parsed waveform shown in the first embodiment.
实施例六Embodiment 6
本发明又提出了一种存储介质,包括:用于存储应用程序,应用程序用于执行上述实施例二所示的解析波形的方法。The present invention further provides a storage medium, comprising: a method for storing an application for executing the parsing waveform shown in the second embodiment.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。Any process or method description in the flowcharts or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a particular logical function or process. And the scope of the preferred embodiments of the invention includes additional implementations, in which the functions may be performed in a substantially simultaneous manner or in an opposite order depending on the functions involved, in the order shown or discussed. It will be understood by those skilled in the art to which the embodiments of the present invention pertain.
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实 施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that portions of the invention may be implemented in hardware, software, firmware or a combination thereof. In the above In this manner, multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art can understand that all or part of the steps carried by the method of implementing the above embodiments can be completed by a program to instruct related hardware, and the program can be stored in a computer readable storage medium. When executed, one or a combination of the steps of the method embodiments is included.
此外,在本发明各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. The integrated modules, if implemented in the form of software functional modules and sold or used as stand-alone products, may also be stored in a computer readable storage medium.
上述提到的存储介质可以是只读存储器,磁盘或光盘等。The above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of the present specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means a specific feature described in connection with the embodiment or example. A structure, material or feature is included in at least one embodiment or example of the invention. In the present specification, the schematic representation of the above terms does not necessarily mean the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in a suitable manner in any one or more embodiments or examples.
尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在不脱离本发明的原理和宗旨的情况下在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。本发明的范围由所附权利要求及其等同限定。 Although the embodiments of the present invention have been shown and described, it is understood that the foregoing embodiments are illustrative and not restrictive Variations, modifications, alterations and variations of the above-described embodiments are possible within the scope of the invention. The scope of the invention is defined by the appended claims and their equivalents.

Claims (12)

  1. 一种解析波形的方法,其特征在于,包括:A method for analyzing a waveform, comprising:
    接收正弦波波形,其中所述正弦波波形包括a个周期为Ta的用于表示比特0的正弦波和b个周期为Tb的用于表示比特1的正弦波,其中,周期Ta和周期Tb不相等,a和b为正整数;Receiving a sinusoidal waveform, wherein the sinusoidal waveform includes a sine wave for indicating bit 0 and a period of sine for indicating bit 1 having a period of Ta, wherein period Ta and period Tb are not Equal, a and b are positive integers;
    对所述正弦波波形进行采样,得到方波波形;Sampling the sine wave waveform to obtain a square wave waveform;
    获取所述方波波形中第i个上升沿与第i个下降沿之间的脉冲宽度Mi,其中i≤a+b,且i为正整数;Obtaining a pulse width Mi between the i-th rising edge and the i-th falling edge of the square wave waveform, where i≤a+b, and i is a positive integer;
    将脉冲宽度Mi与预先获取的周期T1的一半和预先获取的周期T0的一半进行比较,得到比较结果;Comparing the pulse width Mi with half of the pre-acquired period T1 and half of the pre-acquired period T0 to obtain a comparison result;
    根据比较结果,确定脉冲宽度Mi对应的方波表示的比特;Determining, according to the comparison result, a bit represented by a square wave corresponding to the pulse width Mi;
    其中,根据比较结果,确定脉冲宽度Mi对应的方波表示的比特,包括:Wherein, according to the comparison result, the bit represented by the square wave corresponding to the pulse width Mi is determined, including:
    如果所述脉冲宽度Mi等于周期T1的一半,则脉冲宽度Mi对应的方波表示比特1;如果所述脉冲宽度Mi等于周期T0的一半,则脉冲宽度Mi对应的方波表示比特0。If the pulse width Mi is equal to half of the period T1, the square wave corresponding to the pulse width Mi represents bit 1; if the pulse width Mi is equal to half of the period T0, the square wave corresponding to the pulse width Mi represents bit 0.
  2. 根据权利要求1所述的方法,其特征在于,所述根据比较结果,确定脉冲宽度Mi的方波表示的比特,包括:The method according to claim 1, wherein the determining the bit of the square wave representation of the pulse width Mi according to the comparison result comprises:
    如果所述脉冲宽度Mi不等于周期T1的一半,也不等于周期T0的一半,判断所述脉冲宽度Mi是否在预先获取的周期T1或周期T0的一半的误差范围内,如果所述脉冲宽度Mi在周期T1的一半的误差范围内,则确定脉冲宽度Mi对应的方波表示比特1,如果所述脉冲宽度Mi在周期T0的一半的误差范围内,则确定脉冲宽度Mi对应的方波表示比特0。If the pulse width Mi is not equal to half of the period T1 and is not equal to half of the period T0, it is determined whether the pulse width Mi is within an error range of the pre-acquired period T1 or half of the period T0, if the pulse width Mi Within a half error range of the period T1, it is determined that the square wave corresponding to the pulse width Mi represents the bit 1, and if the pulse width Mi is within the error range of half of the period T0, the square wave representation bit corresponding to the pulse width Mi is determined. 0.
  3. 一种解析波形的方法,其特征在于,包括:A method for analyzing a waveform, comprising:
    接收正弦波波形,其中所述正弦波波形包括a个周期为Ta的用于表示比特0的正弦波和b个周期为Tb的用于表示比特1的正弦波,其中,周期Ta和周期Tb不相等,a和b为正整数;Receiving a sinusoidal waveform, wherein the sinusoidal waveform includes a sine wave for indicating bit 0 and a period of sine for indicating bit 1 having a period of Ta, wherein period Ta and period Tb are not Equal, a and b are positive integers;
    对所述正弦波波形进行采样,得到方波波形;Sampling the sine wave waveform to obtain a square wave waveform;
    获取所述方波波形中第i个上升沿与第i+1个上升沿之间的脉冲宽度Mi,或者,获取所述方波波形中第i个下降沿与第i+1个下降沿之间的脉冲宽度Ni,其中i≤a+b,且i为正整数;Obtaining a pulse width Mi between the i-th rising edge and the i+1th rising edge of the square wave waveform, or acquiring the i-th falling edge and the i+1th falling edge of the square wave waveform Between the pulse widths Ni, where i ≤ a + b, and i is a positive integer;
    将得到的每个脉冲宽度分别与预先获取的周期T1和预先获取的周期T0进行比较,得到比较结果; Comparing each pulse width obtained with the pre-acquired period T1 and the pre-acquired period T0 to obtain a comparison result;
    根据比较结果,确定每个脉冲宽度对应的方波表示的比特;Determining, according to the comparison result, a bit represented by a square wave corresponding to each pulse width;
    其中,根据比较结果,确定每个脉冲宽度对应的方波表示的比特,包括:Wherein, according to the comparison result, the bits represented by the square wave corresponding to each pulse width are determined, including:
    如果所述脉冲宽度Mi等于周期T1,则脉冲宽度Mi对应的方波表示比特1;如果所述脉冲宽度Mi等于周期T0,则脉冲宽度Mi对应的方波表示比特0。If the pulse width Mi is equal to the period T1, the square wave corresponding to the pulse width Mi represents bit 1; if the pulse width Mi is equal to the period T0, the square wave corresponding to the pulse width Mi represents bit 0.
  4. 根据权利要求3所述的方法,其特征在于,所述根据比较结果,确定每个脉冲宽度对应的方波表示的比特,包括:The method according to claim 3, wherein the determining, according to the comparison result, the bits of the square wave representation corresponding to each pulse width comprises:
    如果得到的某一个脉冲宽度不等于周期T1,也不等于周期T0,判断所述某一个脉冲宽度否在预先获取的周期T1或周期T0的误差范围内,如果所述某一脉冲宽度Mi在周期T1的误差范围内,则确定所述某一个脉冲宽度对应的方波表示比特1,如果所述某一脉冲宽度Mi在周期T0的误差范围内,则确定所述某一个脉冲宽度Mi对应的方波表示比特0。If a certain pulse width is not equal to the period T1 and is not equal to the period T0, it is determined whether the certain pulse width is within the error range of the pre-acquired period T1 or the period T0, if the certain pulse width Mi is in the period Within the error range of T1, it is determined that the square wave corresponding to the certain pulse width represents bit 1, and if the certain pulse width Mi is within the error range of the period T0, the square corresponding to the certain pulse width Mi is determined. The wave represents bit 0.
  5. 根据权利要求3所述的方法,其特征在于,在获取脉冲宽度Mi或脉冲宽度Ni之后,在将得到的每个脉冲宽度分别与预先获取的周期T1和预先获取的周期T0进行比较之前,所述方法还包括:The method according to claim 3, characterized in that, after the pulse width Mi or the pulse width Ni is acquired, before each pulse width obtained is compared with the pre-acquired period T1 and the pre-acquired period T0, respectively The method also includes:
    判断脉冲宽度Mi和脉冲宽度Ni是否在所述周期T0和所述周期T1之间;Determining whether the pulse width Mi and the pulse width Ni are between the period T0 and the period T1;
    如果脉冲宽度Mi在所述周期T0与所述周期T1之间,则将脉冲宽度Ni作为与周期T1和周期T0进行比较时所使用的脉冲宽度;如果脉冲宽度Ni在所述周期T0与周期T1之间,则将脉冲宽度Mi作为与周期T1和周期T0进行比较时所使用的脉冲宽度。If the pulse width Mi is between the period T0 and the period T1, the pulse width Ni is taken as the pulse width used when comparing the period T1 and the period T0; if the pulse width Ni is in the period T0 and the period T1 In between, the pulse width Mi is taken as the pulse width used when comparing the period T1 and the period T0.
  6. 根据权利要求4所述的方法,其特征在于,在获取脉冲宽度Mi或脉冲宽度Ni之后,在将得到的每个脉冲宽度分别与预先获取的周期T1和预先获取的周期T0进行比较之前,所述方法还包括:The method according to claim 4, characterized in that, after the pulse width Mi or the pulse width Ni is acquired, before each pulse width obtained is compared with the pre-acquired period T1 and the pre-acquired period T0, respectively The method also includes:
    判断脉冲宽度Mi和脉冲宽度Ni是否在所述周期T0和所述周期T1之间;Determining whether the pulse width Mi and the pulse width Ni are between the period T0 and the period T1;
    如果脉冲宽度Mi在所述周期T0与所述周期T1之间,则将脉冲宽度Ni作为与周期T1和周期T0进行比较时所使用的脉冲宽度;如果脉冲宽度Ni在所述周期T0与周期T1之间,则将脉冲宽度Mi作为与周期T1和周期T0进行比较时所使用的脉冲宽度。If the pulse width Mi is between the period T0 and the period T1, the pulse width Ni is taken as the pulse width used when comparing the period T1 and the period T0; if the pulse width Ni is in the period T0 and the period T1 In between, the pulse width Mi is taken as the pulse width used when comparing the period T1 and the period T0.
  7. 一种解析波形的装置,其特征在于,包括:An apparatus for analyzing a waveform, comprising:
    接收模块,用于接收正弦波波形,其中所述正弦波波形包括a个周期为Ta的用于表示比特0的正弦波和b个周期为Tb的用于表示比特1的正弦波,其中,周期Ta和周期Tb不相等,a和b为正整数;a receiving module, configured to receive a sine wave waveform, wherein the sine wave waveform includes a sine wave for indicating bit 0 and a sine wave for indicating bit 1 with period B being Ta, wherein the period is Ta and period Tb are not equal, and a and b are positive integers;
    采样模块,用于对所述正弦波波形进行采样,得到方波波形;a sampling module, configured to sample the sine wave waveform to obtain a square wave waveform;
    获取模块,用于获取所述方波波形中第i个上升沿与第i个下降沿之间的脉冲宽度Mi,其中i≤a+b,且i为正整数; An acquiring module, configured to acquire a pulse width Mi between the i-th rising edge and the i-th falling edge of the square wave waveform, where i≤a+b, and i is a positive integer;
    比较模块,用于将脉冲宽度Mi与预先获取的周期T1的一半和预先获取的周期T0的一半进行比较,得到比较结果;a comparison module, configured to compare the pulse width Mi with half of the pre-acquired period T1 and half of the pre-acquired period T0 to obtain a comparison result;
    确定模块,用于根据比较结果,确定脉冲宽度Mi对应的方波表示的比特;a determining module, configured to determine, according to the comparison result, a bit represented by a square wave corresponding to the pulse width Mi;
    其中,所述确定模块用于如果所述脉冲宽度Mi等于周期T1的一半,则脉冲宽度Mi对应的方波表示比特1;如果所述脉冲宽度Mi等于周期T0的一半,则脉冲宽度Mi对应的方波表示比特0。Wherein the determining module is configured to: if the pulse width Mi is equal to half of the period T1, the square wave corresponding to the pulse width Mi represents the bit 1; if the pulse width Mi is equal to half of the period T0, the pulse width Mi corresponds to The square wave represents bit 0.
  8. 根据权利要求7所述的装置,其特征在于,所述确定模块,包括:The apparatus according to claim 7, wherein the determining module comprises:
    判断单元,用于如果所述脉冲宽度Mi不等于周期T1的一半,也不等于周期T0的一半,判断所述脉冲宽度Mi是否在预先获取的周期T1或周期T0的一半的误差范围内;a judging unit, configured to determine whether the pulse width Mi is within an error range of a pre-acquired period T1 or a half of the period T0 if the pulse width Mi is not equal to half of the period T1 or equal to half of the period T0;
    确定单元,用于如果所述脉冲宽度Mi在周期T1的一半的误差范围内,则确定脉冲宽度Mi对应的方波表示比特1,如果所述脉冲宽度Mi在周期T0的一半的误差范围内,则确定脉冲宽度Mi对应的方波表示比特0。Determining unit for determining that the square wave corresponding to the pulse width Mi represents bit 1 if the pulse width Mi is within an error range of one half of the period T1, and if the pulse width Mi is within an error range of half of the period T0, Then, it is determined that the square wave corresponding to the pulse width Mi represents bit 0.
  9. 一种解析波形的装置,其特征在于,包括:An apparatus for analyzing a waveform, comprising:
    接收模块,用于接收正弦波波形,其中所述正弦波波形包括a个周期为Ta的用于表示比特0的正弦波和b个周期为Tb的用于表示比特1的正弦波,其中,周期Ta和周期Tb不相等,a和b为正整数;a receiving module, configured to receive a sine wave waveform, wherein the sine wave waveform includes a sine wave for indicating bit 0 and a sine wave for indicating bit 1 with period B being Ta, wherein the period is Ta and period Tb are not equal, and a and b are positive integers;
    采样模块,用于对所述正弦波波形进行采样,得到方波波形;a sampling module, configured to sample the sine wave waveform to obtain a square wave waveform;
    获取模块,用于获取所述方波波形中第i个上升沿与第i+1个上升沿之间的脉冲宽度Mi,或者,获取所述方波波形中第i个下降沿与第i+1个下降沿之间的脉冲宽度Ni,其中i≤a+b,且i为正整数;An acquiring module, configured to acquire a pulse width Mi between the i-th rising edge and the i+1th rising edge of the square wave waveform, or obtain an i-th falling edge and an i+th of the square wave waveform a pulse width Ni between one falling edge, where i ≤ a + b, and i is a positive integer;
    比较模块,用于将得到的每个脉冲宽度分别与预先获取的周期T1和预先获取的周期T0进行比较,得到比较结果;a comparison module, configured to compare each of the obtained pulse widths with a pre-acquired period T1 and a pre-acquired period T0 to obtain a comparison result;
    确定模块,用于根据比较结果,确定每个脉冲宽度对应的方波表示的比特;a determining module, configured to determine, according to the comparison result, a bit represented by a square wave corresponding to each pulse width;
    其中,所述确定模块用于如果所述脉冲宽度Mi等于周期T1,则脉冲宽度Mi对应的方波表示比特1;如果所述脉冲宽度Mi等于周期T0,则脉冲宽度Mi对应的方波表示比特0。Wherein the determining module is configured to: if the pulse width Mi is equal to the period T1, the square wave corresponding to the pulse width Mi represents the bit 1; if the pulse width Mi is equal to the period T0, the square wave representing the pulse width Mi represents the bit 0.
  10. 根据权利要求9所述的装置,其特征在于,所述确定模块包括:The apparatus according to claim 9, wherein the determining module comprises:
    判断单元,用于如果得到的某一个脉冲宽度不等于周期T1,也不等于周期T0,判断所述某一个脉冲宽度否在预先获取的周期T1或周期T0的误差范围内;a determining unit, configured to determine whether the one pulse width is within an error range of the pre-acquired period T1 or the period T0 if the obtained one pulse width is not equal to the period T1 or the period T0;
    确定单元,用于如果所述某一脉冲宽度Mi在周期T1的误差范围内,则确定所述某一个脉冲宽度对应的方波表示比特1,如果所述某一脉冲宽度Mi在周期T0的误差 范围内,则确定所述某一个脉冲宽度Mi对应的方波表示比特0。Determining a unit, if the certain pulse width Mi is within the error range of the period T1, determining that the square wave corresponding to the certain pulse width represents the bit 1 if the error of the certain pulse width Mi is in the period T0 Within the range, it is determined that the square wave corresponding to the certain pulse width Mi represents bit 0.
  11. 根据权利要求9所述的装置,其特征在于,所述装置还包括:The device according to claim 9, wherein the device further comprises:
    判断模块,用于在获取脉冲宽度Mi或脉冲宽度Ni之后,在将得到的每个脉冲宽度分别与预先获取的周期T1和预先获取的周期T0进行比较之前,判断脉冲宽度Mi和脉冲宽度Ni是否在所述周期T0和所述周期T1之间;The judging module is configured to determine whether the pulse width Mi and the pulse width Ni are compared before the pulse width Mi or the pulse width Ni is obtained, respectively, before each pulse width obtained is compared with the pre-acquired period T1 and the pre-acquired period T0 Between the period T0 and the period T1;
    选择模块,用于如果脉冲宽度Mi在所述周期T0与所述周期T1之间,则将脉冲宽度Ni作为与周期T1和周期T0进行比较时所使用的脉冲宽度;如果脉冲宽度Ni在所述周期T0与周期T1之间,则将脉冲宽度Mi作为与周期T1和周期T0进行比较时所使用的脉冲宽度。a selection module for using a pulse width Ni as a pulse width used when compared with the period T1 and the period T0 if the pulse width Mi is between the period T0 and the period T1; if the pulse width Ni is in the Between the period T0 and the period T1, the pulse width Mi is used as the pulse width used when comparing the period T1 and the period T0.
  12. 根据权利要求10所述的装置,其特征在于,所述装置还包括:The device according to claim 10, wherein the device further comprises:
    判断模块,用于在获取脉冲宽度Mi或脉冲宽度Ni之后,在将得到的每个脉冲宽度分别与预先获取的周期T1和预先获取的周期T0进行比较之前,判断脉冲宽度Mi和脉冲宽度Ni是否在所述周期T0和所述周期T1之间;The judging module is configured to determine whether the pulse width Mi and the pulse width Ni are compared before the pulse width Mi or the pulse width Ni is obtained, respectively, before each pulse width obtained is compared with the pre-acquired period T1 and the pre-acquired period T0 Between the period T0 and the period T1;
    选择模块,用于如果脉冲宽度Mi在所述周期T0与所述周期T1之间,则将脉冲宽度Ni作为与周期T1和周期T0进行比较时所使用的脉冲宽度;如果脉冲宽度Ni在所述周期T0与周期T1之间,则将脉冲宽度Mi作为与周期T1和周期T0进行比较时所使用的脉冲宽度。 a selection module for using a pulse width Ni as a pulse width used when compared with the period T1 and the period T0 if the pulse width Mi is between the period T0 and the period T1; if the pulse width Ni is in the Between the period T0 and the period T1, the pulse width Mi is used as the pulse width used when comparing the period T1 and the period T0.
PCT/CN2015/070739 2014-02-18 2015-01-15 Method and device for waveform analysis WO2015124047A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410054922.0A CN103811022B (en) 2014-02-18 2014-02-18 Method and device for waveform analysis
CN201410054922.0 2014-02-18

Publications (1)

Publication Number Publication Date
WO2015124047A1 true WO2015124047A1 (en) 2015-08-27

Family

ID=50707694

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/070739 WO2015124047A1 (en) 2014-02-18 2015-01-15 Method and device for waveform analysis

Country Status (2)

Country Link
CN (1) CN103811022B (en)
WO (1) WO2015124047A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103811022B (en) * 2014-02-18 2017-04-19 天地融科技股份有限公司 Method and device for waveform analysis
DE102014115493B3 (en) * 2014-10-24 2016-03-03 Infineon Technologies Ag Receiver and method for receiving a signal
CN113596829B (en) * 2021-07-07 2023-09-05 国网电力科学研究院有限公司 Real-time online key transmission device and method for networking scene of power terminal

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62283458A (en) * 1985-12-21 1987-12-09 ジエネラル サ−ビス エレクトロニクス ゲ−エムベ−ハ− Bit signal transmission system
CN102330540A (en) * 2011-08-05 2012-01-25 三一重机有限公司 Rotary supporting seat structure
CN102646175A (en) * 2012-04-22 2012-08-22 上海林果实业有限公司 Safety certificating equipment and method based on audio signal communication
CN103716270A (en) * 2011-09-26 2014-04-09 天地融科技股份有限公司 Data sending and receiving method and device
CN103811022A (en) * 2014-02-18 2014-05-21 天地融科技股份有限公司 Method and device for waveform analysis
CN103811021A (en) * 2014-02-18 2014-05-21 天地融科技股份有限公司 Method and device for waveform analysis

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2763322B2 (en) * 1989-03-13 1998-06-11 キヤノン株式会社 Audio processing method
CN102333054B (en) * 2011-09-26 2015-06-17 天地融科技股份有限公司 Data sending and receiving method and device
CN103077723B (en) * 2013-01-04 2015-07-08 鸿富锦精密工业(深圳)有限公司 Audio transmission system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62283458A (en) * 1985-12-21 1987-12-09 ジエネラル サ−ビス エレクトロニクス ゲ−エムベ−ハ− Bit signal transmission system
CN102330540A (en) * 2011-08-05 2012-01-25 三一重机有限公司 Rotary supporting seat structure
CN103716270A (en) * 2011-09-26 2014-04-09 天地融科技股份有限公司 Data sending and receiving method and device
CN102646175A (en) * 2012-04-22 2012-08-22 上海林果实业有限公司 Safety certificating equipment and method based on audio signal communication
CN103811022A (en) * 2014-02-18 2014-05-21 天地融科技股份有限公司 Method and device for waveform analysis
CN103811021A (en) * 2014-02-18 2014-05-21 天地融科技股份有限公司 Method and device for waveform analysis

Also Published As

Publication number Publication date
CN103811022B (en) 2017-04-19
CN103811022A (en) 2014-05-21

Similar Documents

Publication Publication Date Title
TWI475235B (en) Determining data valid windows in a system and method for testing an integrated circuit device
US9460814B2 (en) Memory tester design for soft error rate (SER) failure analysis
CN103353543A (en) Digital oscillator with functions of triggering and decoding serial protocols
WO2015124047A1 (en) Method and device for waveform analysis
CN113672442B (en) Signal testing method and device and storage medium
US9952281B2 (en) Clock jitter and power supply noise analysis
US9568889B1 (en) Time to digital converter with high resolution
CN105245203A (en) System and method for duty ratio detection employing high precision and low speed clock
KR101483513B1 (en) Apparatus for sound source localizatioin and method for the same
CN103811021A (en) Method and device for waveform analysis
US20130036334A1 (en) Computing device and method for testing serial attached scsi ports of servers
CN112901146B (en) Method and device for identifying bad track in acoustic logging detection
US20130013962A1 (en) Computing device and method for analyzing integrality of serial attached scsi signals
US8290729B2 (en) Low voltage differential signaling timing test system and method
US8707001B2 (en) Method and system for measuring memory access time using phase detector
CN107765100B (en) Waveform signal pre-judging period analysis method
CN102571041B (en) Method for detecting time delay and time sequence of circuit and method for correcting time delay by using such method
WO2015139523A1 (en) Data decoding method and apparatus
TWI554768B (en) Logic analyzer calibration method
TWI507704B (en) Dalay difference detection and adjustment device and method
CN107729980B (en) Waveform signal self-adaptive counting method
KR101956126B1 (en) Apparatus and method for phase alignment of parallel signals
CN107038109B (en) interrupt delay testing method and device based on MIPS framework
CN104833848B (en) Measure the method and system of pulse frequency
CN114679676B (en) Audio device testing method, system, electronic device and readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15752073

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15752073

Country of ref document: EP

Kind code of ref document: A1