Organization: Control Resources, Ltd.
Subject: Re: Pitch changing?
Followup-To: comp.speech
References: <356o56$oj6@ugle.unit.no> <3596l3$q72@antares.lu.erisoft.se>
Date: Fri, 16 Sep 94 12:27:40 -0700     
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!news.sei.cmu.edu!cis.ohio-state.edu!math.ohio-state.edu!cs.utexas.edu!convex!news.duke.edu!MathWorks.Com!yeshua.marcam.com!charnel.ecst.csuchico.edu!csusac!csus.edu!netcom.com!netcomsv!contres
From: charlesl@contres (Charles Larson)
Newsgroups: comp.speech
Message-ID: <09-16-1994.2622@contres>
Lines: 56

In article <3596l3$q72@antares.lu.erisoft.se> ij285@lu.erisoft.se (Ingemar Johansson AOMT) writes:
>In article oj6@ugle.unit.no, sveinb@alkymi.unit.no (Svein Berge) writes:
>> Ingemar Johansson (ij285@lu.erisoft.se) wrote:
>> : I believe that if you make an FFT on a block of the input signal and then shift the 
>> : FFT components up or down and transform the shifted FFT komponents back to the time
>> : domain with an IFFT you'll get a frequency shifted signal with normal playback speed.
>> : 
>> : There is also a possibility that you can use a mixer in the same manner as in a radio
>> : receiver. 
>> : 
>> [snip]
>> : 
>> : //Ingemar Johansson
>> : 
>> Unfortunately, this will fuck up any and all harmony there might have been
>> in your voice originally. Go with Bruce!
>> 
>> Svein.
>
>
>I include below matlab scripts that will shift down resp. up the spectra of an input
>signal. Note that the shifting is done logarithmically.
>
>The only thing that 'fucks up ......' is that the signal gets amplitude modulated with 
>a period equal to the the fft order i.e 512 samples, this is when the shifting is high (sC=2.0) I believe that this can be remedied with a more sensible assignment of the 
>fft bins. Also can be mentioned is that there is some chorus-effect for the lower
>shifting values (sC=1.1).
>

If you want to pitch shift, just amplitude modulate the signal
and then bandpass filter it.  Amplitude modulation has the effect
shifting the spectrum to be centered around the carrier freqency.

Since you want the result to be in the audio band which overlaps the
input, you will have to first shift the spectrum entirely outside of the
audio band, and then shift it back where you want it.

 Input ----> x  ------>  BPF  ---------> x --------> LPF --------> Output
             ^         56Khz - 64Khz     ^           0-4Khz
   60Khz ----|                           |
                  (60Khz-shift) ---------|

Remember that if you are doing it digitally you will have to use
a multirate filter to take your base sampling frequency to something
high enough to represent the modulated signal (in this case about 130Ksps)
You could use a lower intermediate frequency to reduce the sample
rate requirements, but at the expense of requiring a sharper
filter.

I think there may be a few details that I have forgotten but I can give
you some more references if you need them.  If you get it to work
I'd be interested in a copy of the code.  (C preferably)

HTH,
Charles

