%%%%%%%%%% PROGRAM STRINGS %%%%%%%%%%
#STRINGS
% Input and output file locations here ARE OVERRIDDEN if in/out files are specified on the command line
% Absolute and relative paths are both acceptable
DATA_FILE = C:\Dropbox\Work\2015_Summer\testdata.csv
OUTPUT_FILE = C:\Users\Kindred\Documents\MATLAB\output.mat
%%%%%%%%%% PROGRAM CONSTANTS %%%%%%%%%%
#CONSTANTS
WINDOW_SIZE = 10000 % in samples
SAMPLE_FREQ = 10000 % in Hz
PI = 3.14159265358979323846
ADC_OFFSET = 2500 % in mV
% Reference angles are in degrees
THETA_X = -90
THETA_Y = 0
THETA_Z = -90
%%%%%%%%%% WINDOW FUNCTION %%%%%%%%%%
#WINDOW_FUNCTION
WINDOW_FUNCTION = 0.5 * (1 - cos((2 * PI * input) / WINDOW_SIZE)) % Hanning Function
%%%%%%%%%% USER EQUATIONS %%%%%%%%%%
% , = EQUATION
% Because we're using an equation interpreter, running in mode 1 will SIGNIFICANTLY slow down execution
% Equations are executed in the order that they are listed here
% Results are automatically stored in variables, and can be referenced in the column normalization equations
% keyword 'count' gives integer value of the current position in the window
%
% MODE 0: executes before any other calculations are performed (***BEFORE*** the column data is processed)
% You can reference channel data by entering the name of the channel
% - For once-per-window data, this will pull the current window data point
% - For read-every-sample data, the first point in the window will be used
%
% MODE 1: executes before every sample in the window (FFT-type) is processed
% - Once-per-window data will still use the current window data point
% - References to read-every-sample data will point at the "current" data point in the window
#EQUATIONS
0, SENSOR_PRES = (PRES + ADC_OFFSET - 500)
0, TEMP_OHMS = (TEMP + ADC_OFFSET) / ((5000 - (TEMP + ADC_OFFSET)) / 4000)
0, SENSOR_RH = (((HUMD + ADC_OFFSET) / 5000) - 0.16) / 0.0062
%%%%%%%%%% DATA COLUMNS %%%%%%%%%%
% , , , ,
% 1 - Column name
% 2 - 0 = Read once per window, 1 = read every sample
% 3 - Operation type (0 = none, 1 = normalization equation, 2 = FFT-type (subtract window mean before using division factor)
% 4 - Rotate to match aircraft orientation (0 = disabled,
% --- Assigns channel to a set (series) of coordinate axes for rotation operations
% --- Component rotation offset accounts for accelerometer/gyro rotation with respect to EDR
% 5 - The kind of plot that the MATLAB auto-plot script will generate for this column (0 = disabled)
% 6 - Normalization equation (or division factor in the case of FFT-types)
%
% keyword 'input' is the current value of the channel data
% Rotation data with less than three axes will be zero padded -- the data will still be rotated in three dimensions
% Column equations are executed in the order that they are listed
% Column equation results are saved to a variable with the same name as the column (for referencing in other equations)
#COLUMNS
TIME, 1, 0, 0, 0
PRES, 0, 1, 0, SENSOR_PRES / 4500 * 17.4
TEMP, 0, 1, 0, (TEMP_OHMS - 1000) / 3.75
HUMD, 0, 1, 0, SENSOR_RH / (1.0546 - (0.00216 * TEMP))
ANGX, 1, 2, 1x0, 1.23
ANGY, 1, 2, 1y0, 1.25
ANGZ, 1, 2, 1z0, 1.27
LINX, 1, 2, 2x0, 108.4
LINY, 1, 2, 2y90, 100.4 % Note that the Y axis is rotated 90 degrees -- this accounts for rotation of the accelerometer relative to the EDR
LINZ, 1, 2, 2z0, 104.3
%%%%%%%%%% DATA COLUMNS MATLAB OUTPUT %%%%%%%%%%
% , , , ,
% (0 = disabled)
#MATLAB
TIME, 0, 0, 0, 0
PRES, plot, seconds, psia, 0
TEMP, plot, seconds, degrees Celsius, 0
HUMD, plot, seconds, Relative Humidity, 0
ANGX, loglog, Hz, deg^2/s, X Ang Rate Pwr Spectral Density
ANGY, loglog, Hz, deg^2/s, Y Ang Rate Pwr Spectral Density
ANGZ, loglog, Hz, deg^2/s, Z Ang Rate Pwr Spectral Density
LINX, loglog, Hz, g^2/Hz, X Lin Accel Pwr Spectral Density
LINY, loglog, Hz, g^2/Hz, Y Lin Accel Pwr Spectral Density
LINZ, loglog, Hz, g^2/Hz, Z Lin Accel Pwr Spectral Density
#ENDCFG