What are you using to pull out the optimum marker locations on your orginal voiced signals?
How long are the signals and how much are you shifting the pitch by?
This is how I would walk through it:
Take in a signal
Determine whether it is voiced or not (from what I have read you basically ignore non-voiced segments)
Voiced signals should probably be broken down into smaller portions each with a smaller bandwidth (so your marking algorithm does not need to do much thinking). This way you can use the constant pitch assumption later without it biting you too hard.
(just to be clear, I am going to use the word "portions" to describe a chunk of segments/periods that are all of approximately the same pitch, and use "periods" and "segments" interchangably)
A voiced signal needs to be marked (I would do this by giving the array another dimension and using 1's and 0's to determine your marks and spot between marks). Now you should have a 2xn matrix/array where one column/row is signal and the other is mostly 0's but has 1's cooresponding to the spots on the signal portion where you are at highest power periodic point in the signal.
Each portion then get passed to a loop (this loop needs a portion, the new desired pitch, the new desired portion length, and the sampling frequency). I would pass these in by initializing a desired/target 2D array with markers where you want them and all 0's for the signal row/column.
Then that loop iterates through the desired portion/array until it find a marker (1 in the second row/column) when it sees that, it goes into a nested loop
that loop will look through the original/marked/voiced portion and find the 2 periods/segments that "line up with" the current target position. That inner loop then pops out the starting and ending indexes of those 2 periods. The bigger loop will grab those segments, hanning window it, and make sure it is of proper length to fit where it needs to go in the target. Then you add it right in to your target array. This is the end of that loop, so on the next iteration, it will be searching through the desired array again for the next marker. You should be able to continue this until there are no more markers in the desired array (aka done).
After you make this and see how it works, you can make a quick chunk of code that will programatically initialize the "desired array template" (with markers and such).
Are we still on the same page?
~milq