4_LockInAmplifier/lockInAmplifier.c
//ButterLowPass - filters data using a Butterworth low pass filter
filters data using a Butterworth low pass filter
filters data using a Butterworth low pass filter
double applyFilter(double cutoff, int order, double samplingRate, double waveformDatapoint) {
  double nyquistFreq = 0.5 * samplingRate;
  double normalCutoff = cutoff / nyquistFreq;
  double fraction = waveformDatapoint/normalCutoff;
  double filteredData = 1.0 / sqrt(1.0 + pow(fraction, 2.0*order));
  return filteredData;
}
double applyFilter ( double cutoff , int order , double samplingRate , double waveformDatapoint ) { double nyquistFreq = 0.5 * samplingRate ; double normalCutoff = cutoff / nyquistFreq ; double fraction = waveformDatapoint / normalCutoff ; double filteredData = 1.0 / sqrt ( 1.0 + pow ( fraction , 2.0 * order ) ) ; return filteredData ; }
ButterLowPass - filters data using a Butterworth low pass filter
ButterLowPass - filters data using a Butterworth low pass filter