I think there might be a small typo in line 10. I was just comparing a bunch of different people's code and some websites' descriptions of how to calculate the Universal Oscillator, so I'm no expert here. But I notice that you have:
cos(1.414 * pi / bandedge)
and a lot of other people have:
cos(1.414 *180 / bandedge)
I'd just double-check to see if what you have is OK too.
I think there might be a small typo in line 10. I was just comparing a bunch of different people's code and some websites' descriptions of how to calculate the Universal Oscillator, so I'm no expert here. But I notice that you have:
cos(1.414 * pi / bandedge)
and a lot of other people have:
cos(1.414 *180 / bandedge)
I'd just double-check to see if what you have is OK too.
Thanks,