Summary of the invention
The technical matters that the present invention solves is to provide a kind of auditory localization devices and methods therefor, can reduce the sound signal processing process operand, realize simple and save whole cost.
Another technical matters that the present invention solves is to provide a kind of electronic equipment that adopts aforementioned auditory localization device, can reduce operand, realizes simple and save whole cost.
For this reason, the technical scheme of technical solution problem of the present invention is: a kind of auditory localization device is provided, comprises that a plurality of being used for gather the voice signal of outside sound source and be converted into the signal receiving circuit of electric signal at diverse location, also comprise:
A plurality of signal pre-processing circuits correspond respectively to described signal receiving circuit, are used for the electric signal that described signal receiving circuit produces is carried out pre-service and outputs level signals;
Sound source Phase Processing device is used for the phase differential between the level signal that a plurality of signal pre-processing circuits of comparison of aforementioned produce, obtains the orientation of outside sound source;
The azimuth information output circuit is used under the control of microprocessor the azimuth information of output outside sound source.
Preferably, described signal pre-processing circuit comprises amplifying circuit, is used to amplify the electric signal from signal receiving circuit; Shaping circuit, being used for the electrical signal conversion after amplifying is level signal.
Preferably, described shaping circuit is the zero passage comparator circuit.
Preferably, described sound source Phase Processing device is a microprocessor, and described microprocessor comprises:
Storage unit is used for the level signal that the described signal pre-processing circuit of buffer memory is exported;
The phase identification unit is used to discern the phase place and the high level lasting time of described level signal;
The orientation determining unit is used for the phase place of the level signal of more different signal pre-processing circuits, determines the orientation of outside sound source according to comparative result.
Preferably, described microprocessor also comprises:
The Interrupt Process unit is used for regularly reading the level signal of described signal pre-processing circuit output and writing this storage unit;
The phase place reading unit is used for reading this level signal from storage unit.
Preferably, described microprocessor also comprises: the legitimacy judging unit is used for determining according to the phase place and the high level lasting time of described level signal whether level signal is eligible.
Preferably, described sound source Phase Processing device comprises:
Read identification circuit, be used to read and discern electric signal from signal pre-processing circuit;
First comparator circuit is used to carry out lawful condition and judges, judges whether described electric signal is legal;
Second comparator circuit is used for judging and confirming according to legal electric signal the orientation of outside sound source.
The present invention also provides a kind of sound localization method, is applied to auditory localization device as claimed in claim 1 to determine the orientation of outside sound source; Comprise step:
1) gathers the voice signal that outside sound source send and be converted to electric signal at a plurality of diverse locations;
2) respectively described a plurality of electric signal are carried out pre-service, generate corresponding level signal;
3) phase differential between a plurality of level signals of comparison of aforementioned obtains the orientation of outside sound source;
4) azimuth information of output outside sound source.
Preferably, pre-service described step 2) comprises amplifies and shaping this electric signal.
Preferably, the comparison phase differential of described step 3) specifically comprises:
Read and the described pretreated level signal of buffer memory;
Read and discern the phase place and the high level lasting time of the level signal of described buffer memory;
The phase place of more different level signals is determined the orientation of outside sound source according to comparative result.
Preferably, the comparison phase differential of described step 3) also comprises: legitimacy is judged, is determined according to the phase place and the high level lasting time of described level signal whether level signal is eligible.
The present invention also provides a kind of electronic equipment with auditory localization device, and wherein, described auditory localization device is aforesaid auditory localization device.
With respect to prior art, the invention has the beneficial effects as follows: the signal receiving circuit that the present invention determines according to diverse location obtains sound wave, use peripheral circuit (signal pre-processing circuit) to simplify the source of sound information of obtaining, analog quantity is converted into level signal (pulse signal) represents; After microprocessor obtains binary signal, can determine that by comparing phase differential different signal receiving circuits obtains the mistiming of acoustic information, thereby determine the sound bearing.Because the signal that MCU handles is pulse signal or claims level signal, promptly only form by high and low level, rather than through the signal behind A/D quantification, the coding; And because MCU is by the comparison to phase differential, can determine the sound bearing, and needn't pass through FFT (fast fourier transform, Fast Fourier Transform) algorithm, determine its correlativity, determine the orientation of source of sound, therefore, its have operand little, to the less demanding advantage of subsequent treatment, thereby make the cost of total system be minimized.
Embodiment
Main design of the present invention is to adopt peripheral circuit to simplify sound and obtains the acoustic information that element obtains, convert level signal to and enter MCU, simple identification alternative sounds obtains the phase difference between signals of element in the MCU, obtain sound bearing by calculating, make audition distinguish that bit function is achieved on MCU.
Seeing also Fig. 1, is the block diagram of auditory localization device of the present invention.
The auditory localization device comprises that signal receives and pre-processing device 100, microprocessor 200 and azimuth information output circuit 300; Wherein signal reception and pre-processing device 100 are connected to microprocessor 200, and microprocessor 200 connects and control azimuth information output circuits 300.
Signal receives and pre-processing device 100 is gathered the voice signal that outside sound source 900 is sent at a plurality of diverse locations, and a plurality of electric signal of corresponding generation also export microprocessor 200 to.The phase place of 200 pairs of described a plurality of electric signal of microprocessor compares, and obtain the orientation of sound source, thereby control azimuth information output circuit 300 is exported.
Consult Fig. 2 in the lump, described signal receives and pre-processing device 100 comprises a plurality of signal receiving circuits 110 and signal pre-processing circuit 120; Described signal receiving circuit 110 is connected to corresponding signal pre-processing circuit 120, and this signal pre-processing circuit 120 is connected to microprocessor 200.
A plurality of signal receiving circuits 110 are gathered the voice signal that outside sound source 900 produces at diverse location respectively, and input to corresponding signal pre-processing circuit 120 after converting thereof into electric signal.Obviously, because different signal receiving circuit 110 and the distance between the outside sound source 900 and the gaps of direction will there are differences between its voice signal that collects.
120 pairs of electric signal that receive of signal pre-processing circuit carry out pre-service, for example amplification, shaping etc., analog quantity is converted into digital quantity represents, arrive mistiming of each signal receiving circuit 110, will produce a plurality of level signals that have phase differential each other according to sound.
Microprocessor 200 reads the phase value from the level signal of signal pre-processing circuit 120 respectively, compares the difference between the phase value, and discerns the orientation of outside sound source according to comparative result.
Azimuth information output circuit 300 is exported the predetermined form of azimuth information employing of outside sound source under the control of microprocessor 200, can adopt various ways such as visible light, sound, and this does not give unnecessary details.
For ease of the understanding of the present invention, describe the present invention below in conjunction with instantiation.
See also Fig. 3, in the example of the present invention, adopt three microphones (MIC) to serve as the voice signal receiving device, wherein MIC1, MIC2 and MIC3 constitute an isosceles right triangle, and the spacing of MIC1, MIC2 can be 6cm, 7cm or the like.
Certainly, those skilled in the art should understand, and described spacing can be adjusted according to the actual operation ability of MCU, and for example, when the dominant frequency of MCU was 4M, the scope apart from S1-2 between said MIC1 and the MIC2 was: 6~10cm; MIC1, MIC2 and MIC3 also are not limited to form isosceles right triangle, can regulate according to the actual needs fully, as long as three MIC are not positioned at same straight line.
Seeing also Fig. 4, is that signal receives and the circuit theory diagrams of pre-processing device in this example.
In the described signal receiving circuit 110, resistance R 1 and triode Q1 are microphone MIC supply of current.When microphone MIC receives voice signal, will produce change in voltage, be reflected in the A point, the A point is the signal output part of signal receiving circuit 110.
Described signal pre-processing circuit 120 comprises amplifying circuit 121 and shaping circuit 122.
In the amplifying circuit 121, capacitor C 1 filters the low frequency part in the signal, and resistance R 2, resistance R 3 and amplifier U1A constitute the negative feedback amplifying return circuit, and the signal after the amplification is exported via the B point.
In the shaping circuit 122, capacitor C 2, resistance R 4, resistance R 5 and amplifier U1B form the zero passage comparator circuit, and the level signal after the shaping is by some C output.The port of this level signal by microprocessor 200 is input to microprocessor 200 and handles accordingly.Wherein, a port of the equal corresponding microprocessor 200 of each shaping circuit.
Wherein, Ref is preferably 1/2VCC, can certainly adopt other magnitudes of voltage to be used as the reference voltage of various piece.
Need to prove that Fig. 4 only is receiving circuit and the peripheral pre-process circuit that comprises a MIC, the circuit that two other MIC is relevant is similar with it.
Seeing also Fig. 5, is that signal receives and the synoptic diagram of the output signal of pre-processing device in this example, arrives mistiming of each MIC, the dephased identical waveform of each signal pre-processing circuit output device according to sound.
Subsequently, the level signal that 200 pairs of aforementioned signals of microprocessor receive and pre-processing device 100 is exported is handled.In this example, with the MCU SPCE061 of Ling Yang science and technology as the control core.
See also Fig. 5 and Fig. 6, introduce the flow process that microprocessor carries out auditory localization in this example below.
Step S110, microprocessor carries out initialization.
Step S120 reads the phase value of 3 MIC respectively.
Step S130 confirms the phase value that reads.
At first, carry out phase identification, promptly obtain Delay1, Delay2 and Delay3 respectively, obtain T1, T2 and T3 value simultaneously.
Subsequently, carry out the judgement of phase place legitimacy:
1) judges whether to satisfy according to T1, T2 and the T3 value obtained: T1=T2=T3; If do not satisfy, then illegal, withdraw from flow process; Satisfied then enter 2);
2) deduct minimum Delay according to the maximum Delay that obtains and obtain a mistiming T
Maxtomin, judge whether to satisfy: T
Maxtomin<T
S1-2(sound transmission MCI1 is to the required time of the distance of MIC2), then legal if satisfy, enter step S140; Otherwise then illegal, withdraw from flow process;
Wherein, 1) and 2) judgement order can exchange.
Step S140 obtains sound source direction, determines the orientation of source of sound according to legal phase value.
Consult Fig. 7 in the lump, in this example, space region is divided into 8 intervals, step S140 promptly determines the residing interval of sound source according to phase value.As shown in table 1.
Table 1
Interval | Need satisfied condition |
Condition 1 | Condition 2 |
Interval 1 | Delay1>Delay2 | (Delay1+Delay2)/2=Delay3 |
Interval 2 | Delay1>Delay2 | (Delay1+Delay2)/2>Delay3 |
Interval 3 | Delay1=Delay2 | (Delay1+Delay2)/2>Delay3 |
Interval 4 | Delay1<Delay2 | (Delay1+Delay2)/2>Delay3 |
Interval 5 | Delay1<Delay2 | (Delay1+Delay2)/2=Delay3 |
Interval 6 | Delay1<Delay2 | (Delay1+Delay2)/2<Delay3 |
Interval 7 | Delay1=Delay2 | (Delay1+Delay2)/2<Delay3 |
Interval 8 | Delay1<Delay2 | (Delay1+Delay2)/2<Delay3 |
See also Fig. 8, in this example, microprocessor 200 is for realizing the function of sound source direction, the corresponding program module of its inside solidification comprises storage unit 210, initialization unit 220, phase place reading unit 230, phase identification unit 240, legitimacy judging unit 250, orientation determining unit 260 and Interrupt Process unit 270.
Described storage unit 210 comprises low level retention time memory block (LowToHighLatchTime), high-level retention time memory block (HighToLowLatchTime), current state memory block (Status) and buffer to ports district (IO_Buffer).
Low level retention time memory block is used to write down the level signal of each signal pre-processing circuit by the low time that uprises; The high-level retention time memory block is used to write down the time of the level signal of each signal pre-processing circuit by high step-down; The current state memory block then is used to write down the current state of the level signal of each signal pre-processing circuit, and representing current with different numerical value respectively is high level, low level or generation level conversion, for example, 0 representative when front port be high level state; 1 representative is worked as front port for keeping low level state; 2 representatives are worked as front port for keeping high level state; 3 representatives are when the front port return state.
The buffer to ports district can adopt first in first out (FIFO) structure, is used for Interrupt Process unit 270 and regularly reads and each Signal Pretreatment unit corresponding port, computing time exactly.
The current state of initialization storage unit 210 and each signal pre-processing circuit corresponding port when initialization unit 220 is moved at microprocessor 200.Seeing also Fig. 9, is the workflow of initialization unit 220.
Seeing also Figure 10, is the workflow of phase place reading unit 230.
Step S121 judges that whether the buffer to ports district is not for empty, if then enter step S122; If not, then enter step S124.
Step S122, the read port buffer area.
Step S123, according to the result of step S122, the signal that starts 240 pairs of each peripheral circuits in phase identification unit is handled.
Step S124 judges whether to satisfy the flow process termination condition, and described termination condition is that the state of each port all experiences after low level, high level and the low level, and promptly the state value of each port is 3 in the current state memory block.
Seeing also Figure 11, is the workflow of phase identification unit 240.
The port of pre-treatment is determined to select to work as in phase identification unit 240 according to the receiving element of input parameter representative.
Step S131, the read port buffer area, whether be low level, if then enter step S132 if judging current; If not, then enter step S133.
Step S132 reads the current state memory block, carries out respective handling: if state value is 0, then state value is switched to 1, the low level retention time adds 1; If state value is 1, then the low level retention time adds 1; If state value is 2, then state value is switched to 3; If state value is 3, then do not operate.
Step S133 reads the current state memory block, carries out respective handling: if state value is 0, then high-level retention time adds 1; If state value is 1, then state value is switched to 2, high-level retention time adds 1; If state value is 2, then high-level retention time adds 1; If state value is 3, then do not operate.
Seeing also Figure 12, is the workflow of legitimacy judging unit.
Step S134, relatively whether the high-level retention time of each port equates, if then enter step S135; If not, then return illegal.
Step S135 deducts the minimum low level retention time with low level retention time of maximum and obtains a mistiming, judge this mistiming whether less than sound transmission MCI1 to the required time of the distance of MIC2, if it is legal then to return; If not, then return illegal.
Seeing also Figure 13, is the workflow of orientation determining unit 260.
Step S141, low level retention time of MIC1 correspondence is added low level retention time of MIC2 correspondence, then will with divided by 2, the size of merchant's low level retention time corresponding relatively again with MIC3, carry out respective handling: if equate that then Primary Location is in the 1st, 5 intervals; If less than, then Primary Location is in the 6th, 7,8 intervals; If greater than, then Primary Location is in the 2nd, 3,4 intervals.
Step S142, relatively the low level retention time of MIC1 correspondence adds the low level retention time of MIC2 correspondence, carries out respective handling: if equate that then Primary Location is in the 3rd, 7 intervals; If less than, then Primary Location is in the 4th, 5,6 intervals; If greater than, then Primary Location is in the 1st, 2,8 intervals.
Step S143 in conjunction with twice comparative result, obtains the residing unique interval of sound source.
Seeing also Figure 14, is the workflow of Interrupt Process unit 270, is used for regularly reading the level signal of the port of microprocessor 200, and writes the buffer to ports district, coordinates the running in buffer to ports district simultaneously.
The azimuth information output circuit 300 of this example adopts 8 LED (light emitting diode) to represent aforementioned 8 intervals respectively, and microprocessor 200 is controlled LED according to the block information that processing obtains, and the azimuth information of output is delivered to 8 LED represent the orientation discerned.
In a word, in this example, the information of sound source changes into the digital signal of 1 bit by peripheral circuit (signal pre-processing circuit); And the inner phase differential by each voice signal of MCU (microprocessor) obtains the mistiming that each sound collection element (microphone) is gathered sound, and calculates corresponding transmission range, determines the sound bearing with this.Distinguish between this example and the general resulting switching signal of employing A/D mode and be: 1, the signal handled of MCU is pulse signal or claims level signal, promptly only forms by high and low level rather than quantize, encode through A/D after signal; 2, adopt the method for simple phase differential comparison to discern the orientation, and do not need through similar FFT scheduling algorithm than the complex calculations process, therefore, its have operand little, to the less demanding advantage of subsequent treatment, thereby make the cost of total system be minimized.
Certainly, the present invention is not limited to the description of the scheme of previous examples, and for example, those skilled in the art can understand according to design of the present invention: the SPCE061 in the scheme can substitute with other chip; LED output in the scheme can substitute such as modes such as dolly steering motors with other output; Can obtain orientation on the three-dimensional by adding a sound collection element in the scheme; Sound collection element in the scheme can use other new-type element to substitute the MIC element.
In addition, those skilled in the art knows, and based on the singularity of data processing technique, the function that program module reached of microprocessor 200 inside solidifications also can adopt the corresponding hardware form to realize.Seeing also Figure 15, is the synoptic diagram of a possible example.In this example, source of sound Phase Processing circuit 500 comprises and reads identification circuit 510, first comparator circuit 520, second comparator circuit 530 and output circuit 540; Wherein, reading identification circuit 510 is used to read and discern from the sound collection circuit electric signal of (figure does not show), and carry out lawful condition through first comparator circuit 520 and judge, judge whether described electric signal is legal, the orientation of outside sound source is judged and confirmed to second comparator circuit 530 according to legal electric signal, and pass through output circuit 540 output sound bearing information.The described identification circuit 510 that reads comprises a plurality of circuit 511 and evaluation identification circuits 512 of reading.
In a word, the present invention has following characteristics: obtain element according to three definite sound of position and obtain sound wave; Use peripheral circuit to simplify the source of sound information of obtaining, the digital quantity that analog quantity is converted into a bit is represented; After MCU obtains binary signal, determine that by comparing phase differential three sound obtain the mistiming that element obtains acoustic information, thereby determine the sound bearing.
Based on auditory localization apparatus and method of the present invention, be applied to the consumer electronics product field, can obtain multiple novel electronic equipment for consumption, as dolly, robot etc., can determine travel direction by identification voice position, thereby have automatic following function; And the inventor has realized the combination of sound source direction function and voice identification function on 16 single-chip microcomputer SPCE061A of Ling Yang company.
The above only is a preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.