The bestsquare can do is to have the requested duty cycle that most nearly approximates that requested over the length of the series. 2*pi*f_Sq isn't going to be exact and usingfloor on it passing that tosquare will make it shorter than the average would otherwise be. The only way you can get an absolute repeat of N cycles of a given number of +/- values will be to either have the argument exact or to actually replicate the cycle N times and then scale that by a time duration.
Best Answer