

技术领域technical field
本发明涉及气压校准技术领域,尤其涉及一种基于传感器的气压校准方法。The invention relates to the technical field of air pressure calibration, in particular to a sensor-based air pressure calibration method.
背景技术Background technique
电子乐器使用气压传感器,通过气压传感器把吹吸的气压信号转变为电信号,从而控制预先采集的各种真实乐器的波形数字流,经处理后形成音频电信号,经功率放大后通过扬声器发音。Electronic musical instruments use air pressure sensors to convert blowing and inhaling air pressure signals into electrical signals through the air pressure sensor, thereby controlling the waveform digital streams of various real musical instruments collected in advance.
电子乐器如电子口琴、电吹管等,由于外界环境的变化(例如海拔,温度等环境因素,对环境气压产生影响而带来的误差),出现气压传感器的气压不归零的情况,导致检测到的气压数据不准确,从而带来声音失真或不该发音时却发音的情况,这是由于气压传感器对气压及温度敏感导致。Electronic musical instruments such as electronic harmonicas, electric blowpipes, etc., due to changes in the external environment (such as altitude, temperature and other environmental factors, the error caused by the impact on the ambient air pressure), the air pressure of the air pressure sensor does not return to zero, resulting in the detection of The barometric pressure data is inaccurate, resulting in distorted sound or pronunciation when it should not be pronounced, which is caused by the barometric pressure sensor being sensitive to air pressure and temperature.
发明内容Contents of the invention
针对现有技术的不足,本发明将独立传感器检测的气压与预设气压进行比较得到气压差值,根据气压差值对发音传感器的气压值进行校准计算,得到音量响度值,根据音量响度值调节演奏时的音符音量。Aiming at the deficiencies of the prior art, the present invention compares the air pressure detected by the independent sensor with the preset air pressure to obtain the air pressure difference, calibrates and calculates the air pressure value of the pronunciation sensor according to the air pressure difference, obtains the volume loudness value, and adjusts the volume according to the volume loudness value. The volume of the note when played.
本发明所采用的技术方案是:一种基于传感器的气压校准方法包括以下步骤:The technical scheme adopted in the present invention is: a kind of air pressure calibration method based on sensor comprises the following steps:
电子乐器通电后且演奏音乐前,发音传感器、独立传感器会对当前环境下乐器的建压气室的气压值进行检测并数据采集。After the electronic musical instrument is powered on and before playing music, the pronunciation sensor and independent sensor will detect and collect data from the air pressure value of the pressure-building chamber of the musical instrument under the current environment.
步骤一、通过发音传感器、独立传感器对当前环境下建压气室的气压值进行采集,得到发音传感器和独立传感器当前气压值;Step 1. Collect the air pressure value of the pressurized air chamber under the current environment through the pronunciation sensor and the independent sensor, and obtain the current air pressure value of the pronunciation sensor and the independent sensor;
步骤二、计算独立传感器的当前气压值与独立传感器默认值的变化率;Step 2. Calculate the rate of change between the current air pressure value of the independent sensor and the default value of the independent sensor;
进一步的,变化率公式=(独立传感器的当前气压值-独立传感器默认值)/独立传感器默认值;Further, the rate of change formula=(the current air pressure value of the independent sensor-the default value of the independent sensor)/the default value of the independent sensor;
步骤三、根据独立传感器的变化率同比例调整发音传感器默认值,得到发音传感器参考默认值;Step 3, adjust the default value of the pronunciation sensor in the same proportion according to the change rate of the independent sensor, and obtain the reference default value of the pronunciation sensor;
步骤四、计算发音传感器的当前气压值与发音传感器参考默认值的差值,并将差值量化为1-256,得到差值量化值,量化方法为:根据试验的经验值,如果差值超出256的范围,则设定量化系数,按比例缩小使之位于1-256的范围内,如数据仍然超出256则按256计算,以下不再赘述该量化方法;将量化后的差值(差值量化值)与发音阈值进行比较;Step 4. Calculate the difference between the current air pressure value of the pronunciation sensor and the reference default value of the pronunciation sensor, and quantify the difference to 1-256 to obtain the quantitative value of the difference. The quantification method is: according to the empirical value of the test, if the difference exceeds 256, then set the quantization coefficient, scale it down so that it is in the range of 1-256, if the data still exceeds 256, then calculate as 256, the quantization method will not be described in detail below; the quantized difference (difference Quantized value) is compared with the pronunciation threshold;
进一步的,发音阈值=10。Further, the pronunciation threshold=10.
步骤五、将差值量化值通过音量对应表进行查表得到音量响度值,并将音量响度值发给微处理器,微处理器根据音量响度值调节演奏时的音符音量。Step 5: Look up the difference quantization value through the volume corresponding table to obtain the volume loudness value, and send the volume loudness value to the microprocessor, and the microprocessor adjusts the volume of the note when playing according to the volume loudness value.
进一步的,发音传感器的当前气压值与发音传感器参考默认值的差值与音量对应表为:Further, the difference between the current air pressure value of the pronunciation sensor and the reference default value of the pronunciation sensor and the volume correspondence table are as follows:
其中,1-256表示发音传感器的当前气压值与发音传感器参考默认值的差值,并量化为1-256之间的值,0x07-0x7f表示音量响度值。Among them, 1-256 represents the difference between the current air pressure value of the pronunciation sensor and the reference default value of the pronunciation sensor, and is quantized into a value between 1-256, and 0x07-0x7f represents the loudness value of the volume.
进一步的,发音传感器设置有若干组;Further, the pronunciation sensor is provided with several groups;
发音传感器和独立传感器均为同型号的气压传感器,发音传感器的数量由乐器类型确定,例如电子口琴的发音传感器的数量可设置为10个以上,而电吹管的发音传感器的数量可以为1个。Both the pronunciation sensor and the independent sensor are air pressure sensors of the same type. The number of pronunciation sensors is determined by the type of instrument. For example, the number of pronunciation sensors of an electronic harmonica can be set to more than 10, while the number of pronunciation sensors of an electric blowpipe can be 1.
本发明的有益效果:Beneficial effects of the present invention:
1、电子乐器中增加一个独立传感器,在增加少量成本情况下,通过校准算法,即可避免发音传感器由于环境的气压或温度引起的误差,使电子乐器的发音更加准确。1. An independent sensor is added to the electronic musical instrument. With a small increase in cost, through the calibration algorithm, the error of the pronunciation sensor caused by the air pressure or temperature of the environment can be avoided, so that the pronunciation of the electronic musical instrument is more accurate.
附图说明Description of drawings
图1是本发明的基于传感器的气压校准方法流程图;Fig. 1 is a flow chart of the sensor-based air pressure calibration method of the present invention;
图2是本发明的电吹管结构示意图。Fig. 2 is a schematic structural view of the electric torch of the present invention.
具体实施方式detailed description
下面结合附图和实施例对本发明作进一步说明,此图为简化的示意图,仅以示意方式说明本发明的基本结构,因此其仅显示与本发明有关的构成。The present invention will be further described below in conjunction with the accompanying drawings and embodiments. This figure is a simplified schematic diagram, which only schematically illustrates the basic structure of the present invention, so it only shows the structures related to the present invention.
以图2电吹管为例说明独立传感器和发音传感器的关系,需要注意并明确的是:乐器并未穷举,只要采用独立传感器进行本发明方法校准均在本发明的保护范围内;电吹管内部内置一只独立传感器,用于测量的建压气室所处腔体不是密闭的,与外界相通,它的气压数据是由微处理器读取的,在外界有环境变化的时候,它的气压数据也会有一定的变化,这个数据变化就可以被检测并进行保存;发音传感器根据建压室的吹吸气压转为音量,发音传感器,微处理器在处理正常发音传感器数据时,需要利用独立传感器的变化量得到发音传感器的音量值,这样发音传感器数据才能相对准确可靠,独立传感器和发音传感器均为气压传感器,且均与微处理器电性连接。Take the electric blowpipe in Figure 2 as an example to illustrate the relationship between the independent sensor and the pronunciation sensor. It should be noted and made clear that: the musical instruments are not exhaustive, as long as the independent sensor is used to calibrate the method of the present invention, they are all within the protection scope of the present invention; the inside of the electric blowpipe Built-in an independent sensor, the cavity where the pressure building chamber used for measurement is not airtight, and communicates with the outside world, its air pressure data is read by the microprocessor, when the outside environment changes, its air pressure data There will also be a certain change, and this data change can be detected and saved; the pronunciation sensor is converted into volume according to the blowing and suction pressure of the pressure building chamber, and the pronunciation sensor and the microprocessor need to use independent when processing the normal pronunciation sensor data. The volume value of the pronunciation sensor is obtained by the variation of the sensor, so that the data of the pronunciation sensor can be relatively accurate and reliable. Both the independent sensor and the pronunciation sensor are air pressure sensors, and are electrically connected to the microprocessor.
如图1所示,一种基于传感器的气压校准方法,包括以下步骤:As shown in Figure 1, a sensor-based air pressure calibration method includes the following steps:
步骤一、通过发音传感器、独立传感器对当前环境下建压气室的气压值进行采集,得到发音传感器和独立传感器当前气压值;Step 1. Collect the air pressure value of the pressurized air chamber under the current environment through the pronunciation sensor and the independent sensor, and obtain the current air pressure value of the pronunciation sensor and the independent sensor;
电吹管开启后演奏前,发音传感器和独立传感器采集到当前环境温度、气压条件的气压值分别为6250和5500;After the electric blowpipe is turned on and before playing, the air pressure values of the current ambient temperature and air pressure conditions collected by the pronunciation sensor and the independent sensor are 6250 and 5500 respectively;
步骤二、计算独立传感器的当前气压值与独立传感器默认值的变化率;Step 2. Calculate the rate of change between the current air pressure value of the independent sensor and the default value of the independent sensor;
微处理器中设定第一、独立传感器的默认值分别为5600,5000。The default values set in the microprocessor for the first and independent sensors are 5600, 5000, respectively.
独立传感器的变化率=(5500-5000)/5000=10%,即变化率为增长10%;The rate of change of the independent sensor = (5500-5000)/5000 = 10%, that is, the rate of change increases by 10%;
步骤三、根据变化率同比例调整发音传感器默认值,得到发音传感器参考默认值;Step 3. Adjust the default value of the pronunciation sensor in the same proportion according to the rate of change to obtain the reference default value of the pronunciation sensor;
发音传感器参考默认值=5600*(1+10%)=6160;Pronunciation sensor reference default value = 5600*(1+10%) = 6160;
步骤四、将发音传感器的当前气压值与发音传感器参考默认值的差值与发音传感器的气压差阈值进行比较;Step 4, comparing the difference between the current air pressure value of the pronunciation sensor and the reference default value of the pronunciation sensor with the air pressure difference threshold of the pronunciation sensor;
假设量化系数为1,发音传感器的当前气压值-发音传感器参考默认值=6250-6160=90,则差值量化后的值为90,即差值量化值=90;Assuming that the quantization coefficient is 1, the current air pressure value of the pronunciation sensor-the reference default value of the pronunciation sensor=6250-6160=90, then the value after quantization of the difference is 90, that is, the quantization value of the difference=90;
发音阈值假设为10,由于90>10,因此继续执行步骤五;如果差值量化值小于发音阈值则不处理;The pronunciation threshold is assumed to be 10. Since 90>10, continue to step five; if the difference quantization value is less than the pronunciation threshold, it will not be processed;
步骤五、根据步骤四的差值量化值与音量对应表得到音量响度值,并将音量响度值发给微处理器,微处理器根据音量响度值调节演奏时的音量输出;Step 5, obtain the volume loudness value according to the difference quantization value and the volume correspondence table of step 4, and send the volume loudness value to the microprocessor, and the microprocessor adjusts the volume output during performance according to the volume loudness value;
通过表1得到差值量化值为90对应的音量响度值为0x31,对应十进制为49,将音量响度值发送给微处理器,当电吹管演奏时微处理器外接音响后根据音量响度值49,调整音响的输出音符音量。According to Table 1, the volume loudness value corresponding to the difference quantization value of 90 is 0x31, and the corresponding decimal value is 49, and the volume loudness value is sent to the microprocessor. Adjusts the output note volume of the speaker.
表1 气压差值与音量响度值对应表为:Table 1 The corresponding table of air pressure difference and volume loudness value is as follows:
本发明电子乐器中增加一个独立传感器,在增加少量成本情况下,通过校准算法,即可避免发音传感器由于环境的气压或温度引起的误差,使电子乐器的发音更加准确。An independent sensor is added to the electronic musical instrument of the present invention. With a small increase in cost, the error of the pronunciation sensor caused by the air pressure or temperature of the environment can be avoided through the calibration algorithm, so that the pronunciation of the electronic musical instrument is more accurate.
以上述依据本发明的理想实施例为启示,通过上述的说明内容,相关工作人员完全可以在不偏离本项发明技术思想的范围内,进行多样的变更以及修改。本项发明的技术性范围并不局限于说明书上的内容,必须要根据权利要求范围来确定其技术性范围。Inspired by the above-mentioned ideal embodiment according to the present invention, through the above-mentioned description content, relevant workers can make various changes and modifications within the scope of not departing from the technical idea of the present invention. The technical scope of the present invention is not limited to the content in the specification, but must be determined according to the scope of the claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211032249.1ACN115440179B (en) | 2022-08-26 | 2022-08-26 | Air pressure calibration method based on sensor |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211032249.1ACN115440179B (en) | 2022-08-26 | 2022-08-26 | Air pressure calibration method based on sensor |
| Publication Number | Publication Date |
|---|---|
| CN115440179Atrue CN115440179A (en) | 2022-12-06 |
| CN115440179B CN115440179B (en) | 2025-06-10 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211032249.1AActiveCN115440179B (en) | 2022-08-26 | 2022-08-26 | Air pressure calibration method based on sensor |
| Country | Link |
|---|---|
| CN (1) | CN115440179B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101625868A (en)* | 2008-07-08 | 2010-01-13 | 索尼株式会社 | Volume adjusting apparatus and volume adjusting method |
| KR20180078207A (en)* | 2018-06-29 | 2018-07-09 | 민부홍 | Electronic harmonica |
| CN111599330A (en)* | 2020-05-07 | 2020-08-28 | 蒲昊 | Digital harmonica |
| CN113808556A (en)* | 2021-08-25 | 2021-12-17 | 深圳市盛世八音电子科技有限公司 | Control system of electronic blow pipe, electronic blow pipe and control method thereof |
| CN114295279A (en)* | 2021-12-31 | 2022-04-08 | 中国铁建重工集团股份有限公司 | Air pressure detection device and detection method |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101625868A (en)* | 2008-07-08 | 2010-01-13 | 索尼株式会社 | Volume adjusting apparatus and volume adjusting method |
| KR20180078207A (en)* | 2018-06-29 | 2018-07-09 | 민부홍 | Electronic harmonica |
| CN111599330A (en)* | 2020-05-07 | 2020-08-28 | 蒲昊 | Digital harmonica |
| CN113808556A (en)* | 2021-08-25 | 2021-12-17 | 深圳市盛世八音电子科技有限公司 | Control system of electronic blow pipe, electronic blow pipe and control method thereof |
| CN114295279A (en)* | 2021-12-31 | 2022-04-08 | 中国铁建重工集团股份有限公司 | Air pressure detection device and detection method |
| Publication number | Publication date |
|---|---|
| CN115440179B (en) | 2025-06-10 |
| Publication | Publication Date | Title |
|---|---|---|
| CN204165699U (en) | A kind of pressure sensor calibrating apparatus | |
| WO2016090899A1 (en) | Vital capacity testing method and device | |
| CN100590399C (en) | A flow sensor calibration method in a medical respiratory mechanics module | |
| US8965725B2 (en) | Automatic calibration adjustment of capacitance diaphragm gauges to compensate for errors due to changes in atmospheric pressure | |
| CN106969812A (en) | Flow sensor calibration method and system | |
| CN110662153B (en) | Speaker adjustment method, device, storage medium and electronic device | |
| CN111721466B (en) | Method and system for correcting zero point drift of pressure sensor | |
| CN102830248A (en) | Micro temperature-compensating servo circuit for quartz accelerometer | |
| CN104165618A (en) | Apparatus for measuring height of aircraft, and method thereof | |
| CN109540343B (en) | Intelligent temperature compensation method based on ejection seat program controller sensor | |
| CN115440179A (en) | Air pressure calibration method based on sensor | |
| CN209820562U (en) | Gas meter detection device with temperature and pressure compensation | |
| JP2024506807A (en) | load lock gauge | |
| CN112229455B (en) | Suction resistance standard rod measuring method capable of adjusting volume flow | |
| CN115210547A (en) | Force sensing system | |
| JP2003083763A (en) | Correcting method for self noise and device using the same | |
| CN110554792A (en) | sensor calibration adjusting device and method | |
| CN113514135A (en) | Flow disc flow measuring device and method based on mass flow feedback adjustment | |
| JPH08261854A (en) | Reading method of atmospheric pressure for weather forecast | |
| CN208140053U (en) | A kind of Cigarette circumference on-line measuring device | |
| CN112190804B (en) | Breathing machine | |
| CN106683653B (en) | Touch key signal multi-channel processing circuit and method for piezoelectric electret flexible film electronic organ | |
| JP6612667B2 (en) | Acoustic calibrator | |
| CN115792272A (en) | Method and system for measuring airspeed of subsonic aircraft | |
| CN214951687U (en) | Flow disc flow measuring device based on mass flow feedback adjustment |
| 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 |