DSPRelated.com
Forums

phase spectrum

Started by rosita hamidi February 16, 2009
Hi every body,

I want too plot phase spectrum of a signal.
I've used this code:

Xtshift(fft(signal));
phi=unwrap(angle(X));

But it doesn't work. Although the similar code for amplitude is correct:

Xtshift(fft(in));
amp=(abs(X)/2)/max(abs(X)/2);


Can anybody help me?
Regards;
Rosita
--- In m..., rosita hamidi wrote:
>
> Hi every body,
>
> I want too plot phase spectrum of a signal.
> I've used this code:
>
> Xtshift(fft(signal));
> phi=unwrap(angle(X));
>
> But it doesn't work. Although the similar code for amplitude is
correct:
>
> Xtshift(fft(in));
> amp=(abs(X)/2)/max(abs(X)/2);
> Can anybody help me?
> Regards;
> Rosita
>
I dont find any problem with this apparently except with the amplitude
scaling.
amp = (abs(X)/2)/max(abs(X)/2);
write complete code and specifically tell what the 'doesn't work' mean?

Ubaid Abdullah
http://dspdotcomm.blogspot.com
It looks like correct.
To be sure, test your analysis with a know function (there are tables
with a lot of function with
analytical spectrum reported in amplitude and phase).
So you can check if your matlab script is correct or not.
Remenber that the two results have to be superimposable
If you need more help .....do not hesitate...

On Mon, Feb 16, 2009 at 12:22 PM, rosita hamidi wrote:
> Hi every body,
>
> I want too plot phase spectrum of a signal.
> I've used this code:
>
> Xtshift(fft(signal));
> phi=unwrap(angle(X));
>
> But it doesn't work. Although the similar code for amplitude is correct:
>
> Xtshift(fft(in));
> amp=(abs(X)/2)/max(abs(X)/2);
> Can anybody help me?
> Regards;
> Rosita