Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FSI Data Acquisition Path Gateware and Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Projects
FSI Data Acquisition Path Gateware and Software
Commits
14c43bd1
Commit
14c43bd1
authored
Jul 23, 2021
by
Juan David Gonzalez Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP - add clarification comments
parent
ba77fc79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
10 deletions
+41
-10
fsi.h
libfsi/fsi.h
+41
-10
No files found.
libfsi/fsi.h
View file @
14c43bd1
...
...
@@ -15,13 +15,36 @@ extern "C" {
#include <stdlib.h>
#include <sys/time.h>
/*
* general questions/open ends --- look fast for 'tbd' or FIXME in the
* code to quickly identify loose ends
*
* - some params like frequencies and distances might better be passed
* as large integers/indexes in a conventionally bound array between
* e.g. 1525-1630nm - tbd
* - channels will be distance or Bragg, and so configured till next
* call to the configuration (INPUT) function
* - the peak set requested in a channel is assumed to have different
* fit params per peak. If a channel has all its peaks of the same
* type, this can be size-optimized - tbd
*/
/* two types of channel inputs: distance meas. or Bragg */
enum
fsi_channel_type
{
FSI_CH_NONE
=
0
,
FSI_CH_DISTANCE
=
1
,
/**< configure as distance meas. channel */
FSI_CH_BRAGG
,
/**< configure as Bragg channel */
};
/* types of functional forms to fit the peaks found */
enum
fsi_peak_type
{
FSI_PEAK_NONE
=
0
,
FSI_PEAK_LORENTZ
=
1
,
/**< Cauchy-Lorentz 1/(1+xˆ2) distribution */
FSI_PEAK_GAUSS
,
/**< Gaussian (normal) distribution */
FSI_PEAK_SINC
,
/**< Sinc (sin(x)/x)) distribution */
FSI_PEAK_MOFFAT
,
/**< Moffat (power of Cauchy pdf) distribution */
FSI_PEAK_BRAGG
,
/**< Bragg-type peak */
/* FIXME:should Bragg type be set apart?
*/
/* FIXME:should Bragg type be set apart? tbd
*/
};
/* biggest number of model parameters among different peak types */
...
...
@@ -34,9 +57,13 @@ enum fsi_peak_type {
/* library error codes */
#define __FSI_ERR_START 1024
struct
fsi_peak_request
{
/* peak finding/fitting configuration for a channel
*
* A channel will be configured so that
*/
struct
fsi_peak_config
{
double
frequency
;
/**< estimated frequency where peak fits */
double
search_range
;
/**< estimated interval of peak range */
double
range1
,
range2
;
/**< estimated interval of peak range */
double
channel_gain
;
/**< FIXME: should be per-channel, not per-peak? */
enum
fsi_peak_type
type
;
/**< shape of peak to fit */
};
...
...
@@ -44,7 +71,7 @@ struct fsi_peak_request {
struct
fsi_peak_result
{
double
frequency
;
/**< center of peak fitted to data */
double
amplitude
;
/**< peak width derived from parameters */
double
snr
;
/**< peak signal-to-noise ratio (?) */
double
snr
;
/**< peak signal-to-noise ratio (?
tbd
) */
enum
fsi_peak_type
type
;
/**< shape of peak fit to data */
double
fit_params
[
FSI_MAX_MODEL_PARAMS
];
...
...
@@ -53,16 +80,20 @@ struct fsi_peak_result {
};
struct
fsi_channel_
request
{
struct
fsi_channel_
config
{
unsigned
int
channel_id
;
/**< channel to be configured */
enum
fsi_channel_type
type
;
/**< type of channel (distance/Bragg) */
double
channel_gain
;
/**< channel gain FIXME: see fsi_peak_request */
int
npeaks
;
/**< number of valid peaks in peaks array */
struct
fsi_peak_request
peaks
[
FSI_MAX_PEAKS
];
/**< peak requests */
};
int
npeaks
;
/**< number of valid peaks to be requested in peaks array */
struct
fsi_peak_config
peaks
[
FSI_MAX_PEAKS
];
/**< peak requests
FIXME: should peak params be identical for all of them?
If so, this needs not be an array and npeaks is sufficient */
};
struct
fsi_channel_measurement
{
unsigned
int
channel_id
;
/**< channel measured here */
unsigned
int
channel_id
;
/**< channel id of this measurement */
enum
fsi_channel_type
type
;
/**< type of channel (distance/Bragg) */
int
npeaks
;
/**< number of valid entries in peaks array */
struct
fsi_peak_result
peaks
[
FSI_MAX_PEAKS
];
/**< peam measured values */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment