4
Software design of FBG temperature demodulation system based on wavelet denoising HU Wen-xia Nanchang Hangkong University NIAT Nanchang, China [email protected] WAN Sheng-peng Nanchang Hangkong University NIAT Nanchang, China [email protected] ZHANG Hui-lian Nanchang Hangkong University NIAT Nanchang, China [email protected] AbstractA principle of Fiber Bragg Grating wavelength demodulation system based on DSP was elaborated.Using specturm rebuilding scheme based on wavelet denoising to improve wavelength detection accuracy while the dealing process of specturm rebuilding is simulated by MATLAB and the result is discussed. The design of VC++ applications can realize demodulation of the wavelength information collected by DSP in using of a key. Finally, a method of mixed programming using VC++ and MATLAB was presented to complete Specturm rebuilding. The experiment indicates that the software functions are effective,and the precision of the measurement can reach to 0.1 . Keywords-FBG demodulation; VC++; MATLAB; Mixed programming; Specturm rebuilding; Wavelet de-noising I. INTRODUCTION Fiber Bragg grating (FBG) is a kind of optical passive components ,and its refractive index is fixed periodic distribution. As a sensitive element, FBG has been used widely in the field of fiber Optical Sensors at present[1-2]. FBG sensors has become a hotspot in the field of sensor technology in recent years, which not only has the advantages of fiber optic sensors, but they are also stable and reliable.They can measure the change of the environment absolutely without being influenced by the light fluctuation. With the development of research,many unique advantages of FBG in sensing has been found, such as anti- electromagnetic interference and anti-corrosion.Therefore, FBG sensors have wider application prospects than any other fiber optical sensors [3-4]. Wavelength-encoded signal demodulation is one of the key techniques for FBG sensing system to enter into a practicable step. MATLAB is a most widely used mathematical software in the world, which has powerful functions ,such as numerical calculation , data processing and analysis. But MATLAB can only be used on its own platform.Users must install the MATLAB system on the machine to execute *.m fileswhich limit the use of MATLAB greatly. So a method of mixed programming using VC++ and MATLAB was presented to design host PC software. II. DEMODULATION PRINCIPLE OF THE SYSTEM Figure 1 is the sensing system structure. A light that comes from the broadband light source enter the sensor grating after through the coupler. FBG1 reflection signal light through coupler 1 and coupler 2 enter FBG2. The FBG2 have been calibrated beforehand and the wavelength can be adjusted. Sensing signal light after the FBG2 reflection enters the photo detector through the coupler 2.The photo detector transforms the light signal to the electrical signal,and enlarges the electrical signal through an amplifying circuit. At last, we process the signal by a DSP[5]. Figure 1. Sensing system structure The optical connections exist inherent reflection in the demodulation system shown in Fig.1.The interference effect from the reflected light and signal light will produce noise.In addition,optical detection circuit will introduce some noise. These noise will cause the output signal waveform distortion.So it is not accurate to determine the position of the center wavelength by using peak-detection algorithm.It will increase the system error. In order to improve the measurement accuracy of the system, filtering noise and reconstructing the polluted signal is necessary. Considering the practicability and feasibility,grating-matching demodulation method is employed in this demodulating system introduced in this paper. Experimental platform was built. Using Specturm rebuilding scheme based on wavelet de-noising to improve wavelength detection accuracy. III. HOST PC SOFTWARE DESIGN OF THE DEMODULATION SYSTEM The key of realizing various functions of the sensing system is host PC software design ,which must have fully functions and easy to be operated. The software also need some basic functions, This work was supported by the National Natural Science Foundation of China under grant No.61067005, the Key Project of Chinese Ministry of Education under grant No.210119, the Aviation Science Foundation under Grant No. 2010ZA56001, and by the Key Laboratory of Nondestructive Testing (Ministry of Education), Nanchang Hangkong University under grant No. ZD200929008. 978-1-4244-6554-5/11/$26.00 ©2011 IEEE

[IEEE 2011 Symposium on Photonics and Optoelectronics (SOPO 2011) - Wuhan, China (2011.05.16-2011.05.18)] 2011 Symposium on Photonics and Optoelectronics (SOPO) - Software Design of

Embed Size (px)

Citation preview

Page 1: [IEEE 2011 Symposium on Photonics and Optoelectronics (SOPO 2011) - Wuhan, China (2011.05.16-2011.05.18)] 2011 Symposium on Photonics and Optoelectronics (SOPO) - Software Design of

Software design of FBG temperature demodulation system based on wavelet denoising

HU Wen-xia Nanchang Hangkong University

NIAT Nanchang, China

[email protected]

WAN Sheng-peng Nanchang Hangkong University

NIAT Nanchang, China

[email protected]

ZHANG Hui-lian Nanchang Hangkong University

NIAT Nanchang, China

[email protected]

Abstract—A principle of Fiber Bragg Grating wavelength demodulation system based on DSP was elaborated.Using specturm rebuilding scheme based on wavelet denoising to improve wavelength detection accuracy , while the dealing process of specturm rebuilding is simulated by MATLAB and the result is discussed. The design of VC++ applications can realize demodulation of the wavelength information collected by DSP in using of a key. Finally, a method of mixed programming using VC++ and MATLAB was presented to complete Specturm rebuilding. The experiment indicates that the software functions are effective,and the precision of the measurement can reach to 0.1℃.

Keywords-FBG demodulation; VC++; MATLAB; Mixed programming; Specturm rebuilding; Wavelet de-noising

I. INTRODUCTION Fiber Bragg grating (FBG) is a kind of optical passive

components ,and its refractive index is fixed periodic distribution. As a sensitive element, FBG has been used widely in the field of fiber Optical Sensors at present[1-2]. FBG sensors has become a hotspot in the field of sensor technology in recent years, which not only has the advantages of fiber optic sensors, but they are also stable and reliable.They can measure the change of the environment absolutely without being influenced by the light fluctuation. With the development of research,many unique advantages of FBG in sensing has been found, such as anti- electromagnetic interference and anti-corrosion.Therefore, FBG sensors have wider application prospects than any other fiber optical sensors [3-4]. Wavelength-encoded signal demodulation is one of the key techniques for FBG sensing system to enter into a practicable step.

MATLAB is a most widely used mathematical software in the world, which has powerful functions ,such as numerical calculation , data processing and analysis. But MATLAB can only be used on its own platform.Users must install the MATLAB system on the machine to execute *.m files,which limit the use of MATLAB greatly. So a method of mixed programming using VC++ and MATLAB was presented to design host PC software.

II. DEMODULATION PRINCIPLE OF THE SYSTEM Figure 1 is the sensing system structure. A light that comes

from the broadband light source enter the sensor grating after

through the coupler. FBG1 reflection signal light through coupler 1 and coupler 2 enter FBG2. The FBG2 have been calibrated beforehand and the wavelength can be adjusted. Sensing signal light after the FBG2 reflection enters the photo detector through the coupler 2.The photo detector transforms the light signal to the electrical signal,and enlarges the electrical signal through an amplifying circuit. At last, we process the signal by a DSP[5].

Figure 1. Sensing system structure

The optical connections exist inherent reflection in the demodulation system shown in Fig.1.The interference effect from the reflected light and signal light will produce noise.In addition,optical detection circuit will introduce some noise. These noise will cause the output signal waveform distortion.So it is not accurate to determine the position of the center wavelength by using peak-detection algorithm.It will increase the system error.

In order to improve the measurement accuracy of the system, filtering noise and reconstructing the polluted signal is necessary. Considering the practicability and feasibility,grating-matching demodulation method is employed in this demodulating system introduced in this paper. Experimental platform was built. Using Specturm rebuilding scheme based on wavelet de-noising to improve wavelength detection accuracy.

III. HOST PC SOFTWARE DESIGN OF THE DEMODULATION SYSTEM

The key of realizing various functions of the sensing system is host PC software design ,which must have fully functions and easy to be operated. The software also need some basic functions,

This work was supported by the National Natural Science Foundation of China under grant No.61067005, the Key Project of Chinese Ministry of Education under grant No.210119, the Aviation Science Foundation under Grant No. 2010ZA56001, and by the Key Laboratory of Nondestructive Testing (Ministry of Education), Nanchang Hangkong University under grant No. ZD200929008.

978-1-4244-6554-5/11/$26.00 ©2011 IEEE

Page 2: [IEEE 2011 Symposium on Photonics and Optoelectronics (SOPO 2011) - Wuhan, China (2011.05.16-2011.05.18)] 2011 Symposium on Photonics and Optoelectronics (SOPO) - Software Design of

such as monitoring data processing, managing the information, displaying the graphic, monitoring report generation.The design of the software is based on the development platform of Visual C++,using MFC(Microsoft Foundation ClassLibrary)[6]for application programming. The most important function of host PC software is filtering the data from USB, calculating the peak and demodulating temperature.

A. Basic principles,methods and simulation of wavelet de-noising The template is used to format your paper and style the text.

All margins, column widths, line spaces, and text fonts are prescribed; please do not alter them. You may note peculiarities. For example, the head margin in this template measures proportionately more than is customary. This measurement and others are deliberate, using specifications that anticipate your paper as one part of the entire proceedings, and not as an independent document. Please do not revise any of the current designations.

Using wavelet analysis[8-10] for eliminating signal noise is one of very important applications. The model of one-dimensional signal with noise can be expressed as:

s(i)=f(i)+σe(i) i=0,1,2,…,n-1 (1)

In the equation (1): f (i) is the real signal, e (i) is the noise, s (i) is the signal with noise. The noise model here is a simple one, that is to say, e (i) is the Gaussian white noise N (0,1), the level of noise is 1. In practical engineering, the useful signal usually appears as low frequency signals or smooth signals and noise signal is behaved for high frequency signal relatively.Therefore, de-noising process can be taken by the following methods.

Firstly, The appropriate wavelet and the number of layers N needs to be determined,and then the actual signal should be decomposed with the wavelet.Secondly, we can do threshold quantization process to high frequency coefficients of wavelet decomposition.Finally, the low frequency coefficients from the layer N and the high frequency coefficients after quantized from layer 1 to N are needed to achieve wavelet reconstruction.The purpose of it is to eliminate the noise.

There are three methods of wavelet denoising generally:

(1) Mandatory denoising. This method changes the high frequency part of the wavelet decomposition to zero, that is to say,the high frequency components are eliminated completely .The signal can be reconstructed by this way. The advantages of this method is simple, the signal after denoising is smooth relatively, but the useful information is easy to be lost.

(2) Default threshold denoising. The default threshold of the singal can be generated by a function named ddencmp in MATLAB, and then we can use another function named wdencmp which is also in MATLAB filtering the polluted signal.

(3) Denoising with given the soft or hard threshold.Denoising in the actual process, the value of threshold can be obtained through the empirical formula, and this kind of threshold is more reliable than the default threshold.

Figure 2. Bragg signal with additive noise

Figure 3. Signal after Wavelet denoising

As above, the dealing process of specturm rebuilding is simulated by MATLAB[7]. Fig.2 and Fig.3 represents Bragg signal with additive noise and signal after Wavelet de-noising respectively.The center wavelength of FBG is 1550nm in ideal condition. Among them, the Fig.2 is the spectra of sampling 1100 points from 1549nm to 1551nm in one second, The sampling frequency is 1100Hz, and the step length is 1.8 pm. When the value reaches maximum, the number of sampling points is 562 showed in Fig.2. The center wavelength of FBG can be calculateded,which is 1550.0116nm. The relative error can be showed below:

100%B B BB B

λ λ λλ λ

′Δ −= ×

1550.0116 1550 100%1550

nm nmnm

−= × =0.000748 (2)

But the number of sampling points is 556 showed in the Fig.3. And the center wavelength of FBG is 1550.0116nm. The relative error can be expressed:

Page 3: [IEEE 2011 Symposium on Photonics and Optoelectronics (SOPO 2011) - Wuhan, China (2011.05.16-2011.05.18)] 2011 Symposium on Photonics and Optoelectronics (SOPO) - Software Design of

100%B B BB B

λ λ λλ λ

′Δ −= ×

1550.0008 1550 100%1550

nm nmnm

−= × =0.000052 (3)

The figures show that the signal after wavelet decomposition and reconstruction has filtered out most of interference information, which can decrease the system error during the actual measurement to improve the sensitivity. The relative error of the system decreases from 0.000748% to 0.000052%. As the uncertainty of external conditions, the measurement precision of the system is within 2pm at least, which close to the spectroscopy. But the system save costs greatly.

B. Design of host PC software In order to make the program execute independently without

MATLAB environment, we adopt a mixed programming way of VC++ and MATLAB. We need to change *. m files into C/C++ codes through the MATLAB compiler,and the necessary DLL files also must be generated.Finally, applications can be executed by the VC++ compiler. The paper takes the realization of wavelet de-noising for example to introduce the specific steps of mixed programming.

(1)Firstly, we should program*. m file under MATLAB to achieve wavelet denoising.,and save it as denoise.m.

(2)Setting MATLAB compile environment [11]. Opening MATLAB, we input at the command line state: mex - setup, and choose VC++ according to the prompt. Then we input:mbuild - setup, and choose VC++ too.

(3)Converting denoise.m to *.dll files. We input on the command line: mcc-t-h-LC-Wlib: mydenoise-Tlink: lib denoise.m. Many files will be generated under the directory of denoise.m.We use the three of them:the header file(mydenoise.h), library file(mydenoise.lib), dynamic link library file(mydenoise.dll).

(4)Setting VC++ compiler environment.Firstly,we copy the three files above to the place where VC++ project is.Secondly,we find the path Tools-options-directory inVC++ menu bar. And then we should add a path pointing to \EXTERN\INCLUDE and \ EXTERN\LIB\WIN32\MICROSOFT\MSVC60 in MATLAB installation directory respectively to include and lib.Lastly,we add #include “mydenoise.h” to *.cpp files which need to be called wavelet de-noising, meanwhile add those files including mydenoise.lib, libmx.lib, libmatlb.lib, libmmfile.lib to the path object/library modules which can be found in the path project-settings-link.

(5)Realizing function calls in VC++ compiler environment. When FBG system is in debug mode, original sampled data from USB should be saved to the corresponding array named voltage_shuzu, and then process it through the filter function

module. The dynamic link library should be cancelled after achieving noise reduction by calling mlfdenoise ().

Calling MATLAB functions can be achieved in VC++ environment after the above 5 steps. The required variables or arrays in the process of programming must be changed to the form of matrix. Because the basic data types of MATLAB is matrix. We need to transfer the saved matrix pointers to variables or the array pointers defined by C language after operation.

IV. PROGRAM RELEASE AND EXPERIMENT We can release the packaged program after completing it. We

need add some other DLLs of MATLAB besides mydenoise.dll in this process. The file named mglarchive.exe can be got after uncompressing mglinstaller.exe in MATLAB installation directory. Similarly, we can get the dynamic link library files which can be operated independently under the path bin\ win32\. And then we copy these files to the directory of compiled executable files[12]. The program can run independently released from the MATLAB environment after the process above. Finally, this paper produced a temperature query interface to provide an easier way to view the tested data. Fig.4 is the query interface. The interface, from which you can quickly get the temperature of the monitored environment, and which also improves the whole system's practicality. The main functions of this interface are: realize the selection of sensor head through the sensor selection menu; search the real-time temperature and the central wavelength by clicking the data show button; update the demodulated data by clicking the refresh button; plot the real-time waveform display as well as the query and preservation of the historical data through the waveform display key.

Figure 4. Temperature query interface

We choose the FBG temperature sensor encapsulated by steel tube, the temperature coefficient of which is 10.7pm / ℃. When the temperature of the monitored environment is 20 ℃,the central wavelength of the sensor is 1550.271nm. Electrothermal constant temperature water-bath box the paper used is produced by Beijing guohua medical equipment factory. Its model is DSY - 1-2. The range of heating of this instrument is from the room temperature to 100 ℃ , the accuracy is 0.1 ℃ . We put the

Page 4: [IEEE 2011 Symposium on Photonics and Optoelectronics (SOPO 2011) - Wuhan, China (2011.05.16-2011.05.18)] 2011 Symposium on Photonics and Optoelectronics (SOPO) - Software Design of

temperature sensor into this electrothermal constant temperature water-bath box,and then compare the deviation of modulated temperature displayed in searching interface and real temperature to testify the system testing performance through the box controlling the temperature changes. Table 1 is the measured data. From the result and the graphic of demodulation we can see the state of system is in good condition, and the error is less than 0.1 ℃.

TABLE I. COMPARISON OF CALIBRATION RESULTS

No. Measured Data Actual(℃) wavelengt(nm) Demodulation(℃)

1 2 3 4 5 6 7 8

84.3 74.5 65.6 54.6 44.8 34.8 24.8 14.9

1550.9632 1550.8604 1550.7470 1550.6428 1550.5372 1550.4366 1550.3187 1550.2151

84.2 74.5 65.5 54.6 44.7 34.9 24.8 15.0

V. CONCLUSION The paper described the design of host PC software of FBG

demodulation system in detail based on the VC++ 6.0,and uses a method of mixed programming of VC++ and MATLAB to realize wavelet denoising .The data demodulation of FBG sensing system was realized . The experiment indicates that VC++ has strong interface development capabilities and MATLAB has powerful data processing capabilities.The program can be run divorced from the MATLAB environment by using the method of VC++ compiled code,which improve the running efficiency of the program. This program in this paper

was tested in VC 6.0 and MATLAB, and obtained good results.The system's wavelength measurement accuracy is within 2 pm, the temperature demodulation accuracy is up to 0.1 ℃. In addition, both the hardware, especially through the use of high accurate capture card,and the software algorithms which can be improved can further improve the accuracy of the system. In short ,the system can be upgreated by according to the actual situation. [1] Jiang Desheng, He Wei. Review of Applications for Fiber Bragg Grating

Sensors[J]. Journal of Optoelectronics·Laser,2002,,13(4):420-430. [2] Xie Fang,Wang Huiqin. A Fiber Bragg Grating Sensing System with a

Fiber F-P Wavelength Filter[J]. Journal of Optoelectronics·Laser, 2003,14(4):359-362.

[3] Li Chuan,Zhang Yimo,Zhao Yonggui,et al. Fiber Grating:principles,techniques,and sensing applications[M] .Beijing:Science Press,2005:1-8.

[4] Kersey A D,Davis M A,Patrick H J,et al.Fiber grating sensors[J]. Journal of Lightwave Technology,1997,08.

[5] Hu Shuyang. Research on design of FBG sensors and demodulation technology in FBG sensing by using optical filters[D].Beijing: Beijing university of technology, 2004:73-80.

[6] Kong Peng.Completely self-study of Visual c++ 6.0[M].beijing: mechanical industry Press,2006.

[7] Yin Zeming,Ding Lichun.Proficient in MATLAB 6[M].beijing:higher education Press, 2002:198-209.

[8] Xu L,Krzyzak A,Suen C Y.Method of combining multiple classifiers and their application to handwriting recognition[J].IEEE Tran.SMC,1990,22(3):418-435.

[9] Zhang Renhui,Du Ming.Application of Wavelet Analysis in Denoise Processing[J].Computer Simulation,2005,22(8):69-72.

[10] Guo Jiyun,Wang Fuming. Signal Denoising Based on Wavelet Packets Transform[J]. Modern Electronics Tchnique,2007,19:55-56.

[11] Chen Ting, Yu Shun, Li Zhiming.Application of VC++ & MATLAB Program in the Automatically NC Programming System[J]. Journal of Hubei Polytechnic University, 2005,20(3):118-119.

[12] Dai Yufeng,Lu Lin, Wang Rong,et al.Emulate of stability of frequency transferred by fiber[J].China measurement & Test,2009,35(5):30-33.