Wireless communication system and method thereof

The present invention relates to a wireless communication system and a method thereof. The wireless communication system comprises a signal encoding module for encoding a preset high-frequency audio signal frequency according to a preset encoding rule, and creating an encoding library for storing the code; a signal sampling module for sampling a high-frequency audio signal produced by a high-frequency audio signal generating device; a signal transformation module for performing Fourier transformation on the sampled audio signal firstly to transform the audio signal into frequencies, acquiring a main frequency from the transformed frequencies, and storing the acquired main frequency; a signal decoding module for decoding the main frequency into a preset code according to the code in the library; and an output module for outputting the decoded code. The wireless communication system and the method of the present invention do not need hardware supports, thereby reducing the cost.

FIELD OF THE INVENTION

The present invention relates to a communication system and a method thereof, in particular to a system and a method for communication via an audio signal.

BACKGROUND

On current market, there are many non-contact communication devices in demand of hardware supports, for example, RFID technology which needs a special identification card in use. Taking its application to a membership card for example, a user who is the member of many shops needs to carry about a number of cards in consumption at different shops.

Although Bluetooth technology can be used in electronic devices for non-contact identification and in smart phones with no need of any special devices, its multi-site application only can be realized after being highly programmed and safety risk of cell phone may be increased with the Bluetooth on. Additionally, Bluetooth is power wasting. Therefore, an electronic device using Bluetooth as an identification terminal is unpractical. Furthermore, the Bluetooth technology is also high in cost to use due to its requirement to hardware such as interface, antenna.

SUMMARY

A technical problem to be solved by the present invention is to provide a wireless communication system and a method thereof which requires no hardware supports and have low cost, aiming at solving the defects in relevant arts

To solve the technical problem, the present invention adopts a technical solution as follows. A wireless communication system comprises:

a signal encoding module for encoding a preset high-frequency audio signal frequency according to a preset encoding rule, and creating an encoding library for storing the code;

a signal sampling module for sampling a high-frequency audio signal produced by a high-frequency audio signal generating device;

a signal transformation module for performing Fourier transformation on the sampled audio signal firstly to transform the audio signal into frequencies, acquiring a main frequency from the transformed frequencies, and storing the acquired main frequency;

a signal decoding module for decoding the main frequency into a preset code according to the code in the library; and

an output module for outputting the decoded code.

The present invention further provides a wireless communication method, comprising the steps of:

encoding a preset high-frequency audio signal frequency according to a preset encoding rule, and creating an encoding library for storing the code;

sampling a high-frequency audio signal produced by a high-frequency audio signal generating device;

performing Fourier transformation on the sampled audio signal to transform the audio signal into frequencies;

acquiring a main frequency from the transformed frequencies, and saving the acquired main frequency;

decoding the acquired main frequency into a preset code according to the code saved in the library; and

outputting the decoded code.

The present invention has the beneficial effects that site identification of the signal generating device can be realized by encoding a high-frequency audio signal frequency, producing a high-frequency audio signal by a signal generating device and identifying the high-frequency audio signal by a wireless communication system installed on a terminal so as to require no hardware supports and reduce cost.

DETAILED DESCRIPTION

The present invention will be further described in details with reference to the attached drawings and embodiments.

FIG. 1is a block diagram of a wireless communication system according to the first embodiment of the present invention. The wireless communication system1comprises a signal encoding module10, a signal sampling module11, a signal transformation module12, a filtration module13, a decoding module14, a numerical check module15, a numeric conversion module16, a multi-byte processing module17and an output module18.

FIG. 2is a schematic diagram of an application environment of the wireless communication system1as shown inFIG. 1. During application, the wireless communication system1is installed in the electronic device3. The electronic device3comprises an audio sampling unit31, an internal memory unit32, an external memory unit33and a processing unit34. The internal memory unit32further comprises a register321and a buffer cache332. The processing unit34is used to execute the functions of each module of the wireless communication system1.

The signal encoding module10is used for creating an encoding library according to a certain rule. The rule refers to using a preset high-frequency audio signal frequency to represent a code that is a binary code and also a Morse code. When the code is a binary code, each preset high-frequency audio signal code represents a value of each bit of the binary system. For example, the value “0” of the 0 bit of binary system is expressed in a frequency of 17157 Hz; the value “1” is represented with a frequency of 19832 Hz; the value “0” of the first bit is expressed in a frequency of 17337 Hz; the value “1” of the first bit is represented with a frequency of 19910 Hz, and by this analogy, the values of each bit of the binary system are set with a preset high-frequency audio signal frequency. When the code is a Morse code, the “-”, “.” and the spacing in the Morse code are expressed in a preset high-frequency audio signal, respectively. The Morse code while data processing is converted into a numeric string represented with “0”, “1” and spacing, wherein “-” and “.” are converted into “1” and “0”, respectively. For example, “.” is expressed in 17.1 Hz, “-” in 18.1 Hz and the spacing in 19.1 Hz.

In the embodiment, an XOR parity bit can be inserted between bit binary digits when the code is a binary number or a Morse code, and further expressed in a preset high-frequency audio signal frequency. For example, the value “0” of the first parity bit is expressed in a frequency of 20120 Hz and the value “1” is represented with a frequency of 20150 Hz.

The signal generating device2which is provided with the code library at its terminal is able to produce a high-frequency signal according to the preset code or the code input by a user. If the preset binary code or the user-input binary code is 110, the signal generating device2sequentially produces a band of audio signal frequencies that stand for the numbers.

The signal generating device2outputs the high-frequency audio signal at a low power so that a common user is unable to listen to the high-frequency audio signal. In the embodiment, the frequency of the high-frequency audio signal produced by the signal generating device2ranges from 17.1 Hz to 21.5 Hz, wherein the signal generating device2may be any electronic devices capable of producing audio signals, such as the electronic devices in shopping malls, the smart phones or the computers with horns. In practical applications, the signal generating device2can be set to produce different audio signals by presetting unlike IDs according to its specific application fields so that other electronic devices3that are communicating with the signal generating device2can identify the device2via the audio signal produced by the device2. Generally, the signal generating device is able to produce 12 bits of signals, namely 4096 IDs distributable to different application terminals.

The signal produced by the signal generating device2usually covers from 5 mm to 10 cm; and the signal produced by a special signal generating device2may reach 10 m. The signal coverage of the signal generating device2mainly depends on the power of the amplifier installed herein, and may reach several meters in use of a DC-powered amplifier.

Preferably, the signal produced by the signal generating device is a clean sinusoidal signal so that the signal generated is relatively quiet. The square signal or the triangular wave signal may also be identified although noises may be produced. In the embodiment, a PWM signal source, a DDS signal source or a multi-frequency sinusoidal signal generator can be used to produce a clean sinusoidal signal.

When the signal produced by the signal generating device2is required to be identified by the system1through the electronic device3, the electronic device3starts the system1in response to the user's operation to read and identify the audio signal produced by the signal generating device2. For the specific method, please refer toFIG. 3. Firstly, in the step S301, the signal sampling module11samples an audio signal having a preset length produced by the signal generating device2. In the embodiment, the electronic device3acquires the high-frequency audio signal via the audio sampling unit31. In the embodiment, the audio sampling unit31is a microphone.

In the step S302, the filtration module12filters the sampled high-frequency audio signals to filter out high-frequency audio signals generated in ambient environment, such as knocking noise sounding from glass or metal. If “0” and “1” occur in a uniform frame signal, the signal is often deemed to be a high-frequency audio signal produced in ambient environment.

In the step S303, the signal transformation module13performs Fourier transformation on the sampled audio signal firstly to transform the audio signal into frequencies, and then acquires a main frequency from the transformed frequencies and stores the acquired main frequency into the internal memory.

In the step S304, the decoding module14acquires the frequency values from the memory one by one.

In the step S305, the decoding module14determines whether the acquired frequency value is one of the preset frequencies in the encoding table. If the acquired value is one of the preset frequencies in the encoding table, proceed to step306; if the acquired value is not one of the preset frequencies in the encoding table, execute the step S304to acquire the next frequency value.

In step S306, the decoding module14acquires the number corresponding with the frequency value from the encoding table and stores the number into the register321. Taking the code in the encoding library as a binary number for example, if the frequency value is 17157 Hz, the number corresponding with the frequency value can be determined to be the number “0” corresponding with the 0 bit of the binary number; if the frequency value is 19910 Hz, the number corresponding with the frequency value can be determined to be the number “1” corresponding with the first bit of the binary number; if the frequency value is 20120 Hz, the number corresponding with the frequency value can be determined to be the number “1” of the first parity bit.

In step S307, the decoding module14determines whether the frequency values in the memory31are completely acquired. Return to the step S303to acquire next frequency value if the frequency values have not been completely acquired; if the frequency values have been completely acquired, proceed to step S308.

In step S308, the decoding module13determines whether the register321is full? If the register is not full, execute the step S301and resample an audio signal till the register321is fully written in numbers; if the register is not yet full, proceed to step S309.

In step S309, the numerical check module15checks whether the numerical value is correct. If the numerical value is incorrect, proceed to step S310; if the numerical value is correct, proceed to step S311. In the embodiment, the numerical value may be deemed to be an invalid value under following two conditions: In the first case, the numbers “0” and “1” of the same bit occurs successively, for example, 17157 Hz and 19852 Hz or 19334 Hz and 19910 Hz.

In the second case, determine whether the check code is matched with the logic checksum of the numerical value before the parity code; if the check code matches with the logical checksum, the numerical value is correct; if the check code does not match with the logical checksum, the numerical value is incorrect. For example, if the frequencies of the audio signal are 17157 Hz, 17334 Hz and 20120 Hz, the number after the audio signal is decoded is 100, wherein the parity code is 1 and the XOR checksum of 00 is 0, and therefore the numerical value is incorrect. For another example, if the frequencies of the audio signal are 17157 Hz, 19910 Hz and 20150 Hz, the numerical value after the audio signal is decoded is 010, wherein the parity code is the “0” of the second bit and the logic checksum of the numerical value “10” is “1”, and therefore the numerical value is also incorrect.

In step S310, when the numerical value is incorrect, the numeric check module15resets the register321and the flow returns to the step S301to resample an audio signal for identification.

In step S311, when the numerical value is correct, the numeric conversion module16decodes the numbers in the register321into characters which represent the numbers, such as decimal numbers, letters, characters, and saves the decoded characters into the buffer cache322.

In step S312, the multi-byte processing module17determines whether the characters in the buffer cache322are multi-byte characters. If the characters are multi-byte characters, proceed to step S313, if the characters are not multi-byte characters, proceed to step S314.

In the embodiment, a multi-byte character identification code and a multi-byte character termination code can be set when the character is multi-byte. The character is determined to be a multi-byte character when a multi-byte character identification code in the buffer cache is identified by the multi-byte processing module16.

In step S313, the output module18outputs the numerical value and ends the identification process.

In step S314, the multi-byte processing module16determines whether the character is the termination code of the multi-byte character. If the character is not the termination code of the multi-byte character, proceed to step S315, if the character is the termination code thereof, proceed to step S316.

In step S315, the multi-byte processing module14resets the register321and then returns to the step S301.

In step S316, the output module18outputs the value of a character string which is formed by multiple bytes saved in the buffer cache322, and ends the identification process.

FIG. 4andFIG. 5are respectively a flow chart of a wireless communication system4according to a second embodiment of the present invention and a flow chart of a method for identifying a high-frequency audio signal produced by a signal generating device2according to the wireless communication system4. The wireless communication system4comprises a signal encoding module40, a signal sampling module41, a filtration module42, a signal transformation module43, a decoding module44and an output module45, wherein the signal encoding module40presets a code for each high-frequency audio frequency. The code may be a single character, such as a number and a letter, or a combination of characters. For example, the 17.1 Hz high-frequency audio signal is set with a code 6, the 17.2 Hz audio signal with a code 7, the 17.3 Hz high-frequency audio signal with a code 8 and so on. The signal sampling module41, the filtration module42and the signal transformation module43have the same functions as that of the signal sampling module11, the filtration module12and the signal conversion module13in the first embodiment. That is the steps of S601, S602and S603are identical to the steps of S301, S302and S303. The functions of the decoding module44for executing the steps of S604and S605are same as that of the steps of S304and S305as shown inFIG. 3, and will not be repeatedly described any longer.

In step S606, the decoding module44acquires the code corresponding with the frequency value from the encoding table and stores the code into the buffer cache when the acquired frequency is one of the preset frequencies in the encoding table.

In step S607, the decoding module44determines whether the frequency values in the internal memory unit32are completely acquired. If the frequency values have not been completely acquired, return to the step S604; if the frequency values have been completely acquired, proceed to step S608.

In step S608, the output module43determines whether the data transmission is completed. If the data were transmitted completely, return to step S601; if the data were not transmitted completely, proceed to step S609.

In the embodiment, an initializer and a terminator can be preset. The initializer is a start identifier of the transmitted data and the terminator is a termination identifier of the transmitted data. A character read after the initializer is determined whether to be a terminator when confirming whether the data were transmitted completely, provided that the initializer had read first. If the character is the terminator, the data are confirmed to be transmitted completely; if the terminator is not read, the data has not read completely.

In step S609, the output module45outputs the code combination in the buffer cache.

In the embodiment, the output module45outputs the code between the initializer and the terminator.

FIG. 6is a flow chart of a signal processing method for an electronic device2only receiving the audio signal produced by the signal generating device2. In step S401, receive the audio signal produced by the signal generating device2.

In step S402, process the audio signal as shown inFIG. 3.

In step S403, process the generated numerical values to perform the default function.

FIG. 7is a flow chart of a method for using both a first electronic terminal51and a second electronic terminal52as a signal transmitting terminal and a signal receiving terminal to perform two-way communication.

In step S501, the first electronic terminal51generates an audio signal according to user input values.

In step S502, the second electronic terminal52receives the audio signal.

In step S503, the second electronic terminal52identifies the audio signal through the method as shown in theFIG. 3.

In step S504, the second electronic terminal52generates an audio response signal.

In step S505, the first electronic terminal51receives the audio response signal, and identifies the audio signal through the method as shown in theFIG. 3. The communication between the two terminals continues till the communication protocol preset by the user terminates.

The foregoing descriptions are merely preferred embodiments of the present invention, but are not intended to limit the protection scope of the present invention, and any technical solutions under the concept of the present invention shall all fall within the protection scope of the present invention. It should be pointed out that a plurality of improvements and modifications figured out by a person having an ordinary skill without departing from the principle of the present invention shall also fall within the protection scope of the present invention.