I fixed MkSgateData2.m. There is an issue with frequency where the specified frequencies HAVE to be part of the basis that you use in the fft.