0

I need some explanations, how to understand phase spectrum of different functions, and what does phase spectrum means I'm trying to plot phase spectrum of sine in Matlab. Here is a code:

f(t)=sin(t);
S(w) = fourier(f(t), t, w);
w_values = 0:1:5;
F = double(subs(S, w, w_values));
figure, plot(w_values, angle(F)), title('Phase plot'), xlabel('Frequency'), ylabel('Phase');

Here is an image of plot:

Phase spectrum of sine sin(t)

Can you explain why is that? Why at frequency = 1 (Hz of what?) Phase = -pi/2? Why only at frequency = 1? How to understand it? And why cosine wave has no phase shifts at any frequency? Also after plotting sin(t)/t I got this:

Phase spectrum of sin(t)/t

As you can see, with frequency = 2 and more, phase something about between [-2;-1] The same question: Why is that?

rayryeng
  • 102,964
  • 22
  • 184
  • 193
HelloWorld
  • 31
  • 3
  • 2
    What do you understand about what you're doing? You're trying to plot a Fourier transform of sin(x) (only taken at integral points), and wondering why you get what you get. These are complicated topics that have long answers. Do you understand enough to say what you were expecting to get? – Teepeemm Dec 14 '15 at 18:29
  • This is not exactly a programming question. You may have better luck in [dsp.stackexchange.com](http://dsp.stackexchange.com/). They speak Matlab there as well :). – patrik Dec 15 '15 at 07:47

0 Answers0