These changes are all addressed and I've verified the behavior still works as intended. The most recent commit fixes a memory error, which I believe was caused by moving the declarations of tsDup and newFS as per Noah's suggestion. Each of these ends up as a spectrum in the output data (tsDup did not before, as the transform was in-place; but now it does). I effectively reverted this change to stop the execution crash.
These changes are all addressed and I've verified the behavior still works as intended. The most recent commit fixes a memory error, which I believe was caused by moving the declarations of tsDup and newFS as per Noah's suggestion. Each of these ends up as a spectrum in the output data (tsDup did not before, as the transform was in-place; but now it does). I effectively reverted this change to stop the execution crash.