CN114608705A - Spectral signal data sampling and peak value detection method - Google Patents
Spectral signal data sampling and peak value detection method Download PDFInfo
- Publication number
- CN114608705A CN114608705A CN202210496492.2A CN202210496492A CN114608705A CN 114608705 A CN114608705 A CN 114608705A CN 202210496492 A CN202210496492 A CN 202210496492A CN 114608705 A CN114608705 A CN 114608705A
- Authority
- CN
- China
- Prior art keywords
- signal
- data
- sampling data
- value
- level
- 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.)
- Granted
Links
- 238000005070 sampling Methods 0.000 title claims abstract description 102
- 230000003595 spectral effect Effects 0.000 title claims abstract description 57
- 238000001514 detection method Methods 0.000 title claims abstract description 25
- 238000001914 filtration Methods 0.000 claims abstract description 23
- 238000012544 monitoring process Methods 0.000 claims abstract description 21
- 238000006243 chemical reaction Methods 0.000 claims abstract description 13
- 230000003287 optical effect Effects 0.000 claims abstract description 11
- 230000003750 conditioning effect Effects 0.000 claims abstract description 5
- 230000003321 amplification Effects 0.000 claims abstract description 4
- 238000003199 nucleic acid amplification method Methods 0.000 claims abstract description 4
- 230000000630 rising effect Effects 0.000 claims description 21
- 238000012545 processing Methods 0.000 claims description 16
- 238000000034 method Methods 0.000 claims description 15
- 238000001228 spectrum Methods 0.000 claims description 11
- 238000002955 isolation Methods 0.000 claims description 6
- 238000004088 simulation Methods 0.000 claims 1
- 238000004590 computer program Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 7
- 230000009286 beneficial effect Effects 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 6
- 238000004364 calculation method Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 238000013500 data storage Methods 0.000 description 3
- 208000005718 Stomach Neoplasms Diseases 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000001143 conditioned effect Effects 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000003745 diagnosis Methods 0.000 description 1
- 238000002189 fluorescence spectrum Methods 0.000 description 1
- 206010017758 gastric cancer Diseases 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000005693 optoelectronics Effects 0.000 description 1
- 238000004321 preservation Methods 0.000 description 1
- 238000011897 real-time detection Methods 0.000 description 1
- 201000011549 stomach cancer Diseases 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J3/00—Spectrometry; Spectrophotometry; Monochromators; Measuring colours
- G01J3/28—Investigating the spectrum
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M3/00—Conversion of analogue values to or from differential modulation
- H03M3/30—Delta-sigma modulation
- H03M3/38—Calibration
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01J—MEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
- G01J3/00—Spectrometry; Spectrophotometry; Monochromators; Measuring colours
- G01J3/28—Investigating the spectrum
- G01J2003/2859—Peak detecting in spectrum
Landscapes
- Physics & Mathematics (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Analogue/Digital Conversion (AREA)
Abstract
Description
技术领域technical field
本发明涉及信号采样和信号处理技术领域,特别涉及一种光谱信号数据采样和峰值检测方法。The invention relates to the technical field of signal sampling and signal processing, in particular to a spectral signal data sampling and peak detection method.
背景技术Background technique
目前,随着光电子技术的发展,光谱检测技术得到很大提高。但市场上光谱检测仪器仪表和设备主要采用两种方式:第一种,如发明专利CN201910704105-基于负反馈调节的荧光光谱检测系统中采用上位机+下位机结构,下位机采样数据,通过通信接口将采样数据送到上位机,在上位机上进行信号处理和数据分析,系统电路复杂,成本高,另一种,如发明专利CN201810535990-一种胃癌诊断胃镜的光谱检测系统所示,通过AD转换采样数据送到MCU,通过MCU软件滤波并软件寻峰处理,算出信号的峰值,因MCU计算速度限制,采样一定数据后,必须停止采样进行滤波计算和寻峰计算,不能实时采样,降低数据通过率。At present, with the development of optoelectronic technology, spectral detection technology has been greatly improved. However, there are mainly two ways of spectral detection instruments and equipment on the market: the first one, such as the invention patent CN201910704105-the fluorescence spectrum detection system based on negative feedback adjustment adopts the structure of upper computer + lower computer, the lower computer samples data, and passes the communication interface. The sampling data is sent to the upper computer, and the signal processing and data analysis are performed on the upper computer. The system circuit is complex and the cost is high. Another, as shown in the invention patent CN201810535990-a spectral detection system for gastric cancer diagnosis gastroscope, sampling through AD conversion The data is sent to the MCU, and the peak value of the signal is calculated by the MCU software filtering and software peak-finding processing. Due to the limitation of the MCU's calculation speed, after sampling a certain data, the sampling must be stopped for filtering calculation and peak-finding calculation. Real-time sampling cannot be performed, which reduces the data pass rate. .
发明内容SUMMARY OF THE INVENTION
本发明提供一种光谱信号数据采样和峰值检测方法,用以解决的情况。The present invention provides a spectral signal data sampling and peak detection method to solve the problem.
一种光谱信号数据采样和峰值检测方法,包括:A spectral signal data sampling and peak detection method, comprising:
获取光信号,将所述光信号通过探测器产生电信号Vi,并将所述电信号通过前置放大电路,获取第一电压信号Va;obtaining an optical signal, passing the optical signal through a detector to generate an electrical signal Vi, and passing the electrical signal through a preamplifier circuit to obtain a first voltage signal Va;
将所述第一电压信号Va通过放大、滤波调理电路进行放大和滤波处理,获取第二电压信号Vb;Amplify and filter the first voltage signal Va through an amplifying, filtering and conditioning circuit to obtain a second voltage signal Vb;
将所述第二电压信号Vb通过ΣΔADC模数转换模块进行模数转换,获取转换后模拟侧的第一串行数字信号D1;Perform analog-to-digital conversion on the second voltage signal Vb through the ΣΔ ADC analog-to-digital conversion module, and obtain the converted first serial digital signal D1 on the analog side;
将所述第一串行数字信号D1通过电气隔离电路进行电气隔离,获取数字电路侧的第二串行数字信号D2;electrically isolating the first serial digital signal D1 through an electrical isolation circuit to obtain a second serial digital signal D2 on the digital circuit side;
将所述第二串行数字信号D2通过第一Sincx滤波器进行滤波,获取一级采样数据D3;Filtering the second serial digital signal D2 through the first Sinc x filter to obtain first-level sampling data D3;
将所述一级采样数据D3通过数据校准寄存器进行零偏误差和线性误差校准,获取二级采样数据D5,并将所述二级采样数据D5通过极值寄存器进行极值监测,确定二级采样数据D5对应的最大值和最小值;Perform zero offset error and linear error calibration on the first-level sampling data D3 through the data calibration register, obtain the second-level sampling data D5, and perform extreme value monitoring on the second-level sampling data D5 through the extreme value register to determine the second-level sampling data. The maximum and minimum values corresponding to data D5;
将所述二级采样数据D5通过DMA控制器输出到存储单元进行数据保存。The second-level sampling data D5 is output to the storage unit through the DMA controller for data storage.
作为本发明的一种实施例:所述将所述第二串行数字信号D2通过第一Sincx滤波器进行滤波,获取一级采样数据D3,还包括:As an embodiment of the present invention, the filtering of the second serial digital signal D2 through the first Sinc x filter to obtain the first-level sampling data D3 further includes:
将所述第二串行数字信号D2通过模拟看门狗中的第二Sincx滤波器进行滤波,获取三级采样数据D4;Filtering the second serial digital signal D2 through the second Sinc x filter in the analog watchdog to obtain three-level sampling data D4;
根据所述三级采样数据D4设置上限阈值和下限阈值;其中,所述下限阈值对应为所述三级采样数据D4的最小刻度值,所述上限阈值设置为光谱信号有效上升沿处的采样数据值,通过上限阈值监测光谱信号的三级采样数据D4;The upper threshold and the lower threshold are set according to the third-level sampling data D4; wherein, the lower threshold corresponds to the minimum scale value of the third-level sampling data D4, and the upper threshold is set as the sampling data at the valid rising edge of the spectral signal value, monitor the third-level sampling data D4 of the spectral signal through the upper threshold;
当所述三级采样数据D4大于所述上限阈值时,确定监测到光谱信号的上升沿,所述模拟看门狗产生第一中断信号。When the three-level sampling data D4 is greater than the upper limit threshold, it is determined that a rising edge of the spectrum signal is monitored, and the analog watchdog generates a first interrupt signal.
作为本发明的一种实施例:所述当所述三级采样数据D4大于所述上限阈值时,确定监测到光谱信号的上升沿,所述模拟看门狗产生第一中断信号,还包括:As an embodiment of the present invention: when the three-level sampling data D4 is greater than the upper limit threshold, it is determined that the rising edge of the spectral signal is monitored, and the analog watchdog generates a first interrupt signal, further comprising:
当所述模拟看门狗产生所述第一中断信号时,获取极值寄存器中的最大值和最小值,并将所述最大值和最小值进行清零处理;When the analog watchdog generates the first interrupt signal, obtain the maximum value and the minimum value in the extreme value register, and clear the maximum value and the minimum value to zero;
通过极值寄存器对所述二级采样数据D5进行二次极值监测,确定二次极值监测的最大值和最小值;Perform secondary extreme value monitoring on the secondary sampling data D5 through the extreme value register to determine the maximum and minimum values of the secondary extreme value monitoring;
将所述二次监测的最大值和最小值更新为最大值和最小值,将所述最大值设置为三级采样数据D4对应的最大刻度值,将所述最小值设置为光谱信号下降沿处的采样数据值;The maximum and minimum values of the secondary monitoring are updated to the maximum and minimum values, the maximum value is set to the maximum scale value corresponding to the third-level sampling data D4, and the minimum value is set to the falling edge of the spectral signal. The sampled data value of ;
基于所述最小值,通过所述模拟看门狗对光谱信号的三级采样数据D4进行监测,当监测到光谱信号的三级采样数据D4小于所述下限阈值时,表示监测到光谱信号的下降沿,所述模拟看门狗产生第二中断信号。Based on the minimum value, the tertiary sampling data D4 of the spectral signal is monitored by the analog watchdog, and when it is detected that the tertiary sampling data D4 of the spectral signal is less than the lower threshold, it means that the drop of the spectral signal is monitored. edge, the analog watchdog generates a second interrupt signal.
作为本发明的一种实施例:所述基于所述最小值,通过所述模拟看门狗对光谱信号的三级采样数据D4进行监测,当监测到光谱信号的三级采样数据D4小于所述下限阈值时,表示监测到光谱信号的下降沿,所述模拟看门狗产生第二中断信号,还包括:As an embodiment of the present invention: the third-level sampling data D4 of the spectral signal is monitored by the analog watchdog based on the minimum value, and when it is detected that the third-level sampling data D4 of the spectral signal is less than the When the lower limit threshold is set, it indicates that the falling edge of the spectral signal is monitored, and the analog watchdog generates a second interrupt signal, which further includes:
基于所述第二中断信号时,读取极值寄存器的最大值和最小值,并根据所述最大值确定光谱信号的峰值;When based on the second interrupt signal, read the maximum value and the minimum value of the extreme value register, and determine the peak value of the spectral signal according to the maximum value;
将所述下限阈值设置为三级采样数据D4对应的最小刻度值,将所述上限阈值设置为光谱信号上升沿处的采样数据值,并通过所述上限阈值监测脉冲信号的三级采样数据D4,确定脉冲的最大峰值。The lower threshold is set to the minimum scale value corresponding to the third-level sampling data D4, the upper threshold is set to the sampling data value at the rising edge of the spectral signal, and the third-level sampling data D4 of the pulse signal is monitored by the upper threshold , to determine the maximum peak value of the pulse.
本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在所写的说明书以及附图中所特别指出的结构来实现和获得。Other features and advantages of the present invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and drawings.
下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。The technical solutions of the present invention will be further described in detail below through the accompanying drawings and embodiments.
附图说明Description of drawings
附图用来提供对本发明的进一步理解,并且构成说明书的一部分,与本发明的实施例一起用于解释本发明,并不构成对本发明的限制。在附图中:The accompanying drawings are used to provide a further understanding of the present invention, and constitute a part of the specification, and are used to explain the present invention together with the embodiments of the present invention, and do not constitute a limitation to the present invention. In the attached image:
图1为本发明实施例中一种光谱信号数据采样和峰值检测方法的电路结构示意图;1 is a schematic diagram of a circuit structure of a spectral signal data sampling and peak detection method in an embodiment of the present invention;
图2为本发明实施例中一种光谱信号数据采样和峰值检测方法的流程示意图;2 is a schematic flowchart of a method for spectral signal data sampling and peak detection in an embodiment of the present invention;
图1中,探测器-1000;前置放大电路-2000;放大、滤波调理电路-3000;ΣΔADC模数转换模块-4000;电气隔离电路-5000;MCU-6000;DFSDM模块-6100;第一Sincx滤波器-6110;数据校准寄存器-6140;极值寄存器-6130;最大值-6131;最小值-6132;DMA控制器-6200;存储单元-6300;模拟看门狗-6120;第二Sincx滤波器-6121;下限阈值-6122;上限阈值6123。In Figure 1, detector-1000; preamplifier circuit-2000; amplification, filter conditioning circuit-3000; ΣΔ ADC analog-to-digital conversion module-4000; electrical isolation circuit-5000; MCU-6000; DFSDM module-6100; first Sinc x Filter - 6110; Data Calibration Register - 6140; Extreme Value Register - 6130; Max - 6131; Min - 6132 ; DMA Controller - 6200; Filter-6121; Lower Threshold-6122;
具体实施方式Detailed ways
以下结合附图对本发明的优选实施例进行说明,应当理解,此处所描述的优选实施例仅用于说明和解释本发明,并不用于限定本发明。The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, but not to limit the present invention.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序,“多个”的含义是两个或两个以上,除非另有明确具体的限定。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any relationship between these entities or operations. In the absence of any such actual relationship or order, "plurality" means two or more, unless expressly specifically limited otherwise. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus.
尽管已经示出和描述了本发明的实施例,对于本领域的普通技术人员而言,可以理解在不脱离本发明的原理和精神的情况下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由所附权利要求及其等同物限定。Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, and substitutions can be made in these embodiments without departing from the principle and spirit of the invention and modifications, the scope of the present invention is defined by the appended claims and their equivalents.
实施例1:Example 1:
本发明实施例提供了一种光谱信号数据采样和峰值检测方法,包括:The embodiment of the present invention provides a spectral signal data sampling and peak detection method, including:
获取光信号,将所述光信号通过探测器1000产生电信号Vi,并将所述电信号通过前置放大电路2000,获取第一电压信号Va;acquiring an optical signal, passing the optical signal through the
将所述第一电压信号Va通过放大、滤波调理电路3000进行放大和滤波处理,获取第二电压信号Vb;Amplify and filter the first voltage signal Va through the amplification, filtering and
将所述第二电压信号Vb通过ΣΔADC模数转换模块4000进行模数转换,获取转换后模拟侧的第一串行数字信号D1;Perform analog-to-digital conversion on the second voltage signal Vb through the ΣΔ ADC analog-to-
将所述第一串行数字信号D1通过电气隔离电路5000进行电气隔离,获取数字电路侧的第二串行数字信号D2;The first serial digital signal D1 is electrically isolated by the
将所述第二串行数字信号D2通过第一Sincx滤波器6110进行滤波,获取一级采样数据D3;Filtering the second serial digital signal D2 through the first Sinc x filter 6110 to obtain first-level sampling data D3;
将所述一级采样数据D3通过数据校准寄存器6140进行零偏误差和线性误差校准,获取二级采样数据D5,并将所述二级采样数据D5通过极值寄存器6130进行极值监测,确定二级采样数据D5对应的最大值6131和最小值6132;The first-level sampling data D3 is calibrated for zero offset error and linearity error through the
将所述二级采样数据D5通过DMA控制器6200输出到存储单元6300进行数据保存;The secondary sampling data D5 is output to the
本技术方案实施的原理:本技术方案中在光伏模式下,探测器产生的与光信号功率成线性关系的电信号,经前置放大,转换为电压信号,经放大、滤波调理,进入ΣΔADC进行模数转换模块,转换的数据经电气隔离送到MCU内部DFSDM模块;DFSDM模块具有硬件Sincx滤波器、硬件模拟看门狗监测和极值监测等功能,采样数据经过DFSDM模块内的滤波、模拟看门狗监测、极值监测等信号及中断处理,获得光谱信号的峰值数据,通过模拟看门狗监测采样数据的上升沿和下降沿,在上升沿和下降沿时产生中断,在上升沿中断时开始监测信号的峰值,下降沿中断时读取光谱信号的峰值,在数据采样和峰值检测过程除了模拟看门狗中断时,中断服务程序会占用MCU运行时间,其他数据滤波、极值检测和数据保存都是MCU内部硬件实现;The principle of the implementation of this technical solution: In this technical solution, in the photovoltaic mode, the electrical signal generated by the detector, which has a linear relationship with the power of the optical signal, is pre-amplified, converted into a voltage signal, amplified, filtered and conditioned, and then enters the ΣΔ ADC for processing. Analog-to-digital conversion module, the converted data is sent to the DFSDM module inside the MCU through electrical isolation; the DFSDM module has functions such as hardware Sinc x filter, hardware analog watchdog monitoring and extreme value monitoring, and the sampled data is filtered and simulated in the DFSDM module. Watchdog monitoring, extreme value monitoring and other signals and interrupt processing, obtain the peak data of the spectral signal, monitor the rising and falling edges of the sampled data through the analog watchdog, generate interrupts on the rising and falling edges, and interrupt on the rising edge When the peak value of the signal is monitored, the peak value of the spectral signal is read when the falling edge is interrupted. During the data sampling and peak detection process, except for the analog watchdog interrupt, the interrupt service routine will occupy the MCU running time, other data filtering, extreme value detection and Data storage is realized by internal hardware of MCU;
上述技术方案的有益效果为:本技术方案中的中断服务程序中只有设置看门狗上下限阈值寄存器、读取极值寄存器和峰值计算处理等简单操作,MCU占用时间非常短,MCU内置的数字部分DFSDM模块提供串行连接外部ΣΔADC模数转换模块,支持SPI、曼切斯特协议,支持20MHz的串行数据输入,速度快并且方便数字和模拟电路的电气隔离,且Sincx滤波器技术,有FastSinc、Sinc1、Sinc2、Sinc3、Sinc4和Sinc5六种滤波算法和1-1024种过采样率,可以根据要检测的光谱信号类型、信号频率和信号带宽,通过软件设置进行不同的滤波处理,增加了光谱信号检测电路硬件的通用型,并且采用MCU内部硬件Sincx滤波器技术,不需要MCU参与,有利于加快信号处理速度,且通过数据校准寄存器内的零偏误差和线性误差值对脉冲信号的采样数据进行实时硬件自动校准,使采样数据更准确。The beneficial effects of the above technical solution are: in the interrupt service routine in this technical solution, there are only simple operations such as setting the upper and lower limit threshold registers of the watchdog, reading the extreme value registers, and processing the peak value, and the MCU occupies a very short time. Some DFSDM modules provide serial connection of external ΣΔ ADC analog-to-digital conversion modules, support SPI, Manchester protocol, support 20MHz serial data input, fast speed and convenient electrical isolation of digital and analog circuits, and Sinc x filter technology, There are FastSinc, Sinc 1 , Sinc 2 , Sinc 3 , Sinc 4 and Sinc 5 six filtering algorithms and 1-1024 kinds of oversampling rate, which can be different through software settings according to the type of spectral signal to be detected, signal frequency and signal bandwidth The filtering processing of the optical spectrum signal detection circuit increases the general type of the hardware of the spectral signal detection circuit, and adopts the MCU internal hardware Sinc x filter technology, which does not require the participation of the MCU, which is conducive to speeding up the signal processing speed, and calibrates the zero offset error and linearity in the register through the data. The error value performs real-time hardware automatic calibration on the sampled data of the pulse signal to make the sampled data more accurate.
实施例2:Example 2:
在一个实施例中,所述将所述第二串行数字信号D2通过第一Sincx滤波器6110进行滤波,获取一级采样数据D3,还包括:In one embodiment, the filtering of the second serial digital signal D2 through the first Sinc x filter 6110 to obtain the first-level sampling data D3 further includes:
将所述第二串行数字信号D2通过模拟看门狗6120中的第二Sincx滤波器6121进行滤波,获取三级采样数据D4;Filter the second serial digital signal D2 through the second Sinc x filter 6121 in the analog watchdog 6120 to obtain three-level sampling data D4;
根据所述三级采样数据D4设置上限阈值6123和下限阈值6122;其中,所述下限阈值对应为所述三级采样数据D4的最小刻度值,所述上限阈值设置为光谱信号有效上升沿处的采样数据值,通过上限阈值6123监测光谱信号的三级采样数据D4;The
当所述三级采样数据D4大于所述上限阈值6123时,确定监测到光谱信号的上升沿,所述模拟看门狗6120产生第一中断信号;When the three-level sampling data D4 is greater than the
本技术方案实施的原理:串行数字信号分为两路,其中一路通过第一Sincx滤波器、数据校准寄存器分别进行滤波和校准,另一路进入模拟看门狗的第二Sincx滤波器进行滤波,其中,第一Sincx滤波器和第二Sincx滤波器采用相同的类型和模式,通过第二Sincx滤波器将串行数据进行串并转换生成并行的采样数据D4,利用DFSDM模块的模拟看门狗大于上限阈值或小于下限阈值即产生中断的特性监测采样数据D4,将下限阈值设为采样数据D4的最小刻度值,并将上限阈值设置为光谱信号有效上升沿处的采样数据值,通过上限阈值监测光谱信号的采样数据D4,且模拟看门狗的上限阈值和下限阈值可通过数据校准寄存器的数据在程序设置时校准,此时可通过上限阈值和下限阈值针对二级采样数据D5进行监测;The principle of the implementation of this technical solution: the serial digital signal is divided into two channels, one of which is filtered and calibrated respectively through the first Sinc x filter and the data calibration register, and the other channel enters the second Sinc x filter of the analog watchdog for Filtering, wherein the first Sinc x filter and the second Sinc x filter use the same type and mode, and the serial data is serial-parallel converted through the second Sinc x filter to generate parallel sampled data D4, using the DFSDM module. When the analog watchdog is larger than the upper threshold or smaller than the lower threshold, an interrupt is generated. Monitor the sampling data D4, set the lower threshold as the minimum scale value of the sampling data D4, and set the upper threshold as the sampling data value at the valid rising edge of the spectrum signal , the sampling data D4 of the spectral signal is monitored through the upper threshold, and the upper and lower thresholds of the analog watchdog can be calibrated during program setting through the data in the data calibration register. At this time, the upper and lower thresholds can be used for the secondary sampling data. D5 to monitor;
上述技术方案的有益效果为:本技术方案中针对串行数字信号进行传输时,采用两种Sincx滤波器进行滤波,模拟看门狗内部的第二Sincx滤波器能够快速监测数据并产生中断,并且Sincx滤波器技术,有FastSinc、Sinc1、Sinc2、Sinc3、Sinc4和Sinc5六种滤波算法和1-1024种过采样率,可以根据要检测的光谱信号类型、信号频率和信号带宽,通过软件设置进行不同的滤波处理,增加了光谱信号检测电路硬件的通用型并且能够降低噪声干扰,通过设置上限阈值和下限阈值监测二级采样数据D4,有利于获取从光谱信号从上升沿到下降沿之间的三级采样数据D5的最大值,进而确定光谱信号的峰值。The beneficial effects of the above technical solution are: in the technical solution, when the serial digital signal is transmitted, two kinds of Sinc x filters are used for filtering, and the second Sinc x filter inside the analog watchdog can quickly monitor data and generate interruptions. , and Sinc x filter technology, there are FastSinc, Sinc 1 , Sinc 2 , Sinc 3 , Sinc 4 and Sinc 5 six filtering algorithms and 1-1024 oversampling rates, which can be detected according to the type of spectral signal to be detected, signal frequency and Signal bandwidth, different filtering processing is performed through software settings, which increases the versatility of the spectral signal detection circuit hardware and can reduce noise interference. By setting the upper and lower thresholds to monitor the secondary sampling data D4, it is beneficial to obtain the spectral signal from the rising The maximum value of the three-level sampling data D5 between the edge and the falling edge is used to determine the peak value of the spectral signal.
实施例3:Example 3:
在一个实施例中,所述当所述三级采样数据D4大于所述上限阈值6123时,确定监测到光谱信号的上升沿,所述模拟看门狗6120产生第一中断信号,还包括:In one embodiment, when the three-level sampling data D4 is greater than the
当所述模拟看门狗6120产生所述第一中断信号时,获取极值寄存器6130中的最大值6131和最小值6132,并将所述最大值和最小值进行清零处理;When the analog watchdog 6120 generates the first interrupt signal, obtains the
通过极值寄存器6130对所述二级采样数据D5进行二次极值监测,确定二次极值监测的最大值和最小值;Perform secondary extreme value monitoring on the secondary sampling data D5 through the
将所述二次监测的最大值和最小值更新为最大值6131和最小值6132,将所述最大值设置为三级采样数据D4对应的最大刻度值,将所述最小值设置为光谱信号下降沿处的采样数据值;Update the maximum value and minimum value of the secondary monitoring to the
基于所述最小值,通过所述模拟看门狗6120对光谱信号的三级采样数据D4进行监测,当监测到光谱信号的三级采样数据D4小于所述下限阈值6122时,表示监测到光谱信号的下降沿,所述模拟看门狗6120产生第二中断信号;Based on the minimum value, the third-level sampling data D4 of the spectral signal is monitored by the analog watchdog 6120. When the monitored third-level sampling data D4 of the spectral signal is less than the
本技术方案实施的原理:本技术方案中通过模拟看门狗监测采样数据的上升沿和下降沿,在上升沿和下降沿时产生中断,在上升沿中断时开始监测信号的峰值,下降沿中断时读取光谱信号的峰值,在数据采样和峰值检测过程除了模拟看门狗中断时,中断服务程序会占用MCU运行时间,其他数据滤波、极值检测和数据保存都是MCU内部硬件实现;The principle of the implementation of this technical solution: In this technical solution, the rising edge and falling edge of the sampled data are monitored by an analog watchdog, an interrupt is generated at the rising edge and the falling edge, and the peak value of the signal is monitored when the rising edge is interrupted, and the falling edge is interrupted. When reading the peak value of the spectral signal, in the data sampling and peak detection process, except for the analog watchdog interrupt, the interrupt service routine will occupy the MCU running time. Other data filtering, extreme value detection and data storage are implemented by the internal hardware of the MCU;
上述技术方案的有益效果为:本技术方案中通过采用硬件过采样技术可以提高采样的分辨率,通过采用DFSDM模块内部模拟看门狗替代外部比较触发电路,有利于节约成本并提高电路运行效率,通过内部极值寄存器实时监测采样数据的最大值和最小值,不需要MCU软件干预,硬件实现寻峰计算,提高了脉冲信号的峰值检测能力。The beneficial effects of the above technical solution are: in the technical solution, the resolution of sampling can be improved by adopting the hardware oversampling technology, and the internal analog watchdog of the DFSDM module is used to replace the external comparison trigger circuit, which is conducive to saving costs and improving circuit operation efficiency. The maximum and minimum values of the sampled data are monitored in real time through the internal extreme value register, without the need for MCU software intervention, and the hardware realizes the peak-finding calculation, which improves the peak detection capability of the pulse signal.
实施例4:Example 4:
在一个实施例中,所述基于所述最小值,通过所述模拟看门狗6120对光谱信号的三级采样数据D4进行监测,当监测到光谱信号的三级采样数据D4小于所述下限阈值6122时,表示监测到光谱信号的下降沿,所述模拟看门狗6120产生第二中断信号,还包括:In one embodiment, based on the minimum value, the analog watchdog 6120 monitors the third-level sampling data D4 of the spectral signal, and when it is detected that the third-level sampling data D4 of the spectral signal is less than the lower threshold At 6122, it indicates that the falling edge of the spectrum signal is monitored, and the analog watchdog 6120 generates a second interrupt signal, which further includes:
基于所述第二中断信号时,读取极值寄存器6130的最大值和最小值,并根据所述最大值确定光谱信号的峰值;When based on the second interrupt signal, read the maximum value and the minimum value of the
将所述下限阈值6122设置为三级采样数据D4对应的最小刻度值,将所述上限阈值6123设置为光谱信号上升沿处的采样数据值,并通过所述上限阈值6123监测脉冲信号的三级采样数据D4,确定脉冲的最大峰值;The
本技术方案实施的原理:本技术方案中通过中断服务程序收到的中断信号,读取极值寄存器的最大值和最小值,此最大值即为光谱信号从上升沿开始到下降沿结束之间采样数据的最大值,也就是检测到的光谱信号的峰值,中断服务程序将下限阈值设为三级采样数据D4的最小刻度值,将上限阈值用于监测脉冲信号的三级采样数据D4,并重复上述步骤实现对每一脉冲信号进行采样处理,实现脉冲最大峰值的实时检测;The principle of the implementation of this technical solution: In this technical solution, the interrupt signal received by the interrupt service program is used to read the maximum and minimum values of the extreme value register. The maximum value is the time between the rising edge and the falling edge of the spectral signal. The maximum value of the sampled data, that is, the peak value of the detected spectral signal, the interrupt service routine sets the lower threshold as the minimum scale value of the third-level sampling data D4, and the upper threshold is used to monitor the third-level sampling data D4 of the pulse signal, and Repeat the above steps to realize sampling processing of each pulse signal, and realize real-time detection of the maximum peak value of the pulse;
上述技术方案的有益效果为:本技术方案中采用DFSDM模块内部极值寄存器实时监测采样数据的最大值和最小值,不需要MCU软件干预,硬件实现寻峰计算,提高了脉冲信号的峰值检测能力并加快信号处理速度,通过模拟看门狗替代外部比较触发电路,有利于节约成本并提高电路的运行效率。The beneficial effects of the above technical solution are as follows: in this technical solution, the maximum and minimum values of the sampled data are monitored in real time by using the extreme value register inside the DFSDM module, no MCU software intervention is required, and the hardware realizes the peak-finding calculation, which improves the peak detection capability of the pulse signal. And speed up the signal processing speed, and replace the external comparison trigger circuit by the analog watchdog, which is beneficial to save the cost and improve the operation efficiency of the circuit.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including but not limited to disk storage, optical storage, and the like.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block in the flowcharts and/or block diagrams, and combinations of flows and/or blocks in the flowcharts and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in one or more of the flowcharts and/or one or more blocks of the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions An apparatus implements the functions specified in a flow or flows of the flowcharts and/or a block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in one or more of the flowcharts and/or one or more blocks of the block diagrams.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit and scope of the invention. Thus, provided that these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210496492.2A CN114608705B (en) | 2022-05-09 | 2022-05-09 | Spectral signal data sampling and peak value detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210496492.2A CN114608705B (en) | 2022-05-09 | 2022-05-09 | Spectral signal data sampling and peak value detection method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114608705A true CN114608705A (en) | 2022-06-10 |
CN114608705B CN114608705B (en) | 2022-07-29 |
Family
ID=81867961
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210496492.2A Active CN114608705B (en) | 2022-05-09 | 2022-05-09 | Spectral signal data sampling and peak value detection method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114608705B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102749137A (en) * | 2011-04-21 | 2012-10-24 | 王伟兰 | CCD (charge-coupled device) spectral signal universal acquisition system design based on FPGA (field programmable gate array) and USB2.0 (universal series bus) protocol interface |
US20130182259A1 (en) * | 2009-12-01 | 2013-07-18 | Mark Brezinski | System and method for calibrated spectral domain optical coherence tomography and low coherence interferometry |
CN203178718U (en) * | 2013-01-21 | 2013-09-04 | 刘淼 | Novel intelligent controller of on-site near infrared spectrum detection apparatus |
US20130293702A1 (en) * | 2010-11-01 | 2013-11-07 | The Hong Kong Research Institute Of Textiles And Apparel Limited | Multispectral imaging color measurement system and method for processing imaging signals thereof |
CN103487776A (en) * | 2013-09-14 | 2014-01-01 | 西安奇维科技股份有限公司 | Error correcting method based on FPGA |
CN104111114A (en) * | 2014-06-18 | 2014-10-22 | 中山大学 | Spectrum measurement method, device and system |
CN204009488U (en) * | 2014-06-06 | 2014-12-10 | 苏州泽众新能源科技有限公司 | A kind of data acquisition unit |
CN205484178U (en) * | 2016-01-04 | 2016-08-17 | 中国人民解放军后勤工程学院 | A oxygen concentration detection system that is used for guard station system oxygen system of tibet frontier guards |
CN109405969A (en) * | 2018-12-11 | 2019-03-01 | 中国科学院合肥物质科学研究院 | A kind of airborne DOAS spectrometer imaging and control circuit |
-
2022
- 2022-05-09 CN CN202210496492.2A patent/CN114608705B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130182259A1 (en) * | 2009-12-01 | 2013-07-18 | Mark Brezinski | System and method for calibrated spectral domain optical coherence tomography and low coherence interferometry |
US20130293702A1 (en) * | 2010-11-01 | 2013-11-07 | The Hong Kong Research Institute Of Textiles And Apparel Limited | Multispectral imaging color measurement system and method for processing imaging signals thereof |
CN102749137A (en) * | 2011-04-21 | 2012-10-24 | 王伟兰 | CCD (charge-coupled device) spectral signal universal acquisition system design based on FPGA (field programmable gate array) and USB2.0 (universal series bus) protocol interface |
CN203178718U (en) * | 2013-01-21 | 2013-09-04 | 刘淼 | Novel intelligent controller of on-site near infrared spectrum detection apparatus |
CN103487776A (en) * | 2013-09-14 | 2014-01-01 | 西安奇维科技股份有限公司 | Error correcting method based on FPGA |
CN204009488U (en) * | 2014-06-06 | 2014-12-10 | 苏州泽众新能源科技有限公司 | A kind of data acquisition unit |
CN104111114A (en) * | 2014-06-18 | 2014-10-22 | 中山大学 | Spectrum measurement method, device and system |
CN205484178U (en) * | 2016-01-04 | 2016-08-17 | 中国人民解放军后勤工程学院 | A oxygen concentration detection system that is used for guard station system oxygen system of tibet frontier guards |
CN109405969A (en) * | 2018-12-11 | 2019-03-01 | 中国科学院合肥物质科学研究院 | A kind of airborne DOAS spectrometer imaging and control circuit |
Also Published As
Publication number | Publication date |
---|---|
CN114608705B (en) | 2022-07-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111147079B (en) | Data acquisition method and device with adaptive and adjustable sampling frequency | |
CN114614825B (en) | Low-cost high-speed pulse signal data sampling and peak value detection method | |
CN104374831B (en) | Acoustic emission detection system based on FPGA | |
CN107478402A (en) | A kind of low-frequency vibration displacement detection system and method | |
CN104880597A (en) | Programmable logic circuit based weak signal detection method | |
WO2024036836A1 (en) | Ultrasonic vibration fusion adaptive conditioning circuit and flexible module | |
CN202372568U (en) | Dynamic data acquisition device | |
CN105259086A (en) | Detection method and system of dust concentration | |
CN114608705B (en) | Spectral signal data sampling and peak value detection method | |
CN1627087A (en) | Electric power meter | |
CN104267056A (en) | X-ray fluorescence tester for testing heavy metal pollution of soil | |
CN210745091U (en) | Signal acquisition circuit | |
CN104879294B (en) | A kind of water pump transient signal analytical equipment and method | |
CN118759280A (en) | Variable sampling rate measurement device and control method thereof, and storage medium | |
CN117870786A (en) | Signal acquisition method, system and equipment of ultrasonic flowmeter and readable medium | |
CN206132233U (en) | Multi -photon count system | |
CN204389018U (en) | Vibration and noise detection device | |
CN214480520U (en) | Circuit for alpha and beta pulse signal digital processing | |
CN110530766B (en) | A kind of particle concentration measurement method and device | |
CN109342660A (en) | Single-chip-based gas sensor array output detection system and detection method | |
CN114063139A (en) | A digital multi-channel pulse amplitude analysis device | |
CN108470148B (en) | Engine rotating speed detection method, engine rotating speed detection system, internet platform and application of internet platform | |
CN207304521U (en) | Inverse lock-in amplifier and household electrical appliance | |
CN221992836U (en) | Vibration acceleration integration device based on multiple data screening | |
CN112073035A (en) | Self-adaptive filtering method for PSD (phase-sensitive Detector) signals |
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 | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: 430074 No. 1, floor 2, building 4, No. 52, Guanggu Avenue, Donghu New Technology Development Zone, Wuhan City, Hubei Province (Wuhan area of free trade zone) Patentee after: Hubei Fangyuan Scientific Instrument Co.,Ltd. Country or region after: China Address before: No.1, 2nd Floor, Building 4, No. 52 Guanggu Avenue, Donghu New Technology Development Zone, Wuhan City, Hubei Province (Free Trade Zone Wuhan Area) Patentee before: HUBEI FANGYUAN ENVIRONMENTAL PROTECTION SCIENCE & TECHNOLOGY Co.,Ltd. Country or region before: China |
|
PE01 | Entry into force of the registration of the contract for pledge of patent right | ||
PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: A method for sampling and peak detection of spectral signal data Granted publication date: 20220729 Pledgee: Guanggu Branch of Wuhan Rural Commercial Bank Co.,Ltd. Pledgor: Hubei Fangyuan Scientific Instrument Co.,Ltd. Registration number: Y2025980010926 |