Find the centroid of spectra, plot and analyze!

조회 수: 7 (최근 30일)
Tusharkumar Sorathiya
Tusharkumar Sorathiya 2018년 11월 19일
편집: Tusharkumar Sorathiya 2018년 11월 19일
I have few spectra from Fiber Bragg Gratings, it is text file having 3 columns (we will consider only 1st and 3rd column, which are wavelength and power values respectively). See the attached program and files I am using currently to open spectra.
I am using the equation [ Centroid = ∑(wavelength.*power) / ∑(power) ] to find centroid of spectra.
Question-1) As shown in attached image, when I plot multiple spectra, the centroid values are outside the spectra. Are those values precise?
Question-2) If not, what is the solution and is it necessary that centroid value should come inside the spectra somewhere?
Question-3) If I get the correct values of centroid for multiple files (let say I have 5 spectra and 5 centroid value), how I can make a matrix which can find the difference of location from one centroid to another, with respect to x and y axis? for instance, 2nd centroid has 2nm shift on x axis and 5 dB shift on y axis compare to 1st centroid.
Note: Attached centroid.txt file,one can run in matlab and can use attached other two text files as sample spectra.

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by