Definitions for amplitude spectrum and phase spectrum I want to help someone with a homework in signal processing, and the courses he provided are some slides, without clear definitions in them. I am required in solving a problem to represent the amplitude spectrum and the phase spectrum of a given signal. I searched the internet and didn't found the definitions of these two. I want to create a Matlab script for these, but if I don't know the definitions I cannot do that. Please give me the definitions for these.


  
  Amplitude spectrum
  Phase spectrum
  


If there is a Matlab command, or some other program which plots these spectrums directly, I would be very interested. Thank you.
Beni I think you want something like this:

samplingFrequency = 1000; % / Hz 
signalFrequency = 50;     % / Hz
signalLength = 500;
signal = cos(2*pi*signalFrequency./ samplingFrequency .*[0:1:signalLength - 1]);
[hh ff] = freqz(signal, 1, 2048, samplingFrequency);
figure(10);
plot(ff,10*log10(abs(hh)));
ylabel('Amplitude in log scale');
xlabel('Frequency / Hz');
figure(20);
plot(ff, angle(hh)); 
ylabel('Phase');
xlabel('Frequency / Hz');


You do have MATLAB correct?... if you do try it and let me know how else I can help.





Well, a couple things. First off, remember, since this is a digital signal, it means of course that it was sampled at some frequency $samplingFrequency= 128 or 127$ in your case. The physical frequency of your signal in this case seems to be $signalFrequency = 21$. 

The ratio of $\frac{signalFrequency}{samplingFrequency}$ is equal to the $f_0$ in your case. This is called the 'digital frequency'. 

For your problem it sounds like he also wants you to fix the fft size, (change the 2048 in my code to 128) and the rest of the numbers as I described and run the code. Does he mention how long he wants your signal to be?