0
$\begingroup$

I am relatively new to signal processing techniques and Matlab and need a bunch of test data in the form of white noise, as defined on the Wikipedia page, with constant, flat power spectrum.

I tried the matlab built-ins wgn(m,n,p) and randn(m,n) to get vectors of white noise, and then used different combinations of the periodogram/pwelch/dspdata.psd functions to check what I believe to be the power spectrum. I cannot say I am 100% certain on the basis of documentation and other forum sourcing, so do correct me if I am mistaken.

The resulting plots I get do not look even close to a flat spectrum but instead inherit the "zick zacky" curve of the original random data. The question I inevitably had to ask myself: Do you even know what to expect and how to understand the results of the functions and how a flat power spectrum looks like? I don't, hence I am here, looking for clarification.

I am looking for answers which go beyond the Wikipedia pages etc., as they left me confused.

$\endgroup$
0
$\begingroup$

You need to average a bunch of FFTs of white noise to approach the average power spectral density.

see this and this.

$\endgroup$
  • $\begingroup$ I guess by "FFT" you mean "abs(FFT).^2", along with windowing and overlaps. $\endgroup$ – sellibitze Dec 20 '13 at 11:20
0
$\begingroup$

You may be interested in generating a "maximal length sequence" (MLS) vector. Even for short sequences, its fourier transform is spectrally flat (except for the 1st DC element, which can be tested independently). The test vector will consist of only +1 and -1 values, of length 2^N - 1 which you can apply to the system under test and obtain a response vector.

MLS are frequently used in impulse response measurement. You can use a simple back-substituion method or the fast hadamard transform to quickly obtain an impulse response from the data.

Once you have the impulse response, you can fourier transform it to get the frequency response from which the power spectral gain can be obtained.

Interestingly, an impulse response is also spectrally flat (It's fourier transform is 1 at all frequencies) but often does not have enough power for reasonable test data.

Unfortunately, Matlab does not appear to have a function for generating an MLS (as far as I can see), but the following submission which I have not evaluated contains a .m file that claims to do this for you:

http://www.mathworks.com/matlabcentral/fileexchange/1246-mls-m

You may have to dig in a bit if you want to get the impulse response from the output but at least this will give you a spectrally flat test signal, which is what you requested.

$\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.