[Scilab-users] shift phase in fft

Tim Wescott tim at wescottdesign.com
Thu Sep 29 18:35:33 CEST 2016


Hey Paul:

Just a comment, and I hope that neither you nor the rest of the crew on
this list take it as being negative:

The last few questions you've been asking have been in the context of
Scilab, but for the most part they seem to be questions about signal
processing, not about Scilab itself.  One of the distressing trends I
see in DSP forums is the tendency for people -- mostly people who are
self-taught -- to have trouble separating DSP knowledge from which
buttons to push in Scilab (or Matlab, if they happen to have it
available).

Scilab is a great numerical tool, and if I didn't have it I couldn't do
my work nearly as efficiently as I do.  But much of DSP is purely math,
and not numerical at all -- you can use Scilab to shine a light on it,
but Scilab isn't the thing itself.

There's plenty of people on this list who know signal processing and who
will be happy to help you, so if you don't want to step outside of it I
hope you continue posting questions here.  However, for your purely DSP
questions, you may want to consider posting on the USENET group
comp.dsp, or on www.dsprelated.com.  You'll get a wide range of DSP
minds concentrated on your questions, and they'll mostly be people who
will be willing to help you understand the principles independently from
any tools (like Scilab).

Again -- I wish to apologize in advance if I'm stepping on any toes, or
making anyone feel unwelcome.  It is certainly not my intent.

On Thu, 2016-09-29 at 12:29 +0200, paul.carrico at free.fr wrote:
> 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");
> 
> 
> 
> 
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

-- 

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432





More information about the users mailing list