I didn't understand what Vi and Vo are. Are they each vectors of voltages sampled at temporal intervals?
If that's the case, and if Vi and Vo have the same length, the duty cycle, according to your equation would just be
But I have a feeling this doesn't address what you need. Feel free to follow-up in the comments below.