Summary of the invention
Weak point in view of above-mentioned prior art the object of the present invention is to provide a kind of lung capacity test macro based on mobile microphone, can receive measured's air blowing through mobile microphone, measures measured's lung capacity.
In order to achieve the above object, the present invention has taked following technical scheme:
A kind of lung capacity test macro based on mobile microphone, it comprises microphone, first biasing circuit, second biasing circuit and central processing unit; The positive pole of said microphone is connected with the first bias voltage feeder ear through said first biasing circuit, and the negative pole of said microphone is connected with the second bias voltage feeder ear through said second biasing circuit; The positive pole of said microphone is connected with the ADC_MICP port of said central processing unit, and negative pole is connected with the ADC_MICN port of said central processing unit; Said microphone is used to receive the analog signal that the measured blows and imports, and is delivered in the central processing unit; Said central processing unit is used for the analog signal that microphone receives is carried out analog-to-digital conversion, measures the volume that the measured is blown into gas according to this analog signal, calculates measured's lung capacity, and generates corresponding waveform and on mobile phone display screen, show.
In the above-mentioned lung capacity test macro based on mobile microphone; Also comprise first filter circuit and second filter circuit; One end of said first filter circuit is connected with the ADC_MICP port of the positive pole of microphone and central processing unit; Other end ground connection, an end of second filter circuit is connected other end ground connection with the ADC_MICN port of the negative pole of microphone and central processing unit.
In the above-mentioned lung capacity test macro based on mobile microphone, said first filter circuit comprises first electric capacity, and an end of said first electric capacity is connected other end ground connection with the ADC_MICP port of the positive pole of microphone and central processing unit; Said second filter circuit comprises second electric capacity, and an end of said second electric capacity is connected other end ground connection with the ADC_MICN port of the negative pole of said microphone and central processing unit.
In the above-mentioned lung capacity test macro based on mobile microphone; Between the ADC_MICP port of said first biasing circuit and central processing unit, be serially connected with first coupling circuit, between the ADC_MICN port of said second biasing circuit and central processing unit, be serially connected with second coupling circuit.
In the above-mentioned lung capacity test macro based on mobile microphone, said first coupling circuit comprises the 3rd electric capacity, and said the 3rd capacitances in series is between the ADC_MICP of first biasing circuit and central processing unit port; Said second coupling circuit comprises the 4th electric capacity, and said the 4th capacitances in series is between the ADC_MICN of second biasing circuit and central processing unit port.
In the above-mentioned lung capacity test macro based on mobile microphone; Also comprise the 3rd filter circuit; Said the 3rd filter circuit comprises the 5th electric capacity and the 6th electric capacity, and an end of said the 5th electric capacity is connected other end ground connection with the ADC_MICP port of central processing unit with first coupling circuit; One end of said the 6th electric capacity is connected other end ground connection with the ADC_MICN port of central processing unit with second coupling circuit.
In the above-mentioned lung capacity test macro based on mobile microphone, said first biasing circuit comprises first resistance and second resistance; Said first resistance and second resistance are serially connected between the ADC_MICP port and first bias voltage power supply port of central processing unit successively; Said second biasing circuit comprises the 3rd resistance and the 4th resistance, and said the 3rd resistance and the 4th resistance are serially connected between the ADC_MICN port and second bias voltage power supply port of central processing unit successively.
In the above-mentioned lung capacity test macro based on mobile microphone, said central processing unit comprises:
Analog-to-digital conversion module is used for the analog signal conversion of microphone collection is become digital signal;
Conversion/computing module is used for measuring the volume that the measured is blown into gas according to said analog signal, and calculates measured's lung capacity;
Image generating module is used for generating corresponding signal waveform according to the result of calculation of said conversion/computing module;
Display module is used to show said signal waveform.
In the above-mentioned lung capacity test macro based on mobile microphone, said central processing unit also comprises:
Grading module, be used for according to the measured age, sex, and the lung capacity of measuring mark;
Reminding module is used for the appraisal result according to grading module, exports corresponding health prompt information.
In the above-mentioned lung capacity test macro based on mobile microphone, also comprise first voltage stabilizing circuit and second voltage stabilizing circuit, an end of said first voltage stabilizing circuit is connected other end ground connection with the ADC_MICP port of the positive pole of microphone and central processing unit; One end of said second voltage stabilizing circuit is connected other end ground connection with the ADC_MICN port of the negative pole of microphone and central processing unit.
Compared to prior art, the lung capacity test macro based on mobile microphone provided by the invention comprises microphone, first biasing circuit, second biasing circuit and central processing unit; The positive pole of said microphone is connected with the first bias voltage feeder ear through said first biasing circuit, and the negative pole of said microphone is connected with the second bias voltage feeder ear through said second biasing circuit; The positive pole of said microphone is connected with the ADC_MICP port of said central processing unit, and negative pole is connected with the ADC_MICN port of said central processing unit.Said microphone is used for receiving the blow analog signal of input of measured and inputs to central processing unit; Said central processing unit is used for the analog signal that microphone receives is carried out analog-to-digital conversion; Measure the volume that the measured is blown into gas according to this analog signal, calculate measured's lung capacity, and generate corresponding waveform and on mobile phone display screen, show; When measuring; Tested all only the need aimed at the microphone air blowing, goes out tested lung capacity all with regard to energy measurement, and the signal waveforms of demonstration lung capacity that can be dynamically real-time.In addition, the present invention also can mark to the lung capacity of measuring, and exports corresponding health prompt information according to appraisal result, can be used as user's mobile phone " intimate assistant ", the great convenience of bringing to the user.
Embodiment
The present invention provides a kind of lung capacity test macro based on mobile microphone, and is clearer, clear and definite for making the object of the invention, technical scheme and effect, below develops simultaneously embodiment to further explain of the present invention with reference to accompanying drawing.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
See also Fig. 1, the lung capacity test macro based on mobile microphone provided by the invention comprises microphone M1, first biasing circuit 11, second biasing circuit 21 and central processing unit 31.The positive pole of said microphone M1 is connected with the first bias voltage feeder ear MICBAISP through said first biasing circuit 11; The negative pole of said microphone M1 is connected with the second bias voltage feeder ear MICBAISN through said second biasing circuit 21; The positive pole of said microphone M1 is connected with the ADC_MICP port of said central processing unit 31, and negative pole is connected with the ADC_MICN port of said central processing unit 31.Wherein, ADC_MICP and ADC_MICN are the sample port of two microphone signals of central processing unit.
Wherein, Said microphone M1 is used to receive the analog signal that the measured blows and imports; And be delivered in the central processing unit 31, said central processing unit 31 is used for the analog signal that microphone M1 receives is carried out analog-to-digital conversion, measures the volume that the measured is blown into gas according to this analog signal; Calculate measured's lung capacity, and generate corresponding waveform and on mobile phone display screen, show.
The present invention gathers the analog signal that the measured blows and produces through microphone; Through central processing unit 31 analog signal is carried out analog-to-digital conversion, and measure the volume that the measured is blown into gas, calculate measured's lung capacity according to analog signal; Make the measured only need have mobile phone; Just can measure lung capacity anywhere or anytime, understand the health status of oneself whenever and wherever possible, bring great help for user's health.
See also Fig. 2, said central processing unit 31 comprises analog-to-digital conversion module 311, conversion/computing module 312, image generating module 313 and display module 314.Analog-to-digital conversion module 311 is used for the analog signal conversion that microphone M1 gathers is become digital signal; Conversion/computing module 312 is used for measuring the volume that the measured is blown into gas according to said analog signal, and calculates measured's lung capacity; Image generating module 313 is used for generating corresponding signal waveform according to the result of calculation of said conversion/computing module 312; Display module 314 is used to show said signal waveform.
In the specific implementation, said conversion/computing module 312 is estimated the signal that microphone M1 receives through following formula:
VC=∫f(t)dt
Wherein, f (t) represents the signal waveform function (the for example soundRecorder function under the android platform) of microphone M1), integration begins the beginning of blowing from the measured, till stopping to blow to the testee.
Said conversion/computing module 312 can calculate the integration of the lasting waveform signal of microphone M1, generates the respective waveforms image through the image generation module then, and on display module 314, shows in real time with the motion graphics mode.
In the specific implementation, because signal that central processing unit 31 receives and the relating to parameters such as gain of microphone M1, present embodiment needs to add a correction factor A when the integration of signal calculated, and promptly above-mentioned formula finally is:
VC=∫A?f(t)dt
Wherein, correction factor A can proofread and correct according to actual debugging situation, so that the result of calculation of conversion/computing module 312 is more accurate.
Please continue to consult Fig. 2, described central processing unit 31 also comprises grading module 315 and reminding module 316.Said grading module 315 be used for according to the measured age, sex, and the lung capacity of measuring mark; Reminding module 316 is used for the appraisal result according to grading module 315, exports corresponding health prompt information.
As shown in Figure 3; It is the lung capacity test macro scoring normative reference form that the present invention is based on mobile microphone, and this form can be when software translating in the typing test macro, and it can be according to people's personality, age bracket; And the lung capacity that calculates is marked feedback measured's health status.And in reminding module 316, store the health prompt information of corresponding appraisal result, provide relevant suggestion, make mobile phone really become user " intimate assistant " according to appraisal result.
See also Fig. 4, it is the circuit theory diagrams of the present invention's one application implementation example.Described lung capacity test macro based on mobile microphone comprises microphone M1, first biasing circuit 11, second biasing circuit 21 and central processing unit 31; The positive pole of said microphone M1 is connected with the first bias voltage feeder ear MICBAISP through said first biasing circuit 11; The negative pole of said microphone M1 is connected with the second bias voltage feeder ear MICBAISN through said second biasing circuit 21; The positive pole of said microphone M1 is connected with the ADC_MICP port of said central processing unit 31, and negative pole is connected with the ADC_MICN port of said central processing unit 31.
Wherein, Said first biasing circuit 11 comprises first resistance R 1 and second resistance R 2; Said first resistance R 1 and second resistance R 2 are serially connected between the ADC_MICP port and first bias voltage power supply port MICBAISP of central processing unit 31 successively; Said second biasing circuit 21 comprises the 3rd resistance R 3 and the 4th resistance R 4, and said the 3rd resistance R 3 and the 4th resistance R 4 are serially connected between the ADC_MICN port and second bias voltage power supply port MICBAISN of central processing unit 31 successively.
Certainly the invention is not restricted to this, said first biasing circuit 11 and second biasing circuit 21 all can be resistance or more resistance series connection, bias voltage are provided can for microphone M1 and central processing unit 31 as long as it connects bias supply.
Because when the measured blows; Microphone also can receive the outside sound signal, for filtering noise, the embodiment of the invention provide based on the lung capacity test macro of mobile microphone also first filter circuit and second filter circuit; One end of said first filter circuit is connected with the ADC_MICP port of the positive pole of microphone M1 and central processing unit 31; Other end ground connection, an end of second filter circuit is connected other end ground connection with the ADC_MICN port of the negative pole of microphone M1 and central processing unit 31.
In the specific implementation, said first filter circuit comprises first capacitor C 1, and said second filter circuit comprises second capacitor C 2, and an end of said first capacitor C 1 is connected other end ground connection with the ADC_MICP port of the positive pole of microphone M1 and central processing unit; One end of said second capacitor C 2 is connected other end ground connection with the ADC_MICN port of the negative pole of said microphone M1 and central processing unit.Said first capacitor C 1 and second capacitor C 2 are filter capacitor, are used for the noise signal that filtering microphone M1 receives.
In the embodiment of the invention; Said lung capacity test macro based on mobile microphone also comprises first coupling circuit and second coupling circuit; Said first coupling circuit is connected between the ADC_MICP port of said first biasing circuit 11 and central processing unit 31, and second coupling circuit is connected between the ADC_MICN port of said second biasing circuit 21 and central processing unit 31.
In the practical implementation process, said first coupling circuit comprises the 3rd capacitor C 3, and an end of said the 3rd capacitor C 3 is connected with first biasing circuit 11, and the other end is connected with the ADC_MICP port of central processing unit 31; Said second coupling circuit comprises the 4th capacitor C 4, and an end of said the 4th capacitor C 4 is connected with second biasing circuit 21, and the other end is connected with the ADC_MICN port of central processing unit 31.
In order to protect the internal circuit of mobile phone; The lung capacity test macro of mobile microphone provided by the invention; Also comprise first voltage stabilizing circuit and second voltage stabilizing circuit; This first voltage stabilizing circuit and second voltage stabilizing circuit play the voltage stabilizing amplitude limit in mobile phone, prevent that the amplitude of the signal that central processing unit receives is too high.One end of said first voltage stabilizing circuit is connected other end ground connection with the ADC_MICP port of the positive pole of microphone M1 and central processing unit 31; One end of said second voltage stabilizing circuit is connected other end ground connection with the ADC_MICN port of the negative pole of microphone M1 and central processing unit 31.
In the specific implementation, said first voltage stabilizing circuit comprises the first voltage stabilizing didoe D1, and the end of the said first voltage stabilizing didoe D1 is connected other end ground connection with the ADC_MICP port of the positive pole of microphone M1 and central processing unit 31.Said second voltage stabilizing circuit comprises the second voltage stabilizing didoe D2, and an end of said second voltage stabilizing circuit is connected other end ground connection with the ADC_MICN port of the negative pole of microphone M1 and central processing unit 31.
Further; Lung capacity test macro based on mobile microphone provided by the invention also comprises said the 3rd filter circuit 41; Said the 3rd filter circuit 41 is mainly used in the noise signal in the further filtering circuit, the blackberry lily in the microphone signal is disturbed signal lead away, and it comprises the 5th capacitor C 5 and the 6th capacitor C 6; One end of said the 5th capacitor C 5 is connected with first coupling circuit with the ADC_MICP port of central processing unit 31; Other end ground connection, an end of said the 6th capacitor C 6 is connected other end ground connection with the ADC_MICN port of central processing unit 31 with second coupling circuit.
Further; Lung capacity test macro based on mobile microphone provided by the invention also comprises the 4th filter circuit 51; Said the 4th filter circuit 51 is mainly used in blocks interference signal, prevents that the blackberry lily in the microphone signal from disturbing in signal conveys to the central processing unit 31, and it comprises first inductance L 1 and second inductance L 2; Said first inductance L 1 is connected between anodal and the 3rd capacitor C 3 of microphone M1, and second inductance L 2 is connected between the negative pole and the 4th capacitor C 4 of microphone M1.
Further, the lung capacity test macro based on mobile microphone provided by the invention also comprises the 5th filter circuit 61, is mainly used in the noise signal in the further filtering circuit, the blackberry lily in the microphone signal is disturbed signal lead away, and anti-stop signal disturbs.Said the 5th filter circuit 61 comprises the 7th capacitor C 7 and the 5th resistance R 5; One end of said the 7th capacitor C 7 is connected with the ADC_MICP port of central processing unit 31; The other end is connected with the ADC_MICN port of central processing unit 31, and said the 3rd resistance R 3 is attempted by the two ends of the 7th capacitor C 7.
In sum, the lung capacity test macro based on mobile microphone provided by the invention comprises microphone, first biasing circuit, second biasing circuit and central processing unit; The positive pole of said microphone is connected with the first bias voltage feeder ear through said first biasing circuit, and the negative pole of said microphone is connected with the second bias voltage feeder ear through said second biasing circuit; The positive pole of said microphone is connected with the ADC_MICP port of said central processing unit, and negative pole is connected with the ADC_MICN port of said central processing unit.Said microphone is used for receiving the blow analog signal of input of measured and inputs to central processing unit; Said central processing unit is used for the analog signal that microphone receives is carried out analog-to-digital conversion; Measure the volume that the measured is blown into gas according to this analog signal, calculate measured's lung capacity, and generate corresponding waveform and on mobile phone display screen, show; When measuring; Tested all only the need aimed at the microphone air blowing, goes out tested lung capacity all with regard to energy measurement, and the signal waveforms of demonstration lung capacity that can be dynamically real-time.In addition, the present invention also can mark to the lung capacity of measuring, and exports corresponding health prompt information according to appraisal result, can be used as user's mobile phone " intimate assistant ", the great convenience of bringing to the user.
It is understandable that, concerning those of ordinary skills, can be equal to replacement or change according to technical scheme of the present invention and inventive concept thereof, and all these changes or replacement all should belong to the protection range of the appended claim of the present invention.