<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'><font face="times new roman, new york, times, serif"><span style="font-size: 12pt;">Dear all</span></font><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">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 ?</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">Regards</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">Paul</div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;">######################################################</div><div><div><font face="times new roman, new york, times, serif">mode(0)</font></div><div><font face="times new roman, new york, times, serif">clear all</font></div><div><font face="times new roman, new york, times, serif"><br></font></div><div><font face="times new roman, new york, times, serif">f = 10; // frequency</font></div><div><font face="times new roman, new york, times, serif">omega = 2*%pi*f; // circular frequency</font></div><div><font face="times new roman, new york, times, serif">nb_T = 5; // number of periods</font></div><div><font face="times new roman, new york, times, serif">t1 = 0;</font></div><div><font face="times new roman, new york, times, serif">t2 = (nb_T / f);</font></div><div><font face="times new roman, new york, times, serif">n = 10;</font></div><div><font face="times new roman, new york, times, serif">t = linspace(t1,t2,2^n)'; // must be a power of 2</font></div><div><font face="times new roman, new york, times, serif">nl = size(t,"*");</font></div><div><font face="times new roman, new york, times, serif"><br></font></div><div><font face="times new roman, new york, times, serif">s1 = 2*sin(omega*t); // original signal</font></div><div><font face="times new roman, new york, times, serif">plot(t,s1,"r");</font></div><div><font face="times new roman, new york, times, serif"><br></font></div><div><font face="times new roman, new york, times, serif">phi = %pi/3;</font></div><div><font face="times new roman, new york, times, serif">s2 = 2*sin(omega*t + phi); // targetted signal to be rebuilt</font></div><div><font face="times new roman, new york, times, serif">plot(t,s2,"b");</font></div><div><font face="times new roman, new york, times, serif"><br></font></div><div><font face="times new roman, new york, times, serif">// shift phase in the fft</font></div><div><font face="times new roman, new york, times, serif">s1_fft = fft(s1);</font></div><div><font face="times new roman, new york, times, serif">s1_fft = clean(s1_fft);</font></div><div><div><font face="times new roman, new york, times, serif">//s1_fft = s1_fft. * exp(-%i*phi/nl);</font></div><div><font face="times new roman, new york, times, serif">s1_fft = s1_fft. * exp(-%i*phi);</font></div></div><div><font face="times new roman, new york, times, serif">s1_new = ifft(s1_fft);</font></div><div><font face="times new roman, new york, times, serif">plot(t,s1_new,"g");</font></div><div style="color: rgb(0, 0, 0); font-family: "times new roman", "new york", times, serif; font-size: 12pt;"><br></div><br></div></div></body></html>