CN113556185B - Data communication method and system based on sound carrier - Google Patents
Data communication method and system based on sound carrier Download PDFInfo
- Publication number
- CN113556185B CN113556185B CN202110870798.5A CN202110870798A CN113556185B CN 113556185 B CN113556185 B CN 113556185B CN 202110870798 A CN202110870798 A CN 202110870798A CN 113556185 B CN113556185 B CN 113556185B
- Authority
- CN
- China
- Prior art keywords
- data
- frequency
- sound wave
- sound
- sliding window
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000004891 communication Methods 0.000 title claims abstract description 43
- 238000000034 method Methods 0.000 title claims abstract description 39
- 239000000872 buffer Substances 0.000 claims abstract description 55
- 230000005540 biological transmission Effects 0.000 claims abstract description 33
- 238000004458 analytical method Methods 0.000 claims abstract description 13
- 238000005070 sampling Methods 0.000 claims description 16
- 238000004364 calculation method Methods 0.000 claims description 11
- 230000007613 environmental effect Effects 0.000 claims description 4
- 230000008901 benefit Effects 0.000 description 7
- QVFWZNCVPCJQOP-UHFFFAOYSA-N chloralodol Chemical compound CC(O)(C)CC(C)OC(O)C(Cl)(Cl)Cl QVFWZNCVPCJQOP-UHFFFAOYSA-N 0.000 description 6
- 230000033001 locomotion Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000012216 screening Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 239000000969 carrier Substances 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 210000005069 ears Anatomy 0.000 description 2
- 239000000284 extract Substances 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000013016 damping Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000013075 data extraction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 230000009545 invasion Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000035772 mutation Effects 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 230000001902 propagating effect Effects 0.000 description 1
- 238000013215 result calculation Methods 0.000 description 1
- 238000011076 safety test Methods 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B11/00—Transmission systems employing sonic, ultrasonic or infrasonic waves
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephonic Communication Services (AREA)
- Reduction Or Emphasis Of Bandwidth Of Signals (AREA)
Abstract
The invention discloses a data communication method and a system based on sound carrier waves, comprising the following steps: the receiving end receives the data frame sent by the sending end and stores the received data frame into the sound data buffer area; the data frame includes: a start segment, a data segment and a cut-off segment; setting the length and the sliding step length of a data pickup sliding window on a sound data buffer area; the initial position of the leftmost side of the data pick-up sliding window is the same as the initial address of the sound data buffer area; sliding a data pickup sliding window on a sound data buffer area, and performing Fourier transform on a data frame in the data pickup sliding window once sliding to obtain frequency and amplitude; and analyzing the received data frame based on the frequency and the amplitude obtained each time to obtain an analysis result. The minimum data unit of sound wave transmission is defined as characters, so that the data transmission speed is improved well.
Description
Technical Field
The present invention relates to the field of data communication technologies, and in particular, to a data communication method and system based on a voice carrier.
Background
The statements in this section merely provide background information related to the present disclosure and may not constitute prior art.
The propagation of vibrations generated by a sound producing body in air or other substances is called sound waves. An acoustic wave is a mechanical wave that propagates in all directions through various media, and a mass point where the acoustic wave arrives vibrates near an equilibrium position along a propagation direction, and the propagation of the acoustic wave is substantially energy transfer in the media. In the process of propagation, the sound waves are mainly longitudinal waves and also have a small amount of transverse waves. Acoustic waves propagate at significantly different speeds in different media. It has been measured that the acoustic velocity in air at normal temperature and pressure is 344m/s, but the acoustic velocity changes with the temperature and pressure of the propagation medium. The normal temperature is the air temperature at 20 ℃, when the air temperature is reduced to zero, the speed of sound wave propagating in the air is 331.5m/s, and the sound speed is increased by 0.607m/s when the air temperature is increased by 1 ℃. Since the sound wave is easily interfered by external environment and sound as a carrier, a point-to-point communication mode is mostly adopted in practical application.
Currently, a point-to-point wireless communication technology is mature, for example, loRa wireless communication, a communication carrier wave of the LoRa wireless communication adopts a fixed frequency, and point-to-point communication of data is realized through an ASK or FSK modulation mode. However, in the informatization modification project of the industrial control system, in order to ensure the safe operation of the control system, any board card and communication module are not allowed to be added in the intranet of the industrial control system, so that potential safety hazards to the industrial control system are prevented, and therefore, the communication technology similar to the LoRa cannot be applied to the industrial control system. If a code passing the safety test is added on a monitoring alarm computer in the original industrial control system, the sound card sends out ultrasonic which can not be heard by human ears as a carrier wave, and the intranet information of the industrial control system is transmitted to the extranet, so that the data transmission can be realized, any invasion of the extranet to the intranet can not be increased, and the safety and the reliability of the original industrial control system can be better met. In such a similar application scenario that sound waves are used as carriers, the problems of interference resistance and slow transmission rate of sound waves used as carriers must be solved first, otherwise reliable and fast data transmission cannot be achieved.
Disclosure of Invention
In order to solve the deficiency of the prior art, the invention provides a data communication method and a system based on sound carrier waves;
in a first aspect, the present invention provides a data communication method based on a voice carrier;
the data communication method based on the sound carrier comprises the following steps:
the receiving end receives the data frame sent by the sending end and stores the received data frame into the sound data buffer area; the data frame includes: a start segment, a data segment and a cut-off segment;
setting the length and the sliding step length of a data pickup sliding window on a sound data buffer area; the initial position of the leftmost side of the data pick-up sliding window is the same as the initial address of the sound data buffer area;
sliding a data pickup sliding window on a sound data buffer area, and performing Fourier transform on a data frame in the data pickup sliding window once sliding to obtain frequency and amplitude; and analyzing the received data frame based on the frequency and the amplitude obtained each time to obtain an analysis result.
In a second aspect, the present invention provides a data communication system based on a voice carrier;
a data communication system based on a voice carrier, comprising: a receiving end and a transmitting end;
the receiving end receives the data frame sent by the sending end and stores the received data frame into the sound data buffer area; the data frame includes: a start segment, a data segment and a cut-off segment;
setting the length and the sliding step length of a data pickup sliding window on a sound data buffer area; the initial position of the leftmost side of the data pickup sliding window is the same as the initial address of the sound data buffer area;
sliding a data pickup sliding window on a sound data buffer area, and performing Fourier transform on a data frame in the data pickup sliding window once sliding to obtain frequency and amplitude; and analyzing the received data frame based on the frequency and the amplitude obtained each time to obtain an analysis result.
Compared with the prior art, the invention has the beneficial effects that:
compared with wireless communication, taking LoRa as an example, in point-to-point wireless transmission, transmitted data is obtained by modulating and demodulating ASK or FSK of a carrier wave, wherein in both ASK or FSK modes, strict requirements are imposed on a carrier time slice of a minimum data unit, and since an acoustic wave changes along with the change of ambient temperature during transmission, the transmitted data cannot be specifically determined through the time slice.
The data information in the sound wave carrier is determined by adopting a mode of mainly using frequency and secondarily using time so as to achieve the compatibility that the speed is variable in sound wave transmission; secondly, compared with point-to-point wireless transmission, the data transmission speed of sound wave communication is reduced due to the fact that the transmission time of the sound wave to the minimum data unit is prolonged, and in order to improve the data communication speed of the sound wave, the minimum data unit of sound wave transmission is defined as characters instead of 0 or 1 in a two-bit system, and the data transmission speed is improved well.
Advantages of additional aspects of the invention will be set forth in part in the description which follows, or may be learned by practice of the invention.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the invention and together with the description serve to explain the invention and not to limit the invention.
FIG. 1 is a diagram of an audio data buffer and a data pick-up sliding window according to a first embodiment;
fig. 2 is a flow chart of the method of the first embodiment.
Detailed Description
It is to be understood that the following detailed description is exemplary and is intended to provide further explanation of the invention as claimed. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the invention. As used herein, the singular is intended to include the plural unless the context clearly dictates otherwise, and furthermore, it should be understood that the terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The embodiments and features of the embodiments of the present invention may be combined with each other without conflict.
All data are obtained according to the embodiment and are legally applied on the data on the basis of compliance with laws and regulations and user consent.
Example one
The embodiment provides a data communication method based on sound carrier waves;
the data communication method based on the sound carrier comprises the following steps:
s1: the receiving end receives the data frame sent by the sending end and stores the received data frame into the sound data buffer area; the data frame includes: a start segment, a data segment, and a cutoff segment;
s2: setting the length and the sliding step length of a data pickup sliding window on a sound data buffer area; the initial position of the leftmost side of the data pick-up sliding window is the same as the initial address of the sound data buffer area;
s3: sliding a data pickup sliding window on a sound data buffer area, and performing Fourier transform on a data frame in the data pickup sliding window once sliding to obtain frequency and amplitude; and analyzing the received data frame based on the frequency and the amplitude obtained each time to obtain an analysis result.
Further, as shown in fig. 2, the S3: sliding a data pickup sliding window on a sound data buffer area, and performing Fourier transform on a data frame in the data pickup sliding window once sliding to obtain frequency and amplitude; analyzing the received data frame based on the frequency and the amplitude obtained each time to obtain an analysis result; the method specifically comprises the following steps:
s301: carrying out Fourier transform on data in the data pickup sliding window to obtain frequency and amplitude;
s302: judging whether the obtained frequency is the sound wave frequency of the initial section of the data frame, if so, recording the amplitude, moving the window of the pickup buffer area, and returning to S301; if not, recording the amplitude, calculating by using the recorded amplitude to obtain a set threshold value delta A of the data segment sound wave amplitude, and entering S303;
s303: moving the window of the picking buffer area, and carrying out Fourier transform on data in the window to obtain a new frequency and a new amplitude;
s304: judging whether the new frequency is equal to the acoustic frequency of the data frame cut-off section; if yes, go to S305;
if not, judging whether the new amplitude is larger than a set threshold value delta A and the new frequency is the frequency contained in the data segment; if yes, recording a new frequency and the continuous occurrence frequency of the new frequency, and entering S303; if not, directly entering S303;
s305: judging whether the new amplitude is larger than a set threshold value or not; if yes, go to S306; if not, returning to S303;
s306: and according to the moving length of the window of the data pickup buffer area, the sampling frequency of the sound wave and the sound wave frequency in the data section, combining and recording the new frequency and the continuous occurrence times of the new frequency to obtain a corresponding data frame analysis result.
Further, the threshold Δ a is set, and the calculation formula is:
wherein, a represents the sliding step length, b represents the length of the data pick-up sliding window, and the value range of n is 0.3-0.8.
n is selected based on the environmental noise during sound wave transmission, and is 0.8 when the environmental noise is greater than a set threshold value; and taking 0.3 when the noise is less than the set threshold, wherein the value is selected before the equipment communication, sending continuous initial section sound wave signals through the sending end, continuously analyzing the received sound wave data through the receiving end, carrying out Fourier transform to obtain the frequency and amplitude of the initial section signals, and obtaining the amplitude deviation of the frequency according to repeated analysis. And determining the specific value of the parameter n according to the principle that 2 times of the maximum value in the amplitude deviation is less than delta A.
Wherein, the amplitude deviation corresponding to the same frequency is less than or equal to Δ a, and the amplitudes are regarded as the same amplitude; and according to the duration of the sound wave with the fixed frequency of one number in the data section sent by the sending end, the number of the continuous same amplitude values is calculated to obtain the frequency of sampling the sound wave signal with the fixed frequency by the data pickup sliding window.
And when the receiving end analyzes the frequency times of continuous same amplitude, corresponding to the time length of the sound wave signal sent by the sending end, analyzing the data to obtain the transmission data of the data frame.
Illustratively, the data pickup sliding window is a fixed length, preferably 1024 bytes in length; the receiving end obtains the original data from the sound data buffer area of the receiving end through the data pickup sliding window for analysis. The data in the data pickup sliding window is derived from a sound data buffer area, and the specific method comprises the following steps:
data extraction is achieved by copying 1024 bytes of data from the sound data buffer or by pointing to the sound data buffer with a pointer in turn.
When audio data is received and analyzed, the audio data buffer is a variable-length buffer, but for data analysis, the length of the audio data buffer is fixed, and all the audio data buffers are finally analyzed.
The relation of the sound data buffer to the data pick-up sliding window is shown in fig. 1.
When sound wave data are analyzed for the first time, the initial address of the data acquisition sliding window is the same as the initial address of the sound data buffer area, and the data in the data acquisition sliding window are analyzed;
and then, sliding the initial address of the data pickup sliding window in sequence to obtain new data, wherein each sliding does not update all data in the data pickup sliding window, but only updates 3.125% -25% of data in the data pickup sliding window, and then analyzing the content of the data pickup sliding window.
It should be noted that when the end address of the sound data buffer is exceeded after the last sliding of the data pickup sliding window, the end address of the data pickup sliding window is adjusted to be aligned with the end address of the sound data buffer, and therefore, the step size of the last sliding of the data pickup sliding window is smaller than the step size of the set sliding.
Taking the length of the data pickup sliding window as 1024 bytes as an example, the length of each movement is 32 bytes, so that the advantage that the sound wave data can be completely decoded and analyzed by the receiving end as long as the length of the sound wave segment carrying the data sent by the sending end exceeds 1056 bytes.
If the sampling width of the sound wave of the computer integrated sound card is 16 bits and the sampling rate is 44.1kHz, the computer sound card can generate sound data with 88.2kHz bytes per second, and when the length of the data pickup sliding window is set to be 1024 bytes as an example, and the length of each movement is 32 bytes, if the length of the fixed frequency sound wave in the data section sent by the sending end is 14ms, the receiving end samples 1234 data, so that the length of the fixed frequency sound wave in the data section sent by the sending end can be shortened to the maximum extent through the data pickup sliding window and the movement length, and the problem of low data communication rate of sound carrier waves is solved.
Further, the data frame includes: a start segment, a data segment and a cut-off segment; the starting section and the cut-off section are both fixed frequency acoustic wave bands with set length; the data segment comprises at least one acoustic wave segment with a set length and a fixed frequency; each fixed-frequency sound wave band with set length represents a unique number; the frequencies of the respective acoustic wave segments contained in the start segment, the data segment, and the cutoff segment are different.
For example, taking the data sampling of the computer sound card as 16bit and 44.1kHz as an example, the length of the data pickup sliding window is set to 1024 bytes, and each time the moving length is 32 bytes, the length of each fixed frequency sound wave in the data segment can be defined as 14ms. The frequencies corresponding to the unique numbers in the data frame are shown in table 1.
Table 1: one-to-one correspondence of data to acoustic frequencies in a data segment
Number of | Frequency (Unit: kHz) |
0 | 17.0 |
1 | 17.2 |
2 | 17.4 |
3 | 17.6 |
4 | 17.8 |
5 | 18.0 |
6 | 18.2 |
7 | 18.4 |
8 | 18.6 |
9 | 18.8 |
A | 19.0 |
B | 19.2 |
C | 19.4 |
D | 19.6 |
E | 19.8 |
F | 20.0 |
It should be noted that the table is only exemplary, and those skilled in the art can change the frequency and the corresponding relationship between the data and the frequency according to the concept of the present invention. Here, an embodiment of the inventive concept will be suggested to those skilled in the art without having to resort to the inventive teaching that each frequency represents a unique decimal or octal number, and thus such embodiments are within the scope of the inventive concept.
Further, the receiving end receives the data frame sent by the sending end; the sound wave frequency of the data frame sent by the sending end is 15 kHz-20 kHz.
It should be understood that the frequency of the sound wave in the data frame transmitted by the transmitting end is 15kHz to 20kHz. The advantages are that the sound wave in the frequency band can not be heard by human ears, which is beneficial to the confidentiality of communication data and is not easily interfered by the speaking sound of people in the environment.
Further, the data segment comprises at least one acoustic wave segment with a set length and a fixed frequency; and the sound wave frequency in the data section is sequentially and symmetrically selected by taking the sound wave frequency of the initial section as a center.
Illustratively, the sequential symmetrical selection means that the sound wave frequency of the initial section is set to be a fixed value, such as 18.4kHz, from 18.6kHz to 20kHz, and a sound wave frequency is set at intervals of every 200Hz, which represents a unique number; from 18.2kHz to 16.8kHz, a sonic frequency is also set at intervals of every 200Hz, representing a unique number. The advantage of this is that the sound wave frequency representing each digit is symmetrically distributed on both sides of the sound wave frequency of the initial segment, and under the condition of short transmission, the transmission condition can be considered to be the same, and the attenuation of each sound wave in the data segment is closer to the 18.4kHz attenuation of the sound wave frequency of the initial segment, thereby further improving the anti-interference performance of communication.
It should be understood that the acoustic frequencies in the data segment are sequentially and symmetrically selected by taking the acoustic frequency of the initial segment as a center; the method is favorable for reducing the consistency of the influence of noise on the carrier wave, the amplitude after Fourier transform does not cause mutation relative to the sound wave amplitude of the initial section, the adaptability of each frequency amplitude threshold value in the data section is improved, the misjudgment of data is reduced, and the transmission speed of sound wave communication is further improved.
Preferably, the number of acoustic frequencies in the data segment is ten to correspond to each of the decimal numbers. Compared with wireless communication, in the case of LoRa, one frequency represents decimal data instead of binary bits in transmission, so that the data transmission rate of sound waves is improved.
Preferably, the number of acoustic frequencies in the data segment is sixteen to correspond to each of the hexadecimal numbers. Compared with wireless communication, in the case of LoRa, one frequency represents hexadecimal data instead of binary bits in transmission, so that the data transmission rate of sound waves is improved better.
Further, the frequency of the starting section is 19KHz, and the interval between adjacent frequencies of the sound waves in the data section is 120Hz.
It will be appreciated that the technical advantage of the above scheme is that the frequency of the start segment is the centre frequency, and when transmitting in hexadecimal numbers, occupies a frequency range of-960 to 960Hz. Compared with the center frequency of the initial section, the up-down extension is less than 1KHz, and the anti-interference performance of communication is effectively improved. Particularly, when the frequency of the initial section of the sound wave is defined to be 19KHz, the sound wave is completely in a high frequency band, so that the human ear is least sensitive to the sound wave, the anti-interference performance of communication is improved, and noise which can be heard by the human ear is not generated.
Further, the data pickup sliding window refers to that the window extracts or maps the sound data from the sound data buffer or the sound data file of the receiving end to the data pickup sliding window, and the data processing of the receiving end is only directed to the data pickup sliding window. The data picking sliding window can be a buffer area with a fixed length, and sound data are copied to the data picking sliding window before data processing; the data pick-up sliding window can be a data pointer, the pointer is pointed to the sound data to be processed before each data processing, and the mapping of different sound data to the pick-up sliding window is realized through the movement of the pointer.
Further, in the initial state, the leftmost side of the data pickup sliding window is aligned with the start of the sound data of the received data frame, as shown in fig. 1.
Further, the data picking sliding window is smaller than one third of sampling data of each sound wave section with the set length and the fixed frequency in the data section, so that the sound wave section data with the set length and the fixed frequency in the data section are selected by the data picking sliding window in a sliding mode and subjected to Fourier transform three times or more. An odd number is preferred to facilitate data screening using majority rules.
It should be understood that the above technical solution has the advantages that: the method comprises the steps of segmenting any sound wave segment data with fixed length and fixed frequency in a data segment, carrying out Fourier transform on each segment to obtain more than three calculation results, comparing and screening the results to obtain real data transmission, filtering out noise and interference, effectively reducing the transmission times of the data and improving the success rate of data transmission.
Further, the data in the data section comprises the transmitted data and the CRC check bit. The CRC check bit is preferably CRC8, occupies 1 byte length, and is represented by two hexadecimal data.
It should be understood that the above technical solution has the advantages that: because each data is segmented for multiple times, multiple data can be obtained for each frequency, and when the data obtained by the same fixed-length frequency sent by the sending end is different, the detection result can be calculated by combining the transmitted data for multiple times, so that the accurate transmission of the data under the condition of strong interference is realized.
For example, the computer sound card has a sampling width of 16 bits for sound waves and a sampling rate of 44.1kHz, and generates sound data of 88200 bytes per second, and when the length of the data pickup sliding window is set to 1024 bytes as an example, and the length of each movement is 32 bytes, if the length of the fixed frequency sound wave representing a unique number in a data segment sent by the sending end is 14ms, the receiving end samples 1234 sound data, and the sound data is fourier-transformed at least 6 times to obtain 6 frequency and amplitude data, and a small number of different frequencies are removed from the 6 obtained frequency data, so as to enhance the anti-interference performance of sound wave communication.
The method greatly improves the sampling times of the data pickup sliding window under the condition of not greatly improving the transmission time of the sound wave with the same frequency of the data segment, and realizes the anti-noise function of the system.
After CRC is added, CRC calculation can be carried out on the frequency data of 6 times respectively, a group of data which is the same as the CRC check data is judged, noise is removed, and correct data are screened out. The CRC inspection method realizes screening of data segment transmission data by increasing data calculation amount, removes noise and extracts real data segment data.
The method better identifies correct data by carrying out multiple times of check calculation on data retransmission and anti-noise problems and judging which group of data is consistent with the check result calculated by the check data. The method has the defect of occupying computer processor resources, but because the data operation speed of the current common computer is generally in the order of GHz and the calculation capacity is hundreds of millions of times per second, the sound wave transmission is realized on the monitoring computer of the industrial control system, and the realization of other monitoring functions is not influenced.
Further, the step S306: according to the moving length of the data pickup buffer area window, the sampling frequency of the sound wave and the sound wave frequency in the data section, recording the new frequency and the continuous occurrence frequency of the new frequency in a combined manner to obtain a corresponding data frame analysis result; the method comprises the following specific steps:
s3061: calculating the maximum value of the Fourier transform times of the receiving end aiming at a digital sound wave signal when the sending end sends the sound wave signal according to the time length of the digital sound wave in the data section sent by the sending end and by combining the window of the data pickup buffer area and the sliding length;
wherein the maximum value of the Fourier transform times is: subtracting the byte number covered by the window of the data pick-up buffer area from the byte number of the data in the buffer area generated by a digital sound wave signal at a receiving end, dividing the result by the sliding length of each sliding, and adding 1 after the result is rounded;
s3062: multiplying the maximum value of the Fourier transform times by a set numerical value to obtain a product, and taking an integer closest to the product as the minimum judgment time of the infrasonic wave signal in the data sending segment of the sending end;
s3063: calculating the number N of times that the recorded amplitude of the new frequency is continuously larger than a set threshold value, and judging whether N is larger than or equal to the minimum judgment number of times;
s3064: if not, the transmitting end is considered not to transmit the sound wave data in the data section; if so, enabling N to obtain Q by performing module calculation on M, wherein Q +1 is the frequency of sending the sound wave signal with the new frequency by the sending end; wherein, M is data generated in the buffer area by representing a digital sound wave signal divided by the sliding step length and is an integer.
When Q is 0, the sending end is indicated to send a number in the data section only once, namely, a sound wave frequency signal represented by the number appears once; when Q is 1, the sending end continuously sends the number twice in the data section, namely, the sending end continuously sends the sound wave frequency signal represented by the number twice, and so on;
and finally, obtaining the data in the data section according to the sound wave frequency and a preset data-sound wave frequency one-to-one corresponding relation table.
The maximum value of the fourier transform times is multiplied by a set value, the value range of the set value is 70% to 75%, and the set value can be 0.714, for example.
In the example, the data sampling width of the computer sound card is 16bit, the sampling rate is 44.1kHz, the data sampled by the sound card at the receiving end per second is 88200 bytes, and the data forms the data of the data buffer area in the receiving end.
The start frequency is 16.0kHz, the cut-off frequency is 16.5kHz, and the data segment frequency is shown in Table 1. The sampling width of a computer sound card is 16 bits, the sampling rate is 44.1kHz, the length of a data pickup sliding window is assumed to be 1024 bytes, and when the length of each movement is 32 bytes, the length of a fixed frequency sound wave representing one digit in a data section sent by a sending end is 14 ms; as can be known from the following calculation, the receiving end samples the acoustic signal with fixed frequency of any 14ms duration to obtain 1234.8 bytes of sound data, and since the data sampling of the sound data is an integer, the sound data is 1234.8 after being rounded.
Because the sound wave signal of fixed frequency in any 14ms duration corresponds to 1234 bytes of sound data in a receiving end buffer area, according to the sliding rule of a data pickup sliding window, the sound wave data of the frequency at the receiving end is subjected to Fourier transform at most 7 times, wherein the data pickup sliding window slides for 6 times; at least 6 Fourier transforms are performed, wherein the data pickup sliding window slides for 5 times, and frequency and amplitude data after 6-7 Fourier transforms are obtained.
In order to ensure the accuracy and compatible noise of the sound wave data, 70% -75% of the maximum number of times of Fourier transform is taken, and the nearest integer is taken for result calculation, in the embodiment, 71.4% of the maximum number of times of Fourier transform is taken as the minimum judgment number of times of result, namely, the result of 5 times of Fourier transform is taken for calculation of the single sound wave signal sent by the sending end.
And when the initial segment is analyzed, continuously performing Fourier transform on the data for more than 5 times to respectively obtain 16.0kHz frequency and amplitude data, taking the maximum amplitude of the sound wave frequency of the continuous 5 times of 16.0kHz, and obtaining the amplitude threshold value delta A of the sound wave signal of the data segment according to a calculation formula of the delta A.
Wherein, a represents the sliding step length, b represents the length of the data picking sliding window, and the value range of n is 0.3-0.8.
According to the number of the same frequency and the same amplitude after Fourier transformation, the number of times of continuous data pickup sliding windows is obtained, the number of times of sliding of the continuous data pickup sliding windows represents the duration time of the acoustic data, signal frequency is obtained according to the Fourier transformation of the continuous data pickup sliding windows, the duration time of the frequency signal is obtained according to the number of times of sliding of the data pickup sliding windows, and then the number corresponding to the frequency signal is found according to the table 1.
Assuming that the length of the data pickup sliding window is 1024 bytes, and each time the length of the data pickup sliding window is 32 bytes, the data pickup sliding window processes 1024 bytes of data for the first time, and represents an acoustic wave signal which is analyzed for 11.6ms in a time domain signal. Wherein,
sliding 32 bytes of data to represent the sound wave signal of 0.3628ms each time, sliding the data pickup sliding window 5 times, converting the data subjected to Fourier conversion by the receiving end into a time domain signal, wherein the length of the corresponding time domain signal is 13.414ms. Therefore, as long as the data pickup sliding window slides for 5 times, the fixed frequency acoustic wave signal representing one digit with the time domain length of 14ms in the data segment can be accurately identified. The reason is to eliminate the damping of vibration and the noise filtering of the sound card pickup by taking only 5 times, so as to analyze and judge the sound wave data more comprehensively.
11.6+0.3628×5=13.414(ms)
When the sound wave data of the data segment is analyzed, if the continuously analyzed amplitude of the same frequency is continuously greater than the threshold value for 5 times, the sending end is determined to send the frequency signal in the data segment, the numerical values represented by the frequency signal are found out through the table 1, and the numerical values are combined to obtain the data of the data segment. Similarly, the judgment of the cut-off section acoustic wave signal may be the same as the judgment method of one of the frequencies in the data section.
The invention has the conception that the characteristic that the frequency of the initial section set by sound wave transmission is fixed is utilized, and the amplitude threshold value of the data section is calculated by using the amplitude of the Fourier transform of the sound wave data of the initial section, so that the problems of unequal amplitude attenuation of the sound wave under different transmission distance conditions are solved, and the stable transmission of the sound wave data is realized.
Example two
The embodiment provides a data communication system based on sound carrier waves;
a data communication system based on a voice carrier, comprising: a receiving end and a transmitting end;
the receiving end receives the data frame sent by the sending end and stores the received data frame into the sound data buffer area; the data frame includes: a start segment, a data segment and a cut-off segment;
setting the length and the sliding step length of a data pickup sliding window on a sound data buffer area; the initial position of the leftmost side of the data pickup sliding window is the same as the initial address of the sound data buffer area;
sliding a data pickup sliding window on a sound data buffer area, and performing Fourier transform on a data frame in the data pickup sliding window once sliding to obtain frequency and amplitude; and analyzing the received data frame based on the frequency and the amplitude obtained each time to obtain an analysis result.
The details of each step in the second embodiment are in one-to-one correspondence with those in the first embodiment, and are not described herein again.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (8)
1. The data communication method based on the sound carrier is characterized by comprising the following steps:
A. the receiving end receives the data frame sent by the sending end and stores the received data frame into the sound data buffer area; the data frame includes: a start segment, a data segment and a cut-off segment;
B. setting the length and the sliding step length of a data pickup sliding window on a sound data buffer area; the initial position of the leftmost side of the data pickup sliding window is the same as the initial address of the sound data buffer area;
C. sliding a data pickup sliding window on a sound data buffer area, and performing Fourier transform on a data frame in the data pickup sliding window once sliding to obtain frequency and amplitude; analyzing the received data frame based on the frequency and the amplitude obtained each time to obtain an analysis result;
the C specifically comprises:
(1) Carrying out Fourier transform on data in the data pickup sliding window to obtain frequency and amplitude;
(2) Judging whether the obtained frequency is the sound wave frequency of the initial section of the data frame, if so, recording the amplitude, moving the data pickup sliding window, and returning to the step (1); if not, recording the amplitude, calculating to obtain a set threshold value delta A of the data segment sound wave amplitude by using the recorded amplitude, and entering the step (3);
(3) Moving the data pickup sliding window, and performing Fourier transform on data in the window to obtain a new frequency and a new amplitude;
(4) Judging whether the new frequency is equal to the acoustic frequency of the cut-off section of the data frame; if yes, entering (5);
if not, judging whether the new amplitude is larger than a set threshold value delta A and the new frequency is the frequency contained in the data segment; if yes, recording a new frequency and the continuous occurrence times of the new frequency, and entering (3); if not, directly entering into (3);
(5) Judging whether the new amplitude is larger than a set threshold value or not; if yes, entering (6); if not, returning to the step (3);
(6) According to the moving length of the data pickup sliding window, the sampling frequency of the sound wave and the sound wave frequency in the data section, recording the new frequency and the continuous occurrence frequency of the new frequency in a combined manner to obtain a corresponding data frame analysis result;
the method (6) comprises the following specific steps:
(a) The method comprises the following steps Calculating the maximum value of the Fourier transform times of the receiving end aiming at a digital sound wave signal when the sending end sends the sound wave signal according to the time length of the digital sound wave in the data section sent by the sending end and by combining the data pickup sliding window and the sliding length;
wherein the maximum value of the Fourier transform times is: subtracting the byte number covered by the data pickup sliding window from the byte number of data in a buffer area generated by a digital sound wave signal at a receiving end, dividing the data by the sliding length during each sliding, and adding 1 after the result is rounded;
(b) The method comprises the following steps Multiplying the maximum value of the Fourier transform times by a set numerical value to obtain a product, and taking an integer closest to the product as the minimum judgment time of the single sound wave signal in the data sending section of the sending end;
(c) The method comprises the following steps Calculating the number N of times that the recorded amplitude of the new frequency is continuously larger than a set threshold value, and judging whether N is larger than or equal to the minimum judgment number of times;
(d) The method comprises the following steps If not, the transmitting end is considered not to transmit the sound wave data in the data section; if so, enabling N to obtain Q by performing module calculation on M, wherein Q +1 is the frequency of sending the sound wave signal with the new frequency by the sending end;
wherein M is data generated in a buffer area by representing a digital sound wave signal divided by a sliding step length, and an integer is taken; when Q is 0, the sending end is indicated to send a number in the data section only once, namely, a sound wave frequency signal represented by the number appears once; when Q is 1, the sending end continuously sends the number twice in the data section, namely, the sending end continuously sends the sound wave frequency signal represented by the number twice, and so on;
and finally, obtaining the data in the data section according to the sound wave frequency and a preset data-sound wave frequency one-to-one corresponding relation table.
2. A method as claimed in claim 1, wherein the threshold Δ a is calculated by:
wherein, a represents the sliding step length, b represents the length of the data pickup sliding window, and the value range of n is 0.3-0.8;
n is selected based on the environmental noise during sound wave transmission, and is 0.8 when the environmental noise is greater than a set threshold value; taking 0.3 when the noise is smaller than a set threshold, selecting the value, sending continuous initial section sound wave signals through a sending end before equipment communication, continuously analyzing the received sound wave data through a receiving end, carrying out Fourier transform to obtain the frequency and amplitude of the initial section signals, and obtaining the amplitude deviation of the frequency according to multiple times of analysis; and determining the specific value of the parameter n according to the principle that 2 times of the maximum value in the amplitude deviation is less than delta A.
3. The data communication method based on a voice carrier according to claim 1, further comprising:
when sound wave data are analyzed for the first time, the initial address of the data acquisition sliding window is the same as the initial address of the sound data buffer area, and the data in the data acquisition sliding window are analyzed;
secondly, sliding the initial address of the data pickup sliding window in sequence to obtain new data, wherein each sliding does not update all data in the data pickup sliding window, but only updates 3.125% -25% of data in the data pickup sliding window, and then analyzing the content of the data pickup sliding window;
when the data picking sliding window exceeds the end address of the sound data buffer area after the last sliding, adjusting the end address of the data picking sliding window to be aligned with the end address of the sound data buffer area, so that the step length of the last sliding of the data picking sliding window is smaller than the set sliding step length.
4. A method for data communication over a voice carrier according to claim 1 wherein the data frame comprises: a start segment, a data segment and a cut-off segment; the starting section and the cut-off section are both fixed frequency acoustic wave bands with set length; the data segment comprises at least one acoustic wave segment with a set length and a fixed frequency; each fixed-frequency sound wave section with set length represents a unique number; the frequencies of the respective acoustic wave segments contained in the start segment, the data segment, and the cut-off segment are different.
5. The data communication method based on the voice carrier according to claim 1, wherein the receiving end receives a data frame transmitted from the transmitting end; the sound wave frequency of the data frame sent by the sending end is 15 kHz-20 kHz.
6. The method according to claim 1, wherein the data segment includes at least one fixed frequency band of a predetermined length; and the sound wave frequency in the data section is sequentially and symmetrically selected by taking the sound wave frequency of the initial section as a center.
7. The data communication method based on sound carrier wave according to claim 1, wherein the frequency of the start section is 19KHz, and the interval between adjacent frequencies of the sound wave in the data section is 120Hz; the data in the data section includes transmitted data and CRC check bits.
8. A voice carrier based data communication system for implementing the voice carrier based data communication method according to any one of claims 1 to 7, comprising: a receiving end and a transmitting end.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110870798.5A CN113556185B (en) | 2021-07-30 | 2021-07-30 | Data communication method and system based on sound carrier |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110870798.5A CN113556185B (en) | 2021-07-30 | 2021-07-30 | Data communication method and system based on sound carrier |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113556185A CN113556185A (en) | 2021-10-26 |
CN113556185B true CN113556185B (en) | 2022-12-06 |
Family
ID=78104977
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110870798.5A Active CN113556185B (en) | 2021-07-30 | 2021-07-30 | Data communication method and system based on sound carrier |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113556185B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114448677B (en) * | 2021-12-31 | 2024-03-08 | 山东省计算中心(国家超级计算济南中心) | Edge server based on block chain, data uplink method and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2015084471A (en) * | 2013-10-25 | 2015-04-30 | 日本電気株式会社 | Acoustic communication device and acoustic communication method |
CN105376189A (en) * | 2014-09-01 | 2016-03-02 | 福建天晴数码有限公司 | Sound wave communication method and system |
CN108777596A (en) * | 2018-05-30 | 2018-11-09 | 上海惠芽信息技术有限公司 | A kind of communication means, communication system and computer readable storage medium based on sound wave |
CN113098627A (en) * | 2020-01-09 | 2021-07-09 | 北京君正集成电路股份有限公司 | System for realizing near field acoustic communication synchronization |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8837257B2 (en) * | 2010-11-29 | 2014-09-16 | Verifone Systems, Incorporated | Acoustic modulation protocol |
CN107645343B (en) * | 2016-07-20 | 2021-10-22 | 阿里巴巴集团控股有限公司 | Data sending/receiving method based on sound wave and data transmission system |
CN112383400B (en) * | 2020-11-06 | 2024-03-15 | 新大陆(福建)公共服务有限公司 | Method and equipment for transmitting and verifying trusted digital identity by utilizing sound waves |
-
2021
- 2021-07-30 CN CN202110870798.5A patent/CN113556185B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2015084471A (en) * | 2013-10-25 | 2015-04-30 | 日本電気株式会社 | Acoustic communication device and acoustic communication method |
CN105376189A (en) * | 2014-09-01 | 2016-03-02 | 福建天晴数码有限公司 | Sound wave communication method and system |
CN108777596A (en) * | 2018-05-30 | 2018-11-09 | 上海惠芽信息技术有限公司 | A kind of communication means, communication system and computer readable storage medium based on sound wave |
CN113098627A (en) * | 2020-01-09 | 2021-07-09 | 北京君正集成电路股份有限公司 | System for realizing near field acoustic communication synchronization |
Also Published As
Publication number | Publication date |
---|---|
CN113556185A (en) | 2021-10-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100750440B1 (en) | Reverberation estimation and suppression system | |
JP3878482B2 (en) | Voice detection apparatus and voice detection method | |
US8392176B2 (en) | Processing of excitation in audio coding and decoding | |
CN102893331A (en) | Methods, apparatus, and computer - readable media for processing of speech signals using head -mounted microphone pair | |
CN113556185B (en) | Data communication method and system based on sound carrier | |
AU2012344463A1 (en) | Near field communication implementation method and system | |
CN112312259B (en) | Intelligent earphone capable of suppressing environmental noise | |
CN101176149A (en) | Signal processing system for tonal noise robustness | |
CN106453762A (en) | A method and system for processing voice whistlers in an audio system | |
CN102883244B (en) | The device and method of acoustic shock protection | |
CN116403592A (en) | Voice enhancement method and device, electronic equipment, chip and storage medium | |
JPH09509545A (en) | Method and apparatus for processing block coded speech signal in speech communication system | |
KR20160145711A (en) | Systems, methods and devices for electronic communications having decreased information loss | |
US5651089A (en) | Block size determination according to differences between the peaks of adjacent and non-adjacent blocks in a transform coder | |
CN112954547A (en) | Active noise reduction method, system and storage medium thereof | |
CN111883173A (en) | Audio packet loss repairing method, device and system based on neural network | |
US3405237A (en) | Apparatus for determining the periodicity and aperiodicity of a complex wave | |
CN102388624A (en) | Sound processing device and sound processing method | |
CN115188390A (en) | Audio noise reduction method and related device | |
KR20140111480A (en) | Method and apparatus for suppressing vocoder noise | |
CN107592164B (en) | Anti-interference encoding method for low-frequency-band sound wave communication data transmission | |
CN111711493B (en) | Underwater communication equipment with encryption and decryption capabilities, transmitter and receiver | |
JP7169473B1 (en) | Digital radio transmitter and digital radio communication system | |
JP2913735B2 (en) | Highly efficient digital data encoding method. | |
CN116419106A (en) | Adaptive interference adjusting method based on nonlinear anti-eavesdropping of microphone |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |