The project is a fast lock in amplifier (LIA) which can update its output at rate of 1000 measurements/s. It performs digital dual mixing and filtering to obtain a DC value proportional to the AC input signal.
Diff: main.h
- Revision:
- 1:bf693859586c
- Parent:
- 0:4e20939af8bb
- Child:
- 2:c9b24787d5e1
--- a/main.h Mon Aug 21 11:22:14 2017 +0000 +++ b/main.h Mon Aug 21 11:43:03 2017 +0000 @@ -10,6 +10,7 @@ #ifndef MAIN_H #define MAIN_H #include "mbed.h" +#include "N5110.h" #define DIRECTION_TOLERANCE 0.05 @@ -29,7 +30,7 @@ @namespace ain @brief analog input which is the signal from the bolometer (THz detector) */ -AnalogIn ain(A0); +AnalogIn ain(A5); /** @namespace dref @@ -39,7 +40,7 @@ /** @namespace amp_ticker -@brief time-triggered interrupt calculates the amplitude of the input signal +@brief time-triggered interrupt calculates the offset of the input signal */ Ticker offset_ticker; @@ -71,7 +72,7 @@ @namespace lcd @brief object of the N5110 class */ -//N5110 lcd(PTE26 , PTA0 , PTC4 , PTD0 , PTD2 , PTD1 , PTC3); +N5110 lcd(PTE26 , PTA0 , PTC4 , PTD0 , PTD2 , PTD1 , PTC3); /** @@ -129,11 +130,6 @@ void initDAC(); /** -ISR sets flag to find Amplitude of bolometer signal -*/ -void findAmplitude(); - -/** find the amplitude of the analog bolometer signal */ double max(int points); @@ -141,26 +137,11 @@ double mavg_filter(int filt_points); /** -ISR sets flag to update LIA output -*/ -void updateOutput(); - -/** -ISR sets flag to mix signals -*/ -void mixSignals(); - -/** performs digital mixing with refX and refY components */ void digitalMix(double remove_offset); /** -moving average filter with n points (n = 17) -*/ -void filterSignal(int averages); - -/** ISR calculates the DigitalIn signal frequency */ void voltageRise(); @@ -170,16 +151,16 @@ */ void offset_isr(); +/** +ISR updates the output of the LIA +*/ void output_isr(); -double calculate_constant(double freq_ref); +//double calculate_constant(double freq_ref); /*!< used to assign the amplitude of the bolometer signal */ volatile double amplitude = 0; -/*!< used to find the offset of the input signal */ -volatile double outDC = 0; - /*!< stores the period of the input digital signal */ volatile double ref_period = 0;