I am trying to plot the frequency spectrum of a Non-prbs stream. Below is the m-file. X indicates the PRBS stream of order 7 (total bits 127) and in the Y data stream, i have only changed 5 bit positions compare to X (to work this pattern like non-prbs).The frequency spectrum for X is completely fine what i am expecting but for the spectrum of Y, there are rapid fluctuation of amplitude levels for different frequency components (even I can see this if only 1 or 2 bit positions been changed in Y compare to X). Its not clear, why it is happing? Is it something due to wrong use of FFT function or else? Please give me the suggestions/any corrections are needed in the m-file.
Thanks in advance.