atcollab / at

Accelerator Toolbox
Apache License 2.0
48 stars 31 forks source link

Fixes bug producing infrequent NaN from calcnaff #587

Closed pcsch closed 1 year ago

pcsch commented 1 year ago

Dear all,

This pull request concerns MATLAB. As noted in #40 calcnaff sometimes produces NaN values even though the input is valid and a second run does result in valid frequencies. The problem is that the interface between MATLAB and the NAFF algorithm did no write to the last element of the complex input to NAFF. This pull request fixes that.

In my tests this also fixed the fluctuating results from run to run (e.g. phase) seen in #40 as well.

Fixes #40