Path: news.mathworks.com!not-for-mail
From: "Aymen " <aymenkoobar@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: generate Time signal from a given PSD
Date: Tue, 3 Nov 2009 15:04:02 +0000 (UTC)
Organization: Universit&#228;t Stuttgart
Lines: 21
Message-ID: <hcpgp2$7r6$1@fred.mathworks.com>
Reply-To: "Aymen " <aymenkoobar@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257260642 8038 172.30.248.37 (3 Nov 2009 15:04:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 3 Nov 2009 15:04:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1357504
Xref: news.mathworks.com comp.soft-sys.matlab:582065


Hello people, 
 i'm a novice in the field of signal processing and this problem maybe easy for you ...
I want to extract a stochastic time signal from a given PSD using the inverse fourier transform. 
the PSD contains frequencies from 0 to 2557,5 and i'm trying to generate a time signal corresponding to that PSD (it goes over a time period of 35 sec ).
I think i'm having a scaling problem but i don't know where ...
could you please help me with this :

First of all i tried to generate random phases for my PSD-amplitudes to be able to perform the ifft.
M=[freq Amplitude];  %PSD Matrix
a=sqrt(Amplitude);
phase = 2*pi*rand(size(a)); %random phases in [0  2*pi]
Y=a.*exp(j*phase);  % complex vector for ifft

signal = ifft(Y,N); %inverse Fourier Transform, problem in N ??????
t=0:35/(N-1):35; %time vector
plot(t,real(signal)) %plot of time signal

my time vector sould have 179200 values between 0 sec and 35 sec

which N should i use to get the correct answer ?