How to perform a Spectral Analysis on data?

I am trying to perform a spectral analysis from the NIST list of tests for randomness on a vector to determine if the data inside the vector is possibly from a random source. I found out that you can use the pwelch() function to plot the spectral analysis. I get a plot, and I am not sure what it means. Is this the correct way to perform this test? Is it better to use the FFT function in matlab and manipulate the FFT so that I can plot it. If that is the better way, I have no idea how to do it. I am not very familiar with the mathematics behind the FFT. I have also found that when the vector is converted from values between 0-1 to values between 0-255 the plot (using the pwelch() function) completely changes. This does not make sense because it is the same data just multiplied. Multiplying the data by 255 makes the data look random. When the data is between 0-1 it looks periodic. I am guessing that if the data is close to random, the wave should appear as a rectangle. When I plot it (0-255) I receive a horizontal wave (or close to a rectangle) translated up. I don't know what this means. I will try to post a picture of the pwelch() of the data between (0-1) and between (0-255). I truly believe my data is closer to random than the spectral analysis is stating.
This from google images. When I say horizontal wave, I mean it looks along the lines of this: <http://www8.tfe.umu.se/courses/systemteknik/signal_theory/ht10/lab/periodogram_test-filer/image002.jpg>

Answers (0)

Asked:

on 14 Feb 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!