Thread Subject: Calculation of phase spectrum for one-sided exponential signal...

Subject: Calculation of phase spectrum for one-sided exponential signal...

From: Andrey Kazak

Date: 31 Dec, 2007 02:58:30

Message: 1 of 1

Hallo!

I try to calculate an amplitude and phase Fourier spectrum
of a one-sided exponential signal in the following way:

---CODE---
Fs = 10000; % Sampling frequency, Hz
dt = 1/Fs; % Sample time
L = 10001; % Length of signal

t = (0:L-1)*dt; % Time vector

A=1; % Exponent multiplier
k=30; % Exponent k

% One-sided exponential definition
s=A*exp(-1*k*t);

% Signal graphical output
plot(t, s, 'DisplayName', 's', 'YDataSource', 's'); figure(gcf)
%%

%dw=2*pi/((length(s)-1)*dt);
%w=(0:1:(length(s)-1))*dw;

% Frequency vector definition
df=1/((length(s)-1)*dt);
f=(0:1:(length(s)-1))*df;

% Complex Fourier spectrum calculaiton
z=fft(s)*dt;

% Amplitude Fourier spectrum calculaiton
p=abs(z);

% Amplitude Fourier spectrum graphical output
plot(f,p);

title('Amplitude Spectrum of Signal')
xlabel('Frequency (Hz)')
ylabel('|S(jf)|')

%%
% Phase Fourier spectrum calculaiton
ph=angle(z);

% Phase Fourier spectrum graphical output
plot(f,ph);

title('Phase Spectrum of Signal')
xlabel('Frequency (Hz)')
ylabel('Angle(S(jf))')
---CODE---

Amplitude Fourier spectrum values (vector p) are correct
with precision of 0.0001 (I suppose it's related to finite
length of the exponential signal). However, phase Fourier
spectrum values (vector ph) have very unclear behaviour - on
the low frequencies they decrease and on high frequencies
they increase, instead of steadily decrease from 0 to -Pi/2...

Most likely I'm doing a wrong thing.

Could you please help me to figure out my mistake?

Thank you in advance for you answer!

P.S. Happy New 2008 Year to Everyone!

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
exponent Andrey Kazak 30 Dec, 2007 22:05:07
fourier spectrum Andrey Kazak 30 Dec, 2007 22:05:07
calculation Andrey Kazak 30 Dec, 2007 22:05:07
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com