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
phase spectrum
Started by ●February 16, 2009
Reply by ●February 17, 20092009-02-17
--- 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
>
> 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
Reply by ●February 17, 20092009-02-17
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
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