From: Yueran Gao on
I try to do some simulation based on white noise, which is generated by the bottom code. White noise should have a flat frequency spectral density, which means the magnitudes should be equal and constant on each frequency components, while it looks like random in the plot. Can anyone explain this?

Code:
clear;
noise = randn(1,8192);
noise_fft = abs(fft(noise));
plot(noise_fft(1:4096));
From: Wayne King on
"Yueran Gao" <yueran(a)siu.edu> wrote in message <hk9vr0$s06$1(a)fred.mathworks.com>...
> I try to do some simulation based on white noise, which is generated by the bottom code. White noise should have a flat frequency spectral density, which means the magnitudes should be equal and constant on each frequency components, while it looks like random in the plot. Can anyone explain this?
>
> Code:
> clear;
> noise = randn(1,8192);
> noise_fft = abs(fft(noise));
> plot(noise_fft(1:4096));

Hi, There are two nontrivial approximations involved here. 1.) You are using a random number generator to generate something that approximates white noise, and 2.) You are estimating the power spectral density based on a sample.

Wayne
From: ade77 on
"Yueran Gao" <yueran(a)siu.edu> wrote in message <hk9vr0$s06$1(a)fred.mathworks.com>...
> I try to do some simulation based on white noise, which is generated by the bottom code. White noise should have a flat frequency spectral density, which means the magnitudes should be equal and constant on each frequency components, while it looks like random in the plot. Can anyone explain this?
>
> Code:
> clear;
> noise = randn(1,8192);
> noise_fft = abs(fft(noise));
> plot(noise_fft(1:4096));

Power spectral density is the Fourier Transform of the autocorrelation function
From: Walter Roberson on
Yueran Gao wrote:
> I try to do some simulation based on white noise, which is generated by
> the bottom code. White noise should have a flat frequency spectral
> density, which means the magnitudes should be equal and constant on each
> frequency components, while it looks like random in the plot. Can anyone
> explain this?
>
> Code:
> clear;
> noise = randn(1,8192);
> noise_fft = abs(fft(noise));
> plot(noise_fft(1:4096));

If the magnitudes should be equal and constant on each frequency component,
then the fft of the samples must result in a series of real numbers that are
each either the positive or negative of the magnitude.

I have no idea why you expect that a normal distribution of samples would have
an fft that would have that particular property?
From: TideMan on
On Feb 3, 8:53 am, "Yueran Gao" <yue...(a)siu.edu> wrote:
> I try to do some simulation based on white noise, which is generated by the bottom code. White noise should have a flat frequency spectral density, which means the magnitudes should be equal and constant on each frequency components, while it looks like random in the plot. Can anyone explain this?
>
> Code:
> clear;
> noise = randn(1,8192);
> noise_fft = abs(fft(noise));
> plot(noise_fft(1:4096));

This is a very rough approximation to the spectral density.
You have found the DFT of one sample, which you should have windowed
first using Hanning or similar.
To get a flat spectrum, you need to repeat many thousands of times and
take the mean.
Then you need to smooth it.
Even after all this you will not achieve magnitudes that are equal and
constant, but you will get a spectrum with zero slope, which
corresponds to Hurst parameter of zero, which is white noise.