Message Boards Message Boards

0
|
7345 Views
|
11 Replies
|
5 Total Likes
View groups...
Share
Share this post:

[?] Calculate the power spectral density of frequency modulated process?

Posted 6 years ago

I try to calculate PSD of Wiener modulated process

x=TransformedProcess[Exp[\[ImaginaryI]*b[t]], b \[Distributed] WienerProcess[], t];
data = RandomFunction[x, {0, 10}];
psd = PowerSpectralDensity[data, \[Omega]];
Plot[psd, {\[Omega], -\[Pi], \[Pi]}, PlotRange -> All,  Filling -> Axis]

But output of Plot is empty. What am I doing wrong?
And how I can calculate autocorrelation functuion of data?

11 Replies

Thank you. I'll try to play around with the parameters to get a theoretical dependence of the correlation function.

If you want to average over realizations you need to first simulate multiple paths. CorrelationFunction for ensemble of paths will automatically take average:

proc = TransformedProcess[E^(I*b[t]),  b \[Distributed] WienerProcess[], t];
data = RandomFunction[proc, {0, 10, 0.1}, 10^3]; (*simulate 10^3 path realizations*)
corr = CorrelationFunction[data, {data["PathLength"] - 1}]; (*the average across all paths*)
POSTED BY: Gosia Konwerska

Thank you very much. It's working, but how I can get averaged corr over the set of realizations, for example, 500? I trying to make it by the folowing code, but it seems that averaging doesn't working.

TransformedProcess[E^(I*b[t]), b \[Distributed] WienerProcess[], t];
data = RandomFunction[\[ScriptCapitalP], {0, 10, 0.1}];
corr = CorrelationFunction[data, {data["PathLength"] - 1}];
data1 = Table[corr, {i, 500}];
data2 = Sum[data1[[i]], {i, 1, 500}];
data3 = data2/500;
ListPlot[{Re[data3]}]

x=TransformedProcess[Exp[\[ImaginaryI]*b[t]], b \[Distributed] WienerProcess[], t];

is a transformation of a continuous time process. Therefore the sampling function RandomFunction needs three argument time parameter specification {min, max, step}. This is the reason that

data = RandomFunction[x, {0, 10}];

fails and in result everything coming after that that requires data. Daniel's suggestion is correct, but the sampling can happen at shorter steps (that will produce more points on a path):

data = RandomFunction[x, {0, 10, .1}];

Then

In[19]:= PowerSpectralDensity[data, \[Omega]] // Head

Out[19]= Plus

Now for plot. Note that:

In[20]:= psd = PowerSpectralDensity[data, \[Omega]];

In[27]:= psd /. \[Omega] -> .1

Out[27]= 5.96745 + 0.681108 I

so psd is a complex expression. One may plot its real and imaginary parts separately, try:

In[28]:= Plot[Re[psd], {\[Omega], -\[Pi], \[Pi]}, PlotRange -> All, Filling -> Axis]

For the autocorrelation function of the data one can use CorrelationFunction:

In[33]:= corr = CorrelationFunction[data, {data["PathLength"] - 1}];

In[34]:= corr // Head

Out[34]= TemporalData

In[37]:= ListPlot[{Re[corr], Im[corr]}]
POSTED BY: Gosia Konwerska

One thing is psd cannot evaluate numerically From documentation (pointed out to me by a colleague): "For continuous-time processes without jumps, such as WienerProcess and ItoProcess, an explicit dt needs to be given.". If set up using an explicit increment then it behaves better. So one could repair this as below.

data = RandomFunction[\[ScriptCapitalP], {0, 10, 1}];

Note that it will be complex-valued so the plot should be of the real or imaginary parts, or of the absolute value or abs-squared, or something along those lines.

There might be other issues, but this is what shows up on first inspection.

POSTED BY: Daniel Lichtblau

Thank you. I'll try to understand.

I can't help you with that. However, when trouble shooting, it's best to look at the output of each line, rather than having a number of statements connected with semi-colons and only looking at the last output.

POSTED BY: Frank Kampas

I need to evaluate an autocorrelation function of process $y(t)=exp(i\psi(t)),$ where $\psi(t)=\int_0^t{n(t)}dt$, where $n(t)$ - white gaussian noise. I try it, but it does not work. Can this be done with the Wolfram?

Did you look at psd to see the data you're trying to plot?

POSTED BY: Frank Kampas

I'm new to using Wolfram. Could you tell me, please, how I can do this. If I remove the semicolon in the third line, then Wolfram gives me an analytical record.

Attachments:
    Looks like the function didn't evaluate 

In[1]:= x = 
  TransformedProcess[Exp[I*b[t]], b \[Distributed] WienerProcess[], t];
data = RandomFunction[x, {0, 10}];
psd = PowerSpectralDensity[data, \[Omega]]

Out[3]= PowerSpectralDensity[
 RandomFunction[
  TransformedProcess[E^(
   I \[FormalP][\[FormalT]]), \[FormalP] \[Distributed] 
    WienerProcess[0, 1], \[FormalT]], {0, 10}], \[Omega]]
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract