help-octave
[Top][All Lists]

## Re: How can I increase/decrease (frequency/pitch) and phase using fft/if

 From: Sergei Steshenko Subject: Re: How can I increase/decrease (frequency/pitch) and phase using fft/ifft tia sal22 Date: Mon, 4 Apr 2011 14:33:31 -0700 (PDT)

```--- On Mon, 4/4/11, Rick T <address@hidden> wrote:

Subject: How can I increase/decrease (frequency/pitch) and phase using fft/ifft
tia sal22
Date: Monday, April 4, 2011, 2:11 PM

How can I increase/decrease (frequency/pitch) and phase using fft/ifft
I think I have the basic code but I’m not sure what to do next

PS: Thanks for the help on the last question everyone I decided not to use the
FOR loop and sin/cos values and just use fft/ifft

to see if this will work.
Example I have a signal that repeats 1 time every second and I want to
have it repeat 3 times a second instead.
%Voiceprint raise lower freq phase conjugate signal
tic

clear all, clc,clf,tic
%% Sound /beep calculation complete
filerawbeepStr='calculations_complete.wav';
filerawbeeppathStr='/home/rat/Documents/octave/raw/';
filevoiceprepathStr='/home/rat/Documents/octave/eq_research/main/

transform/voice/';
filewavpathStr='/home/rat/Documents/octave/eq_research/main/transform/
wav/';
[ybeep, Fsbeep, nbitsbeep] =

%add path to location of functions
%1a voice print import
[vp_sig_orig, fs_rate, nbitsraw] =
%vp_sig_orig=vp_sig_orig’;

vp_sig_len=length(vp_sig_orig);
%2a create frequency domain
ya_fft = fft(vp_sig_orig);
vp_sig_phase_orig = unwrap(angle(ya_fft));
%get Magnitude
ya_fft_mag = abs(ya_fft);

%3a frequency back to time domain
ya_ifft=real(ifft(ya_fft));
vp_sig_new=real(ifft(ya_fft_mag.*exp(i*vp_sig_phase_orig)));
subplot(3,1,1), plot(vp_sig_orig),title('1 original time domain')

subplot(3,1,2), plot(ya_ifft),title('2 rebuild time domain')

-----Inline Attachment Follows-----

_______________________________________________
Help-octave mailing list
https://mailman.cae.wisc.edu/listinfo/help-octave

So, regarding your

"
Example I have a signal that repeats 1 time every second and I want to
have it repeat 3 times a second instead.
"

- why do you need FFT in the first place ?

I.e. if 'x' is your signal, why not simply write

x = linspace(0, 1, 10); % or whatever other way to generate your signal
y = [x x x]; % repeat x 3 times
plot(y);

?

Regards,
Sergei.

```