1
$\begingroup$

So, I have a noisy signal in time domain, $f(t) = t \eta(t)$ where $\eta(t)$ is white noise with variance $\sigma$ and mean zero, and that it has the property $\langle \eta(t)\eta(t') \rangle = \sigma^2 \delta(t-t')$ ($\langle \ldots \rangle$ denotes ensemble averaging). What I want to do is that I want to calculate the square magnitude of the spectrum in frequency domain upon ensemble averaging, $\langle |z(\omega)|^2 \rangle$. To do this, I follow Dave's answer in https://physics.stackexchange.com/questions/53739/magnitude-of-the-fourier-transform-of-white-noise. So, it will be $$ \langle |z(\omega)|^2 \rangle = \iint e^{i\omega t} e^{-i\omega t'}t't \langle \eta(t)\eta(t') \rangle dt dt' $$ Using the property stated above, $\langle \eta(t)\eta(t') \rangle = \sigma^2 \delta(t-t')$, I can obtain $$ \langle |z(\omega)|^2 \rangle = \sigma^2 \int t^2 dt $$. Thus, the ensemble averaged square magnitude of my function is independent of $\omega$.

Now I perform the same calculation using MATLAB and I obtained the following pictures. enter image description here

It seems like when I take ensemble average of the lower curve, it will be dependent on $\omega$, which contradicts my calculation. Can someone please point out my mistake(s)?

clear all;
clc;

n = 2048;
ft = rand(1,n)*(2+2)-2 + 0;
t = linspace(-10,10,n);
Dt = 1/(t(3)-t(1));

fw = ifft(fft(t.*ft));
w = (-length(t)/2:length(t)/2-1)*2*pi*Dt/length(t);
subplot(211)
plot(t,t.*ft)
xlabel('t')
ylabel('f(t)')

subplot(212)
plot(w,abs(fw).^2)
xlabel('\omega')
ylabel('|z(\omega)|^2')

That's my code. By the way I think you are using normal distribution for the noise, I used white noise type.

$\endgroup$
  • $\begingroup$ You are taking the FT of $t\eta(t)$, not of $\eta(t)$. That factor of $t$ definitely makes the FT dependent on frequency, even if $\eta$ does not. In fact, I would say you are getting the exact result you should be getting. $\endgroup$ – bob.sacamento Dec 1 '15 at 19:42
  • $\begingroup$ Of course the FT of $t\eta(t)$ (and also $\eta(t)$ alone) will depend on $\omega$. But what I calculate is the ensemble average of the squared magnitude of the spectrum which, according to my possibly wrong calculation, does not depend on frequency. $\endgroup$ – nougako Dec 1 '15 at 19:58
  • $\begingroup$ Just wondering: You seem to have moved on from this question. Did my answer get you what you needed? If so, please accept it as the answer (click the check mark / tick beside it). $\endgroup$ – Peter K. Dec 2 '15 at 22:08
0
$\begingroup$

Looking at your code, this line looks odd:

fw = ifft(fft(t.*ft));

Why are you immediately taking the inverse FFT? Surely you just want:

fw = abs(fft(t.*ft));

???


This is not really an answer, more a request for more information.

I try to repeat your example in R and I cannot get the FFT you get. What I get is plotted below. Can you share your matlab code? I'm wondering what it's doing.

enter image description here


R Code Below

#27432

T2 <- 1000

f <- rnorm(2*T2+1) * seq(-T,T,1)

par(mfrow=c(2,1))
plot(f, type="l", col="blue")
plot(abs(fft(f)), type="l", col="blue")
$\endgroup$
  • $\begingroup$ I know my previous answer is not an answer but I want to respond to your answer by sharing my code as you requested. Can I write a code in a comment? By the way, yeah you are write. That ifft should have been ifftshift, my bad. $\endgroup$ – nougako Dec 1 '15 at 21:01
  • $\begingroup$ @nougako: I've edited your question and added it there. Have a look at my updated answer. $\endgroup$ – Peter K. Dec 1 '15 at 21:02
  • $\begingroup$ By the way, I think the ensemble average of my $f(t)$ is approximately equal to the time average. Based on this, can I say that $f(t)$ is an ergodic signal? $\endgroup$ – nougako Dec 1 '15 at 21:11
  • $\begingroup$ @nougako : I'm uncertain if $f(t)$ is ergodic, because of the time dependence on the variance. $\endgroup$ – Peter K. Dec 2 '15 at 15:52
0
$\begingroup$

After thinking more about this, I am pretty sure that what you really want to do, and what your MATLAB probably in fact is doing, is study the a function like

$\displaystyle f(t)=\int^tdt^\prime (t-t^\prime)\eta(t^\prime)$

with $\eta(t)$ having the correlation property you've already mentioned. This will give an FT that is definitely frequency dependent and, I think, looking like your MATLAB results.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.