fbgsense 0.1
Generic FBG spectrum analysis tool
spectrum_sm125.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 "interrogator/constants/sm125.h"
10#include "spectrum/spectrum.h"
11
12// disable padding, so we can overlay this structure over raw tcp data.
13#pragma pack(1)
15{
16 uint32_t m_subHeaderSize;
17 uint32_t m_minWavelength;
18 uint32_t m_increment;
19 uint32_t m_sampleCount;
20 uint32_t m_index;
21 int16_t m_intensities[sm125_samples];
22};
23
25{
26 uint32_t m_headerSize;
27 uint32_t m_protocolVersion;
28 uint32_t m_channelCount;
29 uint32_t m_reserved;
30 uint32_t m_counter;
31 sm125_spectrum_subheader_t m_channels[spectrum_max_channels];
32};
33#pragma pack()
34
35// we are exploiting the fact that fft works best on factorizable sample counts.
36// unfortunately, sm125 gives out a prime number of samples. thus, the easiest way to
37// make the computation faster is to subtract one sample.
38// this change makes the computation ~4x faster.
39
44{
45 bool m_initialized = false;
46public:
48
49 void update(uint8_t* data);
50};
Spectrum of SM125 interrogator.
Definition: spectrum_sm125.h:44
Data structure providing access to the implemented method.
Definition: spectrum.h:47
Definition: spectrum_sm125.h:25
Definition: spectrum_sm125.h:15