WO2018161277A1 - 一种基于音频信道的数字通信方法及装置 - Google Patents

一种基于音频信道的数字通信方法及装置 Download PDF

Info

Publication number
WO2018161277A1
WO2018161277A1 PCT/CN2017/075980 CN2017075980W WO2018161277A1 WO 2018161277 A1 WO2018161277 A1 WO 2018161277A1 CN 2017075980 W CN2017075980 W CN 2017075980W WO 2018161277 A1 WO2018161277 A1 WO 2018161277A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
frame header
audio channel
array
correlation
Prior art date
Application number
PCT/CN2017/075980
Other languages
English (en)
French (fr)
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 深圳市汇顶科技股份有限公司
Priority to PCT/CN2017/075980 priority Critical patent/WO2018161277A1/zh
Priority to CN201780000125.6A priority patent/CN107004418B/zh
Publication of WO2018161277A1 publication Critical patent/WO2018161277A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • G10L19/005Correction of errors induced by the transmission channel, if related to the coding algorithm
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L19/00Speech or audio signals analysis-synthesis techniques for redundancy reduction, e.g. in vocoders; Coding or decoding of speech or audio signals, using source filter models or psychoacoustic analysis
    • G10L19/008Multichannel audio signal coding or decoding using interchannel correlation to reduce redundancy, e.g. joint-stereo, intensity-coding or matrixing
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L21/00Processing of the speech or voice signal to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
    • G10L21/003Changing voice quality, e.g. pitch or formants
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L21/00Processing of the speech or voice signal to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
    • G10L21/02Speech enhancement, e.g. noise reduction or echo cancellation
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L21/00Processing of the speech or voice signal to produce another audible or non-audible signal, e.g. visual or tactile, in order to modify its quality or its intelligibility
    • G10L21/02Speech enhancement, e.g. noise reduction or echo cancellation
    • G10L21/0208Noise filtering
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/45Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 characterised by the type of analysis window
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS OR SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING; SPEECH OR AUDIO CODING OR DECODING
    • G10L25/00Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00
    • G10L25/75Speech or voice analysis techniques not restricted to a single one of groups G10L15/00 - G10L21/00 for modelling vocal tract parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes

Definitions

  • the embodiments of the present invention relate to the field of digital communications technologies, and in particular, to a digital communication method and apparatus based on an audio channel.
  • Wired transmission includes data line transmission and audio channel transmission
  • wireless transmission includes Bluetooth, 802.11 (Wi-Fi), ZigBee, Ultra Wide Band (UWB), and infrared.
  • Wi-Fi Wi-Fi
  • ZigBee ZigBee
  • Ultra Wide Band UWB
  • infrared 802.11
  • the audio channel transmission method fully utilizes the existing resources of the mobile terminal, and when the transmission frequency is higher than the audible frequency band (the frequency range of the sound waves that can be heard by the human ear), the normal playback of the sound is not affected.
  • audio channel-based terminal devices such as ear thermometers and heart rate headphones have been widely used.
  • the traditional communication method based on the audio channel usually adopts Dual Tone Multi Frequency (DTMF) technology, which can achieve a low data transmission rate.
  • DTMF Dual Tone Multi Frequency
  • different types of terminal devices are In the case of high-rate data transmission, the waveforms obtained by sampling will have different degrees of distortion.
  • the conventional decoding algorithm is difficult to perform accurate analysis, which will cause the demodulation success rate of the receiving end to drop sharply. Therefore, for an application scenario where a large amount of data is exchanged, a high-rate, high-reliability communication method based on an audio channel needs to be considered.
  • the decoding success rate is low.
  • the prior art does not solve the decoding problem when the signal waveform is severely distorted, and its data transmission rate is difficult to meet the higher rate requirement.
  • the embodiment of the present application provides a digital communication method and device based on an audio channel, which aims to solve the present problem.
  • Some digital communication methods based on audio signals cannot solve the decoding problem when the signal waveform is severely distorted, and the data transmission rate is not high enough.
  • a digital communication method based on an audio channel comprising:
  • Step a The transmitting end groups the original data packet to be sent, and performs Manchester encoding on the data packet after the group packet, and sends the encoded data packet through the audio channel;
  • Step b The receiving end samples the data packet sent by the transmitting end, and performs synchronous frame header detection and Manchester decoding processing on the sampled data to obtain original data.
  • the technical solution adopted by the embodiment of the present application further includes: in the step a, the sending end is configured to: the synchronization frame header, the data field, and the CRC check code form a data packet.
  • the technical solution adopted by the embodiment of the present application further includes: in the step b, the receiving end sampling the data packet sent by the sending end further includes: forming the sampling data into an array.
  • the technical solution adopted by the embodiment of the present application further includes: forming sampling data into an array.
  • the technical solution adopted by the embodiment of the present application further includes: in the step b, the performing synchronous frame header detection on the sampled data is specifically: performing synchronization frame header detection on the current array by using a correlation method.
  • the technical solution adopted by the embodiment of the present application further includes: in the step b, the performing the synchronization frame header detection on the current array by using the correlation method includes:
  • Step b10 sequentially calculating a correlation coefficient between the data in the current array and a specific array; wherein the specific array is a correlation window, and the size of the correlation window is a sampling point in one symbol period;
  • Step b11 determining whether the calculated correlation coefficient is greater than the first threshold, if the correlation coefficient is greater than a first threshold value, indicating that the synchronization frame header is detected, a piece of data after the synchronization frame header is valid data; if the correlation coefficient is not greater than the first threshold value, step b12 is performed;
  • Step b12 judging whether the current data position of the correlation coefficient is calculated to reach the tail of the current array. If the tail of the current array is reached, the current array processing ends; if the tail of the current array is not reached, the related window is swept backward by one step, and Go to step b10.
  • the technical solution adopted by the embodiment of the present application further includes: performing, in the step b, the Manchester decoding of the sampled data by performing a Manchester decoding on the valid data after the synchronization frame header by using a correlation method.
  • the Manchester decoding specifically includes:
  • Step b20 sequentially detecting peaks or troughs in the effective data, when detecting peaks or troughs, performing step b21;
  • Step b21 determining whether the peak or trough is greater than a second threshold; if the peak or trough is greater than the second threshold, performing step b22; if the peak or trough is not greater than the second threshold, then The relevant window slides one step backward and repeats step b20;
  • Step b22 Bit analysis: if the detected peak is, it resolves to "1", if it is a trough, it resolves to "0", and the relevant window is swept backward M step; the M is a symbol The number of sampling points for the period.
  • the step of sliding the relevant window backward M step further includes:
  • Step b23 determining whether the correlation window reaches the tail of the current array, and if the correlation window reaches the tail of the current array, outputting the result of the bit parsing; if the correlation window does not reach the current array At the end, step b20 is re-executed.
  • the technical solution adopted by the embodiment of the present application further includes: performing, in the step b, the Manchester decoding of the sampled data, further comprising: after performing the CRC check on the parsing result, displaying the parsing result.
  • a digital communication device based on an audio channel, including a transmitting end and a receiving end;
  • the sending end includes a first control module and a first audio communication module, where the first control module is configured to group the original data to be sent, and perform Manchester encoding on the data packet after the group packet, the first audio
  • the communication module is configured to send the encoded data packet through the audio channel;
  • the receiving end includes a second audio communication module and a second control module, the second audio communication module is configured to sample a data packet sent by the sending end, and the second control module performs a synchronization frame header on the sampled data. Detection and Manchester decoding processing to obtain raw data.
  • the technical solution adopted by the embodiment of the present application further includes: the first control module includes a grouping unit, and the grouping unit is configured to form a synchronization frame header, a data field, and a CRC check code into a data packet.
  • the technical solution adopted by the embodiment of the present application further includes: sampling, by the second audio communication module, the data packet sent by the sending end, further comprising: forming the sampling data into an array.
  • the technical solution adopted by the embodiment of the present application further includes: the second control module further includes a frame header detecting unit, where the frame header detecting unit is configured to perform synchronous frame header detection on the current array by using a correlation method.
  • the technical solution adopted by the embodiment of the present application further includes: the frame header detecting unit performing synchronization frame header detection on the current array by using a correlation method, specifically: sequentially calculating data and a specific number in the current array. a correlation coefficient of the group; wherein the specific array is a correlation window, the size of the correlation window is a number of sampling points in one symbol period; determining whether the calculated correlation coefficient is greater than a first threshold, if the correlation coefficient is greater than the first The threshold value indicates that the synchronization frame header is detected, and a piece of data after the synchronization frame header is valid data; if the correlation coefficient is not greater than the first threshold value, it is determined whether the current data position of the correlation coefficient is calculated to reach the current array.
  • the tail if it reaches the end of the current array, the current array processing ends; if it does not reach the end of the current array, the related window is swept back one step, and the correlation coefficient between the data in the current array and the specific array is recalculated.
  • the technical solution adopted by the embodiment of the present application further includes: the second control module further includes a decoding unit, where the decoding unit is configured to perform Manchester decoding on the valid data after the synchronization frame header by using a correlation method.
  • the decoding unit uses the correlation method to perform Manchester decoding on the valid data after the synchronization frame header, and specifically includes:
  • the technical solution adopted by the embodiment of the present application further includes: the step of sliding the relevant window backward M step further comprises: determining whether the related window reaches the tail of the current array, and if the related window reaches the tail of the current array, Then, the parsing result is output; if the correlation window does not reach the end of the current array, the peak or trough in the valid data is re-detected.
  • the technical solution adopted by the embodiment of the present application further includes: the second control module further includes a check unit, where the check unit is configured to perform CRC check on the parsing result and display the parsing result.
  • the audio channel-based digital communication method and device in the embodiment of the present application adopts Manchester coding on the transmitting end, and the receiving end performs Manchester decoding on the received data by using a correlation method.
  • the improved codec algorithm achieves a higher data transmission rate and improves the decoding success rate and accuracy, far exceeding the data transmission rate of the conventional audio communication mode, and can be applied to the two-way communication between the upper computer and the lower computer.
  • FIG. 1 is a flowchart of a method for sending data by a transmitting end according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of Manchester coding according to an embodiment of the present application.
  • FIG. 3 is a flowchart of a method for processing data at a receiving end according to an embodiment of the present application
  • 4 is a bit stream obtained by Manchester coding of a synchronization frame header
  • FIG. 5 is a flowchart of frame header detection according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an audio channel-based digital communication apparatus according to an embodiment of the present application.
  • the audio channel-based digital communication method and apparatus converts the original data to be transmitted, encodes, and modulates the digital data to be converted into an analog signal by using Manchester coding at the transmitting end (lower computer) by improving the codec algorithm. After that, the analog signal is transmitted through the audio channel.
  • the received analog signal is sampled by the correlation method, and the sampled data is filtered, synchronized frame header detection, and Manchester decoding processing to obtain original data.
  • the embodiment of the present application improves the codec algorithm. A higher data transmission rate is achieved, and the decoding success rate and accuracy are improved.
  • the embodiment of the present application can be applied to the lower computer to transmit data to the upper computer, and can also be applied to the upper computer to transmit control information to the lower computer.
  • FIG. 1 is a flowchart of a method for sending data by a transmitting end according to an embodiment of the present application.
  • the method for sending data by the sending end of the embodiment of the present application includes the following steps:
  • Step 100 group the original data to be sent
  • step 100 the original data to be sent is grouped into: a synchronization frame header, a data field, and a CRC (Cyclic Redundancy Check) check code are formed into a data packet, and the length of the data packet is synchronized.
  • the length of the frame header, the length of the data field, and the length of the CRC check value are determined together.
  • the synchronization frame header used is 0xFF, 0x5A
  • the data field includes a data type of 8 bits, a data length of 8 bits, a packet sequence number of 8 bits, and a raw data of 56 bits.
  • the data fields are different according to the application environment.
  • the CRC check code is the cyclic redundancy check code, which is the check value of the data field, which is calculated by the data field.
  • the CRC polynomial is: 1+X+X 2 +X 8 .
  • the data packet structure of the embodiment of the present application is as shown in Table 1 below:
  • Step 110 Encode the data packet after the group packet
  • the data packet is encoded by: encoding the data packet by Manchester coding technology, and Manchester coding includes the clock signal in the data stream, and has self-synchronization capability and good anti-interference performance.
  • the specific coding mode is: mapping the original data “0” in the data packet to “10”, and mapping the original data “1” to “01”.
  • FIG. 2 it is a schematic diagram of Manchester coding in the embodiment of the present application. Let the transmission time occupied by each original bit (bit) be T, then the transmission time of each bit after Manchester encoding is T/2.
  • Step 120 Modulate the encoded data packet into an analog signal on the channel, and send the analog signal through the audio channel;
  • the encoded data packet is modulated into an analog signal on the channel, specifically: the encoded digital signal is mapped onto the audio channel; the mapping mode is: the digital signal “0” corresponds to the low level of the analog signal- V, the digital signal "1" corresponds to the high level +V of the analog signal.
  • the hold times of the digital signals "0" and “1” are both T/2.
  • the magnitude of the level V determines the signal-to-noise ratio of the signal at the receiving end. The larger the value of the level V, the higher the signal-to-noise ratio, and vice versa, the lower the signal-to-noise ratio; In the example, the value of the level V is set to 500 mV.
  • the size of T determines the recognizability of the signal at the receiving end.
  • the audio channel-based digital communication method in the embodiment of the present application uses Manchester coding to encode, encode, and modulate the original data to be transmitted at the transmitting end, converts the digital signal into an analog signal, and transmits an analog signal through the audio channel, thereby achieving a more High data transfer rate to meet the high-speed data transmission requirements of digital communications.
  • FIG. 3 is a flowchart of a method for processing data at the receiving end according to an embodiment of the present application.
  • the receiving end data processing method of the embodiment of the present application includes the following steps:
  • Step 200 sampling the analog signal, and forming the sampled data into an array according to the set length;
  • step 200 the analog signal is sampled as follows: the analog signal is input at the sampling frequency fs The row is sampled to obtain a digital signal.
  • the higher the sampling frequency the more accurate the description of the obtained digital signal is to the analog signal; when the sampling frequency is low, the obtained digital signal will be difficult to recover the corresponding analog signal.
  • the set array length is 5000, and the sampling parameters may be specifically set according to actual requirements.
  • Step 210 Perform band-pass filtering on the data in the current array to eliminate noise interference outside the data band;
  • the filter used in the embodiment of the present application is an FIR filter (Finite Impulse Response), the passband frequency is 8KHz-12KHz, and the window adopts a Hanning window (Hanning window).
  • the filter order is 25 steps, and the above filter parameters can be specifically set according to actual needs.
  • Step 220 Perform synchronization frame header detection on the current array, and determine whether a synchronization frame header is detected in the current array. If a synchronization frame header is detected in the current array, step 230 is performed;
  • step 220 the embodiment of the present application performs a synchronization frame header detection on the array by using a correlation method.
  • FIG. 4 is a bit stream obtained by Manchester coding of a synchronization frame header
  • FIG. 5 is a flow chart of frame header detection according to an embodiment of the present application.
  • the frame header detection method in this embodiment of the present application includes the following steps:
  • Step 221 sequentially calculate a correlation coefficient between the data in the current array and a specific array
  • the specific array is a correlation window of a specific length
  • the size of the correlation window is the number of sampling points in one symbol period
  • the elements in the specific array are the expected values corresponding to the specific original data bits.
  • the specific original data bit used is “1”
  • the corresponding Manchester code is “01”
  • the corresponding correlation window is [-1, -1, 1, 1].
  • the correlation coefficient is calculated as follows:
  • x 1k represents the data in array 1
  • x 2k represents the data in array 2.
  • k represents the array subscript
  • Step 222 Determine whether the calculated correlation coefficient is greater than a set first threshold. If the correlation coefficient is greater than the set first threshold, it indicates that the synchronization frame header is detected, and the synchronization frame header detection ends; if the correlation coefficient is If the threshold is not greater than the first threshold, step 223 is performed;
  • step 222 if a sync frame header is detected in the array, it indicates that the current array is a valid array, and a piece of data after the sync frame header is valid data; if no sync frame header is detected in the current array, the current array processing ends.
  • the first threshold value of the correlation coefficient is determined to be 0.6, which may be specifically set according to an actual application.
  • Step 223 Determine whether the current data position of the correlation coefficient is reached at the end of the current array. If the end of the current array is reached, indicating that the current array is detected, and the synchronization frame header is not detected, the current array processing ends; if the current array is not reached. The tail, then slide the relevant window one step backward, and repeat step 221;
  • step 223 assuming that the current array length is 6, and the specific array used is [-1, -1, 1, 1], first calculate the correlation coefficient between the first bit data of the current array and the fourth bit data and the specific array. If the calculated correlation coefficient is greater than the set first threshold, indicating that the synchronization frame header is detected, the subsequent step may be performed; if the calculated correlation coefficient is not greater than the set first threshold, indicating that synchronization has not been detected.
  • the frame header slides the correlation window one step backward (ie, moves back one data), calculates the correlation coefficient of the second bit data of the current array to the fifth bit data and the specific array, and so on, until the relevant window is scrolled to the current The last data of the array.
  • Step 230 Perform Manchester decoding on the valid data after the synchronization frame header to obtain corresponding original data.
  • step 230 the embodiment of the present application performs Manchester decoding on the valid data by using a correlation method.
  • FIG. 6 is a flowchart of data decoding in the embodiment of the present application.
  • the data decoding manner in this embodiment of the present application includes the following steps:
  • Step 231 sequentially detecting peaks or troughs in the valid data, when detecting peaks or troughs, performing step 232;
  • the peak refers to the maximum amplitude of the wave within a range of wavelengths.
  • the minimum value of the pair is called the trough; in the case of the transverse wave, the highest point of the protrusion is the peak, and the lowest point of the depression is the trough.
  • Step 232 Determine whether the peak or trough is greater than a set second threshold; if the peak or trough is greater than the set second threshold, perform step 233; if the peak or trough is not greater than the set The second threshold value, the relevant window slides one step backward, and step 231 is re-executed;
  • step 232 the second threshold value of the peak or trough is determined to be 0.8 in the embodiment of the present application, which may be set according to the actual application, and the related window sliding manner is the same as step 223, and details are not described herein again.
  • Step 233 Bit parsing: if the detected peak is, it resolves to "1", if it detects the trough, it resolves to "0", and slides the relevant window backward M step (that is, moves M data backward) );
  • M is the number of sampling points of one symbol period. In the embodiment of the present application, the value of M is 4.
  • Step 234 Determine whether the relevant window reaches the end of the current array. If the relevant window reaches the end of the current array, the parsing result is output, and the bit parsing of the current array ends; if the related window does not reach the end of the current array, step 231 is re-executed.
  • Step 240 After performing the CRC check on the parsed original data, the analysis result is displayed.
  • the audio channel-based digital communication method in the embodiment of the present application samples the received analog signal by using a correlation method at the receiving end, and performs filtering, synchronization frame header detection, and Manchester decoding processing to obtain original data, thereby improving decoding.
  • the success rate and accuracy solve the demodulation problem when the signal waveform is severely distorted.
  • FIG. 7 is a schematic structural diagram of an audio channel-based digital communication apparatus according to an embodiment of the present application.
  • the audio channel-based digital communication device of the embodiment of the present application includes a transmitting end and a receiving end.
  • the transmitting end and the receiving end respectively have an audio interface (not shown), and the transmitting end and the receiving end are connected to each other through an audio interface.
  • the transmitting end includes a first control module and a first audio communication module; the first control module is configured to: after the original data group to be sent and encoded by Manchester encoding, transmit the data packet to the first audio communication module; An audio communication module is used to convert the digital signal in the data packet into an analog signal After the number, the analog signal is sent through the audio channel.
  • the first control module includes a grouping unit and a coding unit
  • the grouping unit is configured to group the original data to be sent; the original data to be sent is grouped into: the synchronization frame header, the data field and the CRC check code are grouped into a data packet, and the length of the data packet is composed of the synchronization frame.
  • the length of the header, the length of the data field, and the length of the CRC check value are determined together.
  • the synchronization frame header used is 0xFF, 0x5A
  • the data field includes a data type of 8 bits, a data length of 8 bits, a packet sequence number of 8 bits, and a raw data of 56 bits.
  • the data fields are different according to the application environment.
  • the CRC check code is the cyclic redundancy check code, which is the check value of the data field, which is calculated by the data field.
  • the CRC polynomial is: 1+X+X 2 +X 8 .
  • the data packet structure of the embodiment of the present application is as shown in Table 1 below:
  • the coding unit is configured to encode the data packet after the group packet; wherein the data packet is encoded by: encoding the data packet by Manchester coding technology, and Manchester coding includes the clock signal in the data stream, and has self-synchronization capability and Good anti-interference performance.
  • the specific coding mode is: mapping the original data “0” in the data packet to “10”, and mapping the original data “1” to “01”. Let the transmission time occupied by each original bit (bit) be T, then the transmission time of each bit after Manchester encoding is T/2. In the embodiment of the present application, T is 0.1 ms, and the data transmission rate is 10 Kbps.
  • the analog signal is sent through the audio channel; wherein the encoded data packet is modulated into an analog signal on the channel, specifically: the coded number is The signal is mapped to the audio channel; the mapping mode is: the digital signal “0” corresponds to the low level -V of the analog signal, and the digital signal “1” corresponds to the high level +V of the analog signal.
  • the hold times of the digital signals "0" and “1” are both T/2. In the case where the channel noise is constant, the magnitude of the level V determines the signal-to-noise ratio of the signal at the receiving end.
  • the value of the level V is set to 500 mV.
  • the size of T determines the recognizability of the signal at the receiving end. The larger T is, the smaller the influence of signal distortion on the overall waveform, the signal can be The higher the degree of recognition, the lower the signal recognizability.
  • the receiving end includes a second audio communication module and a second control module, wherein the second audio communication module is configured to sample the received analog signal by using a correlation method, and transmit the sampled data to the second control module; the second control module is configured to: After the sampled data is filtered, synchronized frame header detection, and Manchester decoding processing, the original data is obtained.
  • the second audio communication module samples the analog signal by: sampling the analog signal by the sampling frequency fs to obtain a digital signal, and forming the sampled data into an array according to the set length; the higher the sampling frequency, the obtained digital signal pair simulation The more accurate the description of the signal, the lower the sampling frequency, the resulting digital signal will be difficult to recover the corresponding analog signal.
  • the second control module includes a filtering unit, a frame header detecting unit, a decoding unit, and a verifying unit;
  • the filtering unit is configured to perform band-pass filtering on the data in the current array to eliminate noise interference outside the data band.
  • the filter used in the embodiment of the present application is an FIR filter, the passband frequency is 8KHz-12KHz, and the window adopts a Hanning window.
  • the filter parameters can be set according to actual needs.
  • the frame header detecting unit is configured to perform synchronous frame header detection on the current array, and determine whether a synchronization frame header is detected in the current array. If a synchronization frame header is detected in the current array, decoding is performed by the decoding unit.
  • the example uses the correlation method to perform synchronous frame header detection on the array.
  • the frame header detection method includes:
  • A1 sequentially calculates the correlation coefficient between the data in the current array and a specific array; wherein, the specific array is a correlation window of a specific length, the size of the correlation window is the number of sampling points in one symbol period, and the elements in the specific array are specific original data.
  • the expected value corresponding to the bit In the embodiment of the present application, the specific original data bit used is “1”, the corresponding Manchester code is “01”, and the corresponding correlation window is [-1, -1, 1, 1].
  • the correlation coefficient is calculated as follows:
  • x 1k represents the data in array 1
  • x 2k represents the data in array 2.
  • k represents the array subscript
  • A2 determining whether the calculated correlation coefficient is greater than a set first threshold, if the correlation coefficient is greater than the set first threshold, indicating that the synchronization frame header is detected, and the synchronization frame header detection ends; if the correlation coefficient is not If the synchronization threshold is detected in the array, the current array is a valid array, and the data after the synchronization header is valid data; if the current array is not detected, To the sync frame header, the current array processing ends.
  • the first threshold value of the correlation coefficient is determined to be 0.6, which may be specifically set according to an actual application.
  • A3 judging whether the current data position of the correlation coefficient is calculated to reach the end of the current array. If the end of the current array is reached, indicating that the current array is detected, and the synchronization frame header is not detected, the current array processing ends; if the current array is not reached At the end, slide the relevant window one step backward and re-execute a1; where, assuming the current array length is 6, the specific array used is [-1, -1, 1, 1], first calculate the first bit of the current array. The correlation coefficient of the data to the 4th bit data and the specific array.
  • the subsequent step may be performed; if the calculated correlation coefficient is not greater than the set value Set the first threshold value, indicating that the synchronization frame header has not been detected, then slide the correlation window one step backward (ie, move one data backward), and calculate the correlation between the second to fifth data of the current array and the specific array. The coefficient..., and so on, until the relevant window is swiped to the last data of the current array.
  • the coding unit is configured to perform Manchester decoding on the valid data after the synchronization frame header to obtain corresponding original data.
  • the embodiment of the present application performs Manchester decoding on the valid data by using a correlation method.
  • Data decoding methods include:
  • B1 sequentially detecting peaks or troughs in the valid data, and when detecting peaks or troughs, performing b2;
  • B2 determining whether the peak or trough is greater than a set second threshold; if the peak or trough is greater than the set second threshold, performing b3; if the peak or trough is not greater than the set second gate If the value is limited, the relevant window is slid one step backward, and b1 is re-executed;
  • the second threshold of the crest or trough is 0.8, which can be set according to the actual application.
  • B3 Bit resolution: if the detected peak is, it resolves to "1", if it detects the trough, it resolves to "0", and the relevant window slides back M step; where M is a symbol period The number of sampling points, the value of M in the embodiment of the present application is 4;
  • B4 Determine whether the relevant window reaches the end of the current array. If the relevant window reaches the end of the current array, the parsing result is output, and the bit parsing of the current array ends; if the related window does not reach the end of the current array, b1 is executed again.
  • the verification unit is configured to perform the CRC check on the parsed original data, and display the analysis result.
  • the transmitting end and the receiving end comprise a terminal device having an audio interface, such as an ear thermometer, a heart rate earphone, etc., and a receiving end such as a smart phone, a computer, etc., and the transmitting end is a heart rate earphone and a receiving end.
  • the digital communication method based on the audio channel includes: collecting heart rate data through the heart rate earphone, and grouping, encoding, and modulating the collected heart rate data by using Manchester coding, and transmitting the heart rate data to the intelligence through the audio channel.
  • the mobile phone uses the correlation method to sample the received heart rate data, and filters the sampled data, synchronizes the frame header detection and Manchester decoding processing, and displays the heart rate data through an application installed on a smartphone or a smart phone.

Abstract

本申请实施例涉及数字通信技术领域,尤其涉及一种基于音频信道的数字通信方法及装置。所述基于音频信道的数字通信方法包括:步骤a:发送端将待发送的原始数据组包,并对组包后的数据包进行Manchester编码,通过音频信道发送所述编码后的数据包;步骤b:接收端对所述发送端发送的数据包进行采样,并对采样数据进行同步帧头检测和Manchester解码处理,得到原始数据。本申请实施例通过在发送端采用Manchester编码,接收端采用相关法对接收数据进行Manchester解码,能够实现在较高数据包解调成功率的要求下,达到更高的数据传输速率,远远超过常规音频通信方式的数据传输速率,并可适用于上位机和下位机的双向通信。

Description

一种基于音频信道的数字通信方法及装置 【技术领域】
本申请实施例涉及数字通信技术领域,尤其涉及一种基于音频信道的数字通信方法及装置。
【背景技术】
目前,移动终端与其他设备的通信方式分为两类:有线传输和无线传输。有线传输包括数据线传输和音频信道传输;无线传输包括蓝牙、802.11(Wi-Fi)、ZigBee、超宽带(UWB)和红外等。根据不同的应用场景,不同的通信方式表现出特有的优势。
音频信道传输方式充分利用了移动终端的现有资源,当传输频率高于可听声频段(人耳能听到的声波的频率范围)时,不会影响声音的正常播放。随着技术的发展,耳式温度计、心率耳机等基于音频信道的终端设备得到了广泛的应用。然而,基于音频信道的传统通信方法通常采用双音多频(Dual Tone Multi Frequency,DTMF)技术,该技术能够达到的数据传输速率较低,当提高数据传输速率时,由于不同类型的终端设备在高速率数据传输的情况下,采样得到的波形会有不同程度的畸变,当畸变程度较大时,传统解码算法难以进行准确的解析,会导致接收端的解调成功率急剧下降。因此,针对大量数据交互的应用场景,需要考虑基于音频信道的高速率、高可靠性通信方法。现有技术在数据速率较高、信号波形畸变程度较大的情况下,解码成功率较低。
现有技术没有解决信号波形严重畸变时的解码问题,且其数据传输速率难以满足较高的速率要求。
【发明内容】
本申请实施例提供了一种基于音频信道的数字通信方法及装置,旨在解决现 有的基于音频信号的数字通信方法无法解决信号波形严重畸变时的解码问题,且数据传输速率不够高的技术问题。
为了解决以上提出的问题,本申请实施例采用的技术方案包括:
一种基于音频信道的数字通信方法,包括:
步骤a:发送端将待发送的原始数据组包,并对组包后的数据包进行Manchester编码,通过音频信道发送所述编码后的数据包;
步骤b:接收端对所述发送端发送的数据包进行采样,并对采样数据进行同步帧头检测和Manchester解码处理,得到原始数据。
本申请实施例采取的技术方案还包括:在所述步骤a中,所述发送端将待发送的原始数据组包具体为:将同步帧头、数据字段和CRC校验码组成数据包。
本申请实施例采取的技术方案还包括:在所述步骤b中,所述接收端对发送端发送的数据包进行采样还包括:将采样数据组成数组。
本申请实施例采取的技术方案还包括:将采样数据组成数组。
本申请实施例采取的技术方案还包括:在所述步骤b中,所述对采样数据进行同步帧头检测具体为:采用相关法对当前数组进行同步帧头检测。
本申请实施例采取的技术方案还包括:在所述步骤b中,所述采用相关法对当前数组进行同步帧头检测具体包括:
步骤b10:顺序计算所述当前数组中的数据与特定数组的相关系数;其中,所述特定数组为相关窗,所述相关窗的大小为一个符号周期内的采样点数;
步骤b11:判断计算出的相关系数是否大于第一门限值,如果相关系数大于 第一门限值,表示检测到同步帧头,所述同步帧头后的一段数据即为有效数据;如果相关系数未大于第一门限值,则执行步骤b12;
步骤b12:判断计算相关系数的当前数据位置是否到达当前数组的尾部,如果到达当前数组的尾部,则当前数组处理结束;如果没有到达当前数组的尾部,则将相关窗向后滑动一步,并重新执行步骤b10。
本申请实施例采取的技术方案还包括:在所述步骤b中,所述对采样数据进行Manchester解码具体为:采用相关法对所述同步帧头后的有效数据进行Manchester解码。
本申请实施例采取的技术方案还包括:所述Manchester解码具体包括:
步骤b20:顺序检测所述有效数据中的波峰或者波谷,当检测到波峰或者波谷时,执行步骤b21;
步骤b21:判断所述波峰或者波谷是否大于第二门限值;如果所述波峰或者波谷大于第二门限值,则执行步骤b22;如果所述波峰或者波谷未大于第二门限值,则相关窗向后滑动一步,并重新执行步骤b20;
步骤b22:比特解析:如果检测到的是波峰,则解析为“1”,如果检测到的是波谷,则解析为“0”,并将相关窗向后滑动M步;所述M为一个符号周期的采样点数。
本申请实施例采取的技术方案还包括:所述将相关窗向后滑动M步还包括:
步骤b23:判断所述相关窗是否到达当前数组尾部,如果所述相关窗到达当前数组尾部,则输出所述比特解析的结果;如果所述相关窗没有到达当前数组 尾部,则重新执行步骤b20。
本申请实施例采取的技术方案还包括:在所述步骤b中,所述对采样数据进行Manchester解码还包括:将所述解析结果进行CRC校验后,展示解析结果。
本申请实施例采取的另一技术方案为:一种基于音频信道的数字通信装置,包括发送端和接收端;
所述发送端包括第一控制模块和第一音频通信模块,所述第一控制模块用于将待发送的原始数据组包,并对组包后的数据包进行Manchester编码,所述第一音频通信模块用于通过音频信道发送编码后的数据包;
所述接收端包括第二音频通信模块和第二控制模块,所述第二音频通信模块用于对所述发送端发送的数据包进行采样,所述第二控制模块对采样数据进行同步帧头检测和Manchester解码处理,得到原始数据。
本申请实施例采取的技术方案还包括:所述第一控制模块包括组包单元,所述组包单元用于将同步帧头、数据字段和CRC校验码组成数据包。
本申请实施例采取的技术方案还包括:所述第二音频通信模块对发送端发送的数据包进行采样还包括:将采样数据组成数组。
本申请实施例采取的技术方案还包括:所述第二控制模块还包括帧头检测单元,所述帧头检测单元用于采用相关法对当前数组进行同步帧头检测。
本申请实施例采取的技术方案还包括:所述帧头检测单元采用相关法对当前数组进行同步帧头检测具体包括:顺序计算所述当前数组中的数据与特定数 组的相关系数;其中,所述特定数组为相关窗,所述相关窗的大小为一个符号周期内的采样点数;判断计算出的相关系数是否大于第一门限值,如果相关系数大于第一门限值,表示检测到同步帧头,所述同步帧头后的一段数据即为有效数据;如果相关系数未大于第一门限值,则判断计算相关系数的当前数据位置是否到达当前数组的尾部,如果到达当前数组的尾部,则当前数组处理结束;如果没有到达当前数组的尾部,则将相关窗向后滑动一步,并重新计算所述当前数组中的数据与特定数组的相关系数。
本申请实施例采取的技术方案还包括:所述第二控制模块还包括解码单元,所述解码单元用于采用相关法对所述同步帧头后的有效数据进行Manchester解码.
本申请实施例采取的技术方案还包括:所述解码单元采用相关法对同步帧头后的有效数据进行Manchester解码具体包括:
顺序检测所述有效数据中的波峰或者波谷,当检测到波峰或者波谷时,判断所述波峰或者波谷是否大于第二门限值;如果所述波峰或者波谷未大于第二门限值,则相关窗向后滑动一步,并重新检测所述有效数据中的波峰或者波谷;如果所述波峰或者波谷大于第二门限值,则进行比特解析:如果检测到的是波峰,则解析为“1”,如果检测到的是波谷,则解析为“0”,并将相关窗向后滑动M步;所述M为一个符号周期的采样点数。
本申请实施例采取的技术方案还包括:所述将相关窗向后滑动M步还包括:判断所述相关窗是否到达当前数组尾部,如果所述相关窗到达当前数组尾部, 则输出解析结果;如果所述相关窗没有到达当前数组尾部,则重新检测所述有效数据中的波峰或者波谷。
本申请实施例采取的技术方案还包括:所述第二控制模块还包括校验单元,所述校验单元用于将所述解析结果进行CRC校验及展示解析结果。
与现有技术相比,本申请实施例的有益效果在于:本申请实施例的基于音频信道的数字通信方法及装置在发送端采用Manchester编码,接收端采用相关法对接收数据进行Manchester解码,通过改进编解码算法,达到了更高的数据传输速率,并提高解码成功率和准确度,远远超过常规音频通信方式的数据传输速率,并可适用于上位机和下位机的双向通信。
【附图说明】
图1是本申请实施例的发送端发送数据的方法的流程图;
图2为本申请实施例的Manchester编码示意图;
图3是本申请实施例的接收端数据处理方法的流程图;
图4为同步帧头经过Manchester编码得到的比特流;
图5为本申请实施例的帧头检测流程图;
图6是本申请实施例的数据解码流程图;
图7是本申请实施例的基于音频信道的数字通信装置的结构示意图。
【具体实施方式】
为了便于理解本申请,下面将参照相关附图对本申请进行更全面的描述。附图中给出了本申请的较佳实施例。但是,本申请可以以许多不同的形式来实现,并不限于本文所描述的实施例。相反地,提供这些实施例的目的是使对本 申请的公开内容的理解更加透彻全面。
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。
本申请实施例的基于音频信道的数字通信方法及装置通过改进编解码算法,在发送端(下位机)采用Manchester编码将待发送的原始数据组包、编码、调制,将数字信号转换为模拟信号后,通过音频信道发送模拟信号。在接收端(上位机)采用相关法对接收到的模拟信号进行采样,并将采样数据进行滤波、同步帧头检测和Manchester解码处理后,得到原始数据;本申请实施例通过改进编解码算法,达到了更高的数据传输速率,并提高解码成功率和准确度,并本申请实施例可适用于下位机向上位机传输数据,也可适用于上位机向下位机传输控制信息。
具体地,请参阅图1,是本申请实施例的发送端发送数据的方法的流程图。本申请实施例的发送端发送数据的方法包括以下步骤:
步骤100:将待发送的原始数据进行组包;
在步骤100中,将待发送的原始数据进行组包具体为:将同步帧头、数据字段和CRC(Cyclic Redundancy Check,循环冗余校验)校验码组成数据包,数据包的长度由同步帧头长度、数据字段长度和CRC校验值长度共同决定。在本申请实施例中,采用的同步帧头为0xFF,0x5A,数据字段包括数据类型8bit、数据长度8bit、包序号8bit和原始数据56bit,数据字段具体根据应用环境的不同而不同。CRC校验码即循环冗余校验码,为数据字段的校验值,由数据字段计算得到,CRC多项式为:1+X+X2+X8。本申请实施例的数据包结构如下表1所示:
表1数据包结构
字段名 同步帧头 数据字段 CRC
长度(bit) 16 80 8
步骤110:对组包后的数据包进行编码;
在步骤110中,对数据包进行编码具体为:采用Manchester(曼彻斯特)编码技术对数据包进行编码,Manchester编码将时钟信号包含在数据流中,具有自同步能力和良好的抗干扰性能。具体编码方式为:将数据包中的原始数据“0”映射为“10”,将原始数据“1”映射为“01”。具体如图2所示,为本申请实施例的Manchester编码示意图。设每个原始比特(bit)占用的传输时间为T,那么Manchester编码后每个比特的传输时间为T/2。
步骤120:将编码后的数据包调制为信道上的模拟信号,并通过音频信道发送模拟信号;
在步骤120中,将编码后的数据包调制为信道上的模拟信号具体为:将编码后的数字信号映射到音频信道上;映射方式为:数字信号“0”对应模拟信号的低电平-V,数字信号“1”对应模拟信号的高电平+V。数字信号“0”和“1”的保持时间都是T/2。在信道噪声一定的情况下,电平V的大小决定了接收端信号的信噪比,电平V的值越大,信噪比越高,反之,则信噪比越低;在本申请实施例中,电平V的值设定为500mV。在信道条件一定的情况下,T的大小决定了接收端信号的可辨识度,T越大,信号畸变对整体波形的影响越小,信号可辨识度越高,反之,信号可辨识度越低。
本申请实施例的基于音频信道的数字通信方法在发送端采用Manchester编码将待发送的原始数据组包、编码、调制,将数字信号转换为模拟信号后,通过音频信道发送模拟信号,达到了更高的数据传输速率,满足数字通信的高速率数据传输要求。
请参阅图3,是本申请实施例的接收端数据处理方法的流程图。本申请实施例的接收端数据处理方法包括以下步骤:
步骤200:对模拟信号进行采样,并将采样得到的数据按照设定长度组成数组;
在步骤200中,对模拟信号进行采样具体为:以采样频率fs对模拟信号进 行采样得到数字信号,采样频率越高,得到的数字信号对模拟信号的描述越准确;当采样频率较低时,得到的数字信号将难以恢复对应的模拟信号。本申请实施例中,设定的数组长度为5000,上述采样参数具体可根据实际需求进行设定。
步骤210:对当前数组中的数据进行带通滤波,消除数据频带外的噪声干扰;
在步骤210中,本申请实施例采用的滤波器为FIR滤波器((Finite Impulse Response,有限长单位冲激响应滤波器),通带频率为8KHz-12KHz,窗口采用Hanning窗(汉宁窗),滤波器阶数为25阶,上述滤波参数具体可根据实际需求进行设定。
步骤220:对当前数组进行同步帧头检测,并判断在当前数组中是否检测到同步帧头,如果在当前数组中检测到同步帧头,执行步骤230;
在步骤220中,本申请实施例采用相关法对数组进行同步帧头检测。具体如图4与图5所示,图4为同步帧头经过Manchester编码得到的比特流,图5为本申请实施例的帧头检测流程图。本申请实施例的帧头检测方法包括以下步骤:
步骤221:顺序计算当前数组中的数据与特定数组的相关系数;
在步骤221中,特定数组为特定长度的相关窗,该相关窗的大小为一个符号周期内的采样点数,特定数组中的元素为特定原始数据比特对应的期望值。本申请实施例中,采用的特定原始数据比特为“1”,对应的Manchester码为“01”,对应的相关窗为[-1,-1,1,1]。相关系数的计算公式如下:
Figure PCTCN2017075980-appb-000001
在公式(1)中,x1k表示数组1中的数据,x2k表示数组2中的数据,
Figure PCTCN2017075980-appb-000002
表示数组1中的数据均值,
Figure PCTCN2017075980-appb-000003
表示数组2中的数据均值,k表示数组下标,k=1,2,…,n,n表示数组中的数据个数。
步骤222:判断计算出的相关系数是否大于设定的第一门限值,如果相关系数大于设定的第一门限值,则表示检测到同步帧头,同步帧头检测结束;如果相关系数未大于设定的第一门限值,则执行步骤223;
在步骤222中,如果数组中检测到同步帧头,则表示当前数组为有效数组,同步帧头后的一段数据即为有效数据;如果当前数组中没有检测到同步帧头,表示当前数组处理结束。本申请实施例中,判断相关系数的第一门限值为0.6,具体可根据实际应用进行设定。
步骤223:判断计算相关系数的当前数据位置是否到达当前数组的尾部,如果到达当前数组的尾部,表示当前数组检测完毕,且没有检测到同步帧头,则当前数组处理结束;如果没有到达当前数组的尾部,则将相关窗向后滑动一步,并重新执行步骤221;
在步骤223中,假设当前数组长度为6,采用的特定数组为[-1,-1,1,1],首先计算当前数组的第1位数据至第4位数据与特定数组的相关系数,如果计算出的相关系数大于设定第一门限值,表示检测到同步帧头,则可执行后续步骤;如果计算出的相关系数未大于设定第一门限值,表示还没有检测到同步帧头,则将相关窗向后滑动一步(即后移一个数据),计算当前数组的第2位数据至第5位数据与特定数组的相关系数…,以此类推,直到滑动相关窗至当前数组的最后一个数据。
步骤230:对同步帧头后的有效数据进行Manchester解码,得到对应的原始数据;
在步骤230中,本申请实施例采用相关法对有效数据进行Manchester解码。具体请参阅图6,是本申请实施例的数据解码流程图。本申请实施例的数据解码方式包括以下步骤:
步骤231:顺序检测有效数据中的波峰或者波谷,当检测到波峰或者波谷时,执行步骤232;
在步骤231中,波峰是指波在一个波长的范围内,波幅的最大值,与之相 对的最小值则被称为波谷;以横波为例,突起的最高点就是波峰,陷下的最低点就是波谷。
步骤232:判断该波峰或者波谷是否大于设定的第二门限值;如果该波峰或者波谷大于设定的第二门限值,则执行步骤233;如果该波峰或者波谷未大于设定的第二门限值,则相关窗向后滑动一步,并重新执行步骤231;
在步骤232中,本申请实施例中判断波峰或者波谷的第二门限值为0.8,具体可根据实际应用进行设定,相关窗滑动方式同步骤223,此处将不再赘述。
步骤233:比特解析:如果检测到的是波峰,则解析为“1”,如果检测到的是波谷,则解析为“0”,并将相关窗向后滑动M步(即后移M个数据);
在步骤233中,M为一个符号周期的采样点数,本申请实施例中M的值为4。
步骤234:判断相关窗是否到达当前数组尾部,如果相关窗到达当前数组尾部,则输出解析结果,当前数组的比特解析结束;如果相关窗没有到达当前数组尾部,则重新执行步骤231。
步骤240:将解析的原始数据进行CRC校验后,展示解析结果。
本申请实施例的基于音频信道的数字通信方法在接收端采用相关法对接收到的模拟信号进行采样,并将采样数据进行滤波、同步帧头检测和Manchester解码处理后得到原始数据,提高了解码成功率和准确度,解决了信号波形严重畸变时的解调问题。
请参阅图7,是本申请实施例的基于音频信道的数字通信装置的结构示意图。本申请实施例的基于音频信道的数字通信装置包括发送端和接收端,发送端和接收端分别设有音频接口(图未示),发送端和接收端通过音频接口相互连接。
具体地,发送端包括第一控制模块和第一音频通信模块;第一控制模块用于采用Manchester编码将待发送的原始数据组包和编码后,将数据包传递至第一音频通信模块;第一音频通信模块用于将数据包中的数字信号转换为模拟信 号后,通过音频信道发送模拟信号。
第一控制模块包括组包单元和编码单元;
组包单元用于将待发送的原始数据进行组包;将待发送的原始数据进行组包具体为:将同步帧头、数据字段和CRC校验码组成数据包,数据包的长度由同步帧头长度、数据字段长度和CRC校验值长度共同决定。在本申请实施例中,采用的同步帧头为0xFF,0x5A,数据字段包括数据类型8bit、数据长度8bit、包序号8bit和原始数据56bit,数据字段具体根据应用环境的不同而不同。CRC校验码即循环冗余校验码,为数据字段的校验值,由数据字段计算得到,CRC多项式为:1+X+X2+X8。本申请实施例的数据包结构如下表1所示:
表1数据包结构
字段名 同步帧头 数据字段 CRC
长度(bit) 16 80 8
编码单元用于对组包后的数据包进行编码;其中,对数据包进行编码具体为:采用Manchester编码技术对数据包进行编码,Manchester编码将时钟信号包含在数据流中,具有自同步能力和良好的抗干扰性能。具体编码方式为:将数据包中的原始数据“0”映射为“10”,将原始数据“1”映射为“01”。设每个原始比特(bit)占用的传输时间为T,那么Manchester编码后每个比特的传输时间为T/2。在本申请实施例中,T为0.1ms,数据传输速率为10Kbps。
第一音频通信模块将编码后的数据包调制为信道上的模拟信号后,通过音频信道发送模拟信号;其中,将编码后的数据包调制为信道上的模拟信号具体为:将编码后的数字信号映射到音频信道上;映射方式为:数字信号“0”对应模拟信号的低电平-V,数字信号“1”对应模拟信号的高电平+V。数字信号“0”和“1”的保持时间都是T/2。在信道噪声一定的情况下,电平V的大小决定了接收端信号的信噪比,电平V的值越大,信噪比越高,反之,则信噪比越低;在本申请实施例中,电平V的值设定为500mV。在信道条件一定的情况下,T的大小决定了接收端信号的可辨识度,T越大,信号畸变对整体波形的影响越小,信号可 辨识度越高,反之,信号可辨识度越低。
接收端包括第二音频通信模块和第二控制模块,第二音频通信模块用于采用相关法对接收到的模拟信号进行采样,并将采样数据传递至第二控制模块;第二控制模块用于将采样数据进行滤波、同步帧头检测和Manchester解码处理后,得到原始数据。
第二音频通信模块对模拟信号进行采样具体为:以采样频率fs对模拟信号进行采样得到数字信号,并将采样得到的数据按照设定长度组成数组;采样频率越高,得到的数字信号对模拟信号的描述越准确;当采样频率较低时,得到的数字信号将难以恢复对应的模拟信号。
第二控制模块包括滤波单元、帧头检测单元、解码单元和校验单元;
滤波单元用于对当前数组中的数据进行带通滤波,消除数据频带外的噪声干扰;本申请实施例采用的滤波器为FIR滤波器,通带频率为8KHz-12KHz,窗口采用Hanning窗,上述滤波参数具体可根据实际需求进行设定。
帧头检测单元用于对当前数组进行同步帧头检测,并判断在当前数组中是否检测到同步帧头,如果在当前数组中检测到同步帧头,通过解码单元进行解码;其中,本申请实施例采用相关法对数组进行同步帧头检测。帧头检测方法包括:
a1:顺序计算当前数组中的数据与特定数组的相关系数;其中,特定数组为特定长度的相关窗,该相关窗的大小为一个符号周期内的采样点数,特定数组中的元素为特定原始数据比特对应的期望值。本申请实施例中,采用的特定原始数据比特为“1”,对应的Manchester码为“01”,对应的相关窗为[-1,-1,1,1]。相关系数的计算公式如下:
Figure PCTCN2017075980-appb-000004
在公式(1)中,x1k表示数组1中的数据,x2k表示数组2中的数据,
Figure PCTCN2017075980-appb-000005
表 示数组1中的数据均值,
Figure PCTCN2017075980-appb-000006
表示数组2中的数据均值,k表示数组下标,k=1,2,…,n,n表示数组中的数据个数。
a2:判断计算出的相关系数是否大于设定的第一门限值,如果相关系数大于设定的第一门限值,则表示检测到同步帧头,同步帧头检测结束;如果相关系数未大于设定的第一门限值,执行a3;其中,如果数组中检测到同步帧头,则表示当前数组为有效数组,同步帧头后的一段数据即为有效数据;如果当前数组中没有检测到同步帧头,表示当前数组处理结束。本申请实施例中,判断相关系数的第一门限值为0.6,具体可根据实际应用进行设定。
a3:判断计算相关系数的当前数据位置是否到达当前数组的尾部,如果到达当前数组的尾部,表示当前数组检测完毕,且没有检测到同步帧头,则当前数组处理结束;如果没有到达当前数组的尾部,则将相关窗向后滑动一步,并重新执行a1;其中,假设当前数组长度为6,采用的特定数组为[-1,-1,1,1],首先计算当前数组的第1位数据至第4位数据与特定数组的相关系数,如果计算出的相关系数大于设定第一门限值,表示检测到同步帧头,则可执行后续步骤;如果计算出的相关系数未大于设定第一门限值,表示还没有检测到同步帧头,则将相关窗向后滑动一步(即后移一个数据),计算当前数组的第2位数据至第5位数据与特定数组的相关系数…,以此类推,直到滑动相关窗至当前数组的最后一个数据。
编码单元用于将同步帧头后的有效数据进行Manchester解码,得到对应的原始数据;本申请实施例采用相关法对有效数据进行Manchester解码。数据解码方式包括:
b1:顺序检测有效数据中的波峰或者波谷,当检测到波峰或者波谷时,执行b2;
b2:判断该波峰或者波谷是否大于设定的第二门限值;如果该波峰或者波谷大于设定的第二门限值,则执行b3;如果该波峰或者波谷未大于设定的第二门限值,则相关窗向后滑动一步,并重新执行b1;其中,本申请实施例中判断 波峰或者波谷的第二门限值为0.8,具体可根据实际应用进行设定。
b3:比特解析:如果检测到的是波峰,则解析为“1”,如果检测到的是波谷,则解析为“0”,并将相关窗向后滑动M步;其中,M为一个符号周期的采样点数,本申请实施例中M的值为4;
b4:判断相关窗是否到达当前数组尾部,如果相关窗到达当前数组尾部,则输出解析结果,当前数组的比特解析结束;如果相关窗没有到达当前数组尾部,则重新执行b1。
校验单元用于将解析的原始数据进行CRC校验后,展示解析结果。
上述实施例中,所述的发送端和接收端包括具有音频接口的终端设备,发送端例如耳式温度计、心率耳机等,接收端例如智能手机、电脑等,以发送端为心率耳机、接收端为智能手机为例,其基于音频信道的数字通信方法包括:通过心率耳机采集心率数据,并采用Manchester编码将采集的心率数据进行组包、编码、调制后,通过音频信道将心率数据传递至智能手机;智能手机采用相关法对接收到的心率数据进行采样,并将采样数据进行滤波、同步帧头检测和Manchester解码后处理,通过智能手机或智能手机上安装的应用程序显示心率数据。
上述实施例为本申请较佳的实施方式,但本申请的实施方式并不受上述实施例的限制,其他的任何未背离本申请的精神实质与原理下所作的改变、修饰、替代、组合、简化,均应为等效的置换方式,都包含在本申请的保护范围之内。

Claims (18)

  1. 一种基于音频信道的数字通信方法,其特征在于,包括:
    步骤a:发送端将待发送的原始数据组包,并对组包后的数据包进行Manchester编码,通过音频信道发送所述编码后的数据包;
    步骤b:接收端对所述发送端发送的数据包进行采样,并对采样数据进行同步帧头检测和Manchester解码处理,得到原始数据。
  2. 根据权利要求1所述的基于音频信道的数字通信方法,其特征在于,在所述步骤a中,所述发送端将待发送的原始数据组包具体为:将同步帧头、数据字段和CRC校验码组成数据包。
  3. 根据权利要求1或2所述的基于音频信道的数字通信方法,其特征在于,在所述步骤b中,所述接收端对发送端发送的数据包进行采样还包括:将采样数据组成数组。
  4. 根据权利要求3所述的基于音频信道的数字通信方法,其特征在于,在所述步骤b中,所述对采样数据进行同步帧头检测具体为:采用相关法对当前数组进行同步帧头检测。
  5. 根据权利要求4所述的基于音频信道的数字通信方法,其特征在于,在所述步骤b中,所述采用相关法对当前数组进行同步帧头检测具体包括:
    步骤b10:顺序计算所述当前数组中的数据与特定数组的相关系数;其中,所述特定数组为相关窗,所述相关窗的大小为一个符号周期内的采样点数;
    步骤b11:判断计算出的相关系数是否大于第一门限值,如果相关系数大于第一门限值,表示检测到同步帧头,所述同步帧头后的一段数据即为有效数据;如果相关系数未大于第一门限值,则执行步骤b12;
    步骤b12:判断计算相关系数的当前数据位置是否到达当前数组的尾部,如果到达当前数组的尾部,则当前数组处理结束;如果没有到达当前数组的尾部,则将相关窗向后滑动一步,并重新执行步骤b10。
  6. 根据权利要求5所述的基于音频信道的数字通信方法,其特征在于,在所述步骤b中,所述对采样数据进行Manchester解码具体为:采用相关法对所述同步帧头后的有效数据进行Manchester解码。
  7. 根据权利要求6所述的基于音频信道的数字通信方法,其特征在于,所述Manchester解码具体包括:
    步骤b20:顺序检测所述有效数据中的波峰或者波谷,当检测到波峰或者波谷时,执行步骤b21;
    步骤b21:判断所述波峰或者波谷是否大于第二门限值;如果所述波峰或者波谷大于第二门限值,则执行步骤b22;如果所述波峰或者波谷未大于第二门限值,则相关窗向后滑动一步,并重新执行步骤b20;
    步骤b22:比特解析:如果检测到的是波峰,则解析为“1”,如果检测到的是波谷,则解析为“0”,并将相关窗向后滑动M步;所述M为一个符号周期的采样点数。
  8. 根据权利要求7所述的基于音频信道的数字通信方法,其特征在于,所 述将相关窗向后滑动M步还包括:
    步骤b23:判断所述相关窗是否到达当前数组尾部,如果所述相关窗到达当前数组尾部,则输出所述比特解析的结果;如果所述相关窗没有到达当前数组尾部,则重新执行步骤b20。
  9. 根据权利要求8所述的基于音频信道的数字通信方法,其特征在于,在所述步骤b中,所述对采样数据进行Manchester解码还包括:将所述解析结果进行CRC校验后,展示解析结果。
  10. 一种基于音频信道的数字通信装置,其特征在于,包括发送端和接收端;
    所述发送端包括第一控制模块和第一音频通信模块,所述第一控制模块用于将待发送的原始数据组包,并对组包后的数据包进行Manchester编码,所述第一音频通信模块用于通过音频信道发送编码后的数据包;
    所述接收端包括第二音频通信模块和第二控制模块,所述第二音频通信模块用于对所述发送端发送的数据包进行采样,所述第二控制模块对采样数据进行同步帧头检测和Manchester解码处理,得到原始数据。
  11. 根据权利要求10所述的基于音频信道的数字通信装置,其特征在于,所述第一控制模块包括组包单元,所述组包单元用于将同步帧头、数据字段和CRC校验码组成数据包。
  12. 根据权利要求10或11所述的基于音频信道的数字通信装置,其特征在于,所述第二音频通信模块对发送端发送的数据包进行采样还包括:将采样 数据组成数组。
  13. 根据权利要求12所述的基于音频信道的数字通信装置,其特征在于,所述第二控制模块还包括帧头检测单元,所述帧头检测单元用于采用相关法对当前数组进行同步帧头检测。
  14. 根据权利要求13所述的基于音频信道的数字通信装置,其特征在于,所述帧头检测单元采用相关法对当前数组进行同步帧头检测具体包括:顺序计算所述当前数组中的数据与特定数组的相关系数;其中,所述特定数组为相关窗,所述相关窗的大小为一个符号周期内的采样点数;判断计算出的相关系数是否大于第一门限值,如果相关系数大于第一门限值,表示检测到同步帧头,所述同步帧头后的一段数据即为有效数据;如果相关系数未大于第一门限值,则判断计算相关系数的当前数据位置是否到达当前数组的尾部,如果到达当前数组的尾部,则当前数组处理结束;如果没有到达当前数组的尾部,则将相关窗向后滑动一步,并重新计算所述当前数组中的数据与特定数组的相关系数。
  15. 根据权利要求14所述的基于音频信道的数字通信装置,其特征在于,所述第二控制模块还包括解码单元,所述解码单元用于采用相关法对所述同步帧头后的有效数据进行Manchester解码.
  16. 根据权利要求15所述的基于音频信道的数字通信装置,其特征在于,所述解码单元采用相关法对同步帧头后的有效数据进行Manchester解码具体包括:
    顺序检测所述有效数据中的波峰或者波谷,当检测到波峰或者波谷时,判 断所述波峰或者波谷是否大于第二门限值;如果所述波峰或者波谷未大于第二门限值,则相关窗向后滑动一步,并重新检测所述有效数据中的波峰或者波谷;如果所述波峰或者波谷大于第二门限值,则进行比特解析:如果检测到的是波峰,则解析为“1”,如果检测到的是波谷,则解析为“0”,并将相关窗向后滑动M步;所述M为一个符号周期的采样点数。
  17. 根据权利要求16所述的基于音频信道的数字通信装置,其特征在于,所述将相关窗向后滑动M步还包括:判断所述相关窗是否到达当前数组尾部,如果所述相关窗到达当前数组尾部,则输出解析结果;如果所述相关窗没有到达当前数组尾部,则重新检测所述有效数据中的波峰或者波谷。
  18. 根据权利要求17所述的基于音频信道的数字通信装置,其特征在于,所述第二控制模块还包括校验单元,所述校验单元用于将所述解析结果进行CRC校验及展示解析结果。
PCT/CN2017/075980 2017-03-08 2017-03-08 一种基于音频信道的数字通信方法及装置 WO2018161277A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2017/075980 WO2018161277A1 (zh) 2017-03-08 2017-03-08 一种基于音频信道的数字通信方法及装置
CN201780000125.6A CN107004418B (zh) 2017-03-08 2017-03-08 一种基于音频信道的数字通信方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/075980 WO2018161277A1 (zh) 2017-03-08 2017-03-08 一种基于音频信道的数字通信方法及装置

Publications (1)

Publication Number Publication Date
WO2018161277A1 true WO2018161277A1 (zh) 2018-09-13

Family

ID=59435926

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/075980 WO2018161277A1 (zh) 2017-03-08 2017-03-08 一种基于音频信道的数字通信方法及装置

Country Status (2)

Country Link
CN (1) CN107004418B (zh)
WO (1) WO2018161277A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021072980A1 (zh) * 2019-10-18 2021-04-22 歌尔股份有限公司 一种耳机数据传输方法、系统、设备及计算机存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107863109B (zh) * 2017-11-03 2020-07-03 深圳大希创新科技有限公司 一种抑制噪声的静音控制方法及系统
CN115347979B (zh) * 2022-08-08 2023-09-01 新诺北斗航科信息技术(厦门)股份有限公司 一种识别ais帧头数据的方法、装置及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103002118A (zh) * 2011-09-20 2013-03-27 朱星宇 一种基于音频输入输出接口的数据传输方法
CN103124206A (zh) * 2011-11-21 2013-05-29 天津中兴软件有限责任公司 数据传输方法
CN204316513U (zh) * 2014-12-30 2015-05-06 李俊涛 一种基于声波的音频通信系统
CN104935527A (zh) * 2015-06-12 2015-09-23 福建新大陆电脑股份有限公司 一种音频通信的数据组包方法
CN205545212U (zh) * 2015-12-10 2016-08-31 重庆川仪自动化股份有限公司 基于fpga的曼彻斯特码的编解码器

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008037858A1 (fr) * 2006-09-29 2008-04-03 Christine Jominet Procédé de génération d'un signal multimédia, signal multimédia, procédé et dispositif de restitution, moyens de stockage et programmes d'ordinateur correspondants
CN101577580B (zh) * 2008-05-09 2012-10-10 北京大学 一种帧同步方法
CN101729192B (zh) * 2008-10-30 2013-08-07 杭州士兰微电子股份有限公司 一种用于无线射频遥控的编解码方法
JP2010263496A (ja) * 2009-05-08 2010-11-18 Sony Corp 信号処理装置、及び誤り訂正方法
US20130017887A1 (en) * 2011-07-14 2013-01-17 Wilson Keithline Game Controller System
CN102638335B (zh) * 2012-03-02 2014-11-26 北京大学 一种基于互相关和自相关级联的帧同步方法
CN102629875B (zh) * 2012-04-24 2015-09-16 广西大学 多摩川编码器的曼彻斯特编码的解码电路
CN103379214B (zh) * 2012-04-26 2015-10-28 国民技术股份有限公司 一种音频通信系统
US9697452B2 (en) * 2012-07-24 2017-07-04 On Track Innovations Ltd. Adapter for personal electronic devices and methods of use thereof
CN102932103B (zh) * 2012-10-22 2016-04-20 武汉烽火富华电气有限责任公司 一种基于数字化变电站的数据传输速率自适应接收方法
CN103222858A (zh) * 2013-04-09 2013-07-31 浙江铭众生物医学创业投资有限公司 一种基于音频接口通信的耳式体温计及其通信方法
CN103220428A (zh) * 2013-04-17 2013-07-24 南京三宝科技股份有限公司 一种用于手机的音频信号数据通信方法
CN103926867A (zh) * 2014-05-04 2014-07-16 张金奎 一种基于音频信号的信息传输方法
CN104301521B (zh) * 2014-09-17 2016-04-06 浙江铭众生物医学创业投资有限公司 一种基于手机音频接口的调制方式、通信电路及其通信方法
CN105162471B (zh) * 2015-08-24 2018-09-28 武汉瑞纳捷电子技术有限公司 一种差分曼彻斯特解码电路及方法
CN105703885B (zh) * 2015-12-08 2019-01-22 重庆川仪自动化股份有限公司 基于曼彻斯特码的解析方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103002118A (zh) * 2011-09-20 2013-03-27 朱星宇 一种基于音频输入输出接口的数据传输方法
CN103124206A (zh) * 2011-11-21 2013-05-29 天津中兴软件有限责任公司 数据传输方法
CN204316513U (zh) * 2014-12-30 2015-05-06 李俊涛 一种基于声波的音频通信系统
CN104935527A (zh) * 2015-06-12 2015-09-23 福建新大陆电脑股份有限公司 一种音频通信的数据组包方法
CN205545212U (zh) * 2015-12-10 2016-08-31 重庆川仪自动化股份有限公司 基于fpga的曼彻斯特码的编解码器

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021072980A1 (zh) * 2019-10-18 2021-04-22 歌尔股份有限公司 一种耳机数据传输方法、系统、设备及计算机存储介质
US11838062B2 (en) 2019-10-18 2023-12-05 Goertek Inc. Headset data transmission method, system, and device and computer storage medium

Also Published As

Publication number Publication date
CN107004418A (zh) 2017-08-01
CN107004418B (zh) 2021-06-22

Similar Documents

Publication Publication Date Title
CN107645343B (zh) 基于声波的数据发送/接收方法及数据传输系统
CN102832968B (zh) 一种利用音频接口在手机与设备之间进行通讯的方法
CN104320843B (zh) 蓝牙发声装置的音频同步方法
CN103312419B (zh) 基于音频或超声波的数据通讯方法和系统
CN103077723B (zh) 音频传输系统
CN104917671B (zh) 基于移动终端的音频处理方法和装置
WO2018161277A1 (zh) 一种基于音频信道的数字通信方法及装置
CN103701492B (zh) 线性调频信号调制解调的水声跳频通信方法
CN108988991B (zh) 带宽自适应的串行数据传输系统
CN108777596B (zh) 一种基于声波的通信方法、通信系统及计算机可读存储介质
CN104301521B (zh) 一种基于手机音频接口的调制方式、通信电路及其通信方法
CN104868956A (zh) 基于声波信道的数据通信方法
CN103297115B (zh) 一种短波广域分集接收装置及其接收方法
CN213906675U (zh) 一种便携式无线蓝牙录音设备
CN106375024A (zh) 声波通信系统及方法
US8532165B2 (en) Indicating and detecting the start of signal transmission employing frequency division multiplexing
CN103178936A (zh) 数字对讲机接收误码率测试方法、误码率测试装置及系统
CN106683682A (zh) 一种提高语音传输效率的方法
CN105472509A (zh) 音频信号发送、接收方法及装置
CN103685640B (zh) 一种基于音频线与智能终端通信的控制器及其通信方法
CN102546497B (zh) 一种采样数据的压缩方法及装置
WO2020191585A1 (zh) 信号传输方法、系统、主动笔、触控屏和可读存储介质
US20140101054A1 (en) System and method of transmitting data over a voice channel
CN203722673U (zh) 一种基于音频线与智能终端通信的控制器
CN203057167U (zh) 一种利用制式通信系统传输加密语音的收发装置

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: 17899475

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: 17899475

Country of ref document: EP

Kind code of ref document: A1