[Scilab-users] ?==?utf-8?q? shift phase in fft
Antoine Monmayrant
amonmayr at laas.fr
Thu Sep 29 13:18:36 CEST 2016
Hi Paul,
What are you trying to achieve exactly?
If you apply a phase shift, you actually just multiple your signal by exp(i*phi), both in the time and frequency domain.
Not much to see actually.
Now, if you apply a linear a phase shift in time ie S1(t)->S1(t)*exp(i*Omega*t), this will result in a spectral shift: S1fft(nu)->S1fft(nu+/-Omega/2Pi).
Hope it helps,
Antoine
Le Jeudi, Septembre 29, 2016 12:29 CEST, paul.carrico at free.fr a écrit:
> Dear all
>
>
> I'm sorry about asking a so basic question, but I do not understand how to make a shift phase in a fft ; There's something I do not catch what ?
>
>
> Regards
>
>
> Paul
>
>
>
>
> ######################################################
>
> mode(0)
> clear all
>
>
> f = 10; // frequency
> omega = 2*%pi*f; // circular frequency
> nb_T = 5; // number of periods
> t1 = 0;
> t2 = (nb_T / f);
> n = 10;
> t = linspace(t1,t2,2^n)'; // must be a power of 2
> nl = size(t,"*");
>
>
> s1 = 2*sin(omega*t); // original signal
> plot(t,s1,"r");
>
>
> phi = %pi/3;
> s2 = 2*sin(omega*t + phi); // targetted signal to be rebuilt
> plot(t,s2,"b");
>
>
> // shift phase in the fft
> s1_fft = fft(s1);
> s1_fft = clean(s1_fft);
>
> //s1_fft = s1_fft. * exp(-%i*phi/nl);
> s1_fft = s1_fft. * exp(-%i*phi);
> s1_new = ifft(s1_fft);
> plot(t,s1_new,"g");
>
>
More information about the users
mailing list