fbgsense 0.1
Generic FBG spectrum analysis tool
spectrum_types.h
1/*
2 * This file is a part of the project "fbgsense", which is released under MIT license.
3 * Copyright (c) 2022 Daniel Múčka, Masaryk University, Faculty of Informatics
4 * See file LICENSE or visit https://opensource.org/licenses/MIT for full license details.
5 */
6
7#pragma once
8
9#include <cstdint>
10
11#define spectrum_unit_t float
12
13typedef uint8_t channel_t;
14typedef uint16_t parameter_t;
15typedef spectrum_unit_t complex_t[2];
16
18{
19 spectrum_unit_t wavelength;
20 spectrum_unit_t intensity;
21};
22
24{
25 spectrum_unit_t min;
26 spectrum_unit_t max;
27};
28
29enum class extrema_type
30{
31 NONE, // no sign change
32 MINIMUM, // sign change from - to +
33 MAXIMUM // sign change from + to -
34};
35
36enum class fit_type
37{
38 BIGAUSSIAN,
39 GAUSSIAN,
40 LINEAR,
41};
42
43enum class filter_type
44{
45 FFT,
46 SAVGOL
47};
48
49enum class detection_type
50{
51 LOCAL_MAXIMA
52};
53
54enum class segment_type
55{
56 LOCAL_MINIMA,
57 INFLECTION_POINTS
58};
59
61{
62 spectrum_unit_t value{ 0 };
63 extrema_type extrema{ extrema_type::NONE };
64};
65
67{
68 bool enable{ false };
69 bool force{ false };
70 fit_type fitType{ fit_type::GAUSSIAN };
71 bool equalize{ false };
72};
73
74struct point_t
75{
76 spectrum_unit_t x;
77 spectrum_unit_t y;
78};
79
81{
82 bool valid{ false };
83 point_t bottomleft;
84 point_t bottomright;
85 point_t topleft;
86 point_t topright;
87};
Definition: spectrum_types.h:81
Definition: spectrum_types.h:61
Definition: spectrum_types.h:67
Definition: spectrum_types.h:24
Definition: spectrum_types.h:75
Definition: spectrum_types.h:18