@robertbristow-johnson give you nice tips, i can suggest you, PSOLA algorithm (aka Keith Lent1) to pitch shift in time domain.
PSOLA assumes that, if you know the pitch of a given segment, then you'll be able to remove or add periods moving synchronously and preserving envelope information.
The main step of PSOLA algorithm are:
- Extract Pitch/Periodos and find pitch marks (this can be hard), this marks are tipically positioned in the Glottal Closure Instants (GCI), and this positions are explicitly linked to quality of your Pitch Shifted signal, this step give you analysis marks.
- split your signal using a hann window, every window need be centred in the analyis mark position!
- Now from Analysis marks do you need rearrange this marks based in your pitch shift factor, it is called syntesysed marks.
- Overlap and add every windowed splited piece
The representation of these steps:
Mybe can be ease to see how some steps are build using a sinusoid example, so, here an real example, the picture bellow show an 150hz sampled at 22050hz (blue signal), on top of that sign you can see the pitch mark positions marked directly on the sign, the green dots on top are the pitch marks again and the green marks below are the synthesised marks using a pitch factor of 1.5, the red line between up/down dots tell you what centred hann whindow get to overlap and add.
So this steps pitch shift 150Hz signal to 1.5*150 = 225Hz.
1 - An efficient Method for Pitch Shifting Digitally Sampled Sounds", published in the Computer Music Journal, Vol 13, No. 4, Winter 1989