Prev: Making movies
Next: how to read a fasta file in matlab
From: Dirk on 12 May 2010 08:04 Hello, I need to create a surface of which shape I only know the autocorrelation function; namely: R(z)=sigma1^2*exp(-|z|/D1) + sigma2^2*cos(2pi*z/D2) I know that the autocorrelation function is related to the power spectral density and therefore to the amplitude spectrum. But I lack the phase information. So my question is it possible to create a noise function in Matlab with that autocorrelation function? If not, what paramters will be needed to fully describe that process? If, yes, how do I do it? Thanks alot, Dirk
From: TideMan on 12 May 2010 16:14 On May 13, 12:04 am, "Dirk " <dja...(a)web.de> wrote: > Hello, > I need to create a surface of which shape I only know the autocorrelation function; namely: > R(z)=sigma1^2*exp(-|z|/D1) + sigma2^2*cos(2pi*z/D2) > I know that the autocorrelation function is related to the power spectral density and therefore to the amplitude spectrum. But I lack the phase information. > > So my question is it possible to create a noise function in Matlab with that autocorrelation function? > > If not, what paramters will be needed to fully describe that process? > If, yes, how do I do it? > > Thanks alot, Dirk Phase is irrelevant for PSD, so you can make it anything you like. One option is random phase: phase=2*pi*rand(n,1); but phase=0; would be just as valid. Once you get the amplitude spectrum, you can combine with whatever phase you choose and ifft to get a time series. If the combined amplitude and phase is X(f), where f=0,df,2*df, 3*df,.... and df is the interval in frequency, you get the time series like this: x=ifft([X;0;flipud(X(2:end)')]); % for length(X) even x=ifft([X;flipud(X(2:end)')]; % for length(X) odd You may need to scale, depending on the units of X, but it is easily figured out by matching the variance of x with the area under the PSD.
|
Pages: 1 Prev: Making movies Next: how to read a fasta file in matlab |