diff --git a/MMS24_25.c b/MMS24_25.c new file mode 100644 index 0000000..070e9d6 --- /dev/null +++ b/MMS24_25.c @@ -0,0 +1,47 @@ +// +// Created by minhd on 03.12.2024. +// + +#include "MMS24_25.h" +#include "math.h" +#include +#include + +#ifdef _DEBUG_ +printf("X=%f\n",x); +#endif + + +double interpolateLine(double x1, double y1,double x2, double y2, double x){ + double y = ((y2 - y1) / (x2 - x1)) * x + y1 - ((y2 - y1) / (x2 - x1)) * x1; + return y; +} + +void rescaleDoubleArray(double *pdIn, int iLen, int iMin, double dFactor, double *pdOut){ + for (int i = 0; i < iLen; i++) { + pdOut[i] = pdIn[i + iMin] * dFactor; + } +} + +double *generateSineValues(int iNumValues, int iNumSamplesPerPeriod, double dAmp){ + double* sineArray = (double*)malloc(iNumValues * sizeof(double)); + for (int i=0; i