Created
April 24, 2019 22:20
-
-
Save bjonnh/d1846b3bd20ec2bf121b2da10bbcb610 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hami->FreqsFiltered is a *double | |
// Hami->IntensFiltered is a *double | |
// TheoreticalSpec.Points is a *double | |
double LW = 2, Offset = 2000, FreqStep = 1 , tmp = 0 , tmp1 = 0, sqLW = LW * LW, CurrFreq=0; | |
for (int i = 1; i <= 131072; i++) { | |
CurrFreq = Offset - FreqStep * (i - 1); | |
tmp1 = 0; | |
for (int j = 1; j <= Hami->nFreqsFiltered; j++) { | |
tmp = CurrFreq - Hami->FreqsFiltered[j]; | |
tmp *= tmp; | |
tmp1 += Hami->IntensFiltered[j] * LW / (tmp + sqLW); | |
} | |
TheoreticalSpec.Points[i] = tmp1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment