# Digital signal and frequency analysis

I am generating a digital signal with software. I have defined the vector $$[0,1,1,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0]$$ and my sampling rate is 8 million per second.

The frequency spectrum is periodic, with bandwidth of each spectrum being 8 MHz I guess (I do not see 4 MHz as the highest frequency on my GUI, I see a frequency way smaller, which I do not understand).

Then, in order to see the generated signal better, I have repeated each vector value 800 times. This gave me a pulse width of 100 microseconds long (1/8000000*800).

My question is How would repeating each vector affect the frequency spectrum? How come can I see only one peak after repeating each vector (800 times) in my FFT spectrum GUI? Shouldn't it stay periodic since I am still looking at a digital signal?

• Why am I getting a down vote without any comments? – Jack Nov 4 '16 at 11:29
• Because comments are heavily suggested, but not mandatory for downvotes (not mine anyway). I believe it is not fully clear right now. Is your whole sequence "sampled" at 8 MHz, or each symbol? Do you repeat each value 800 times, or the vector? Your expression "each vector" is quite misleading, And I don't quite understand the 100 microsecond pulse width. Graphs and clarifications could help – Laurent Duval Nov 4 '16 at 14:45
• I agree, I found it a little confusing too- Since you wrote 100 us long and 8 Million Samples per second, and said repeated the vector value 800 times then I think you mean that each element in the vector is given as a sample at the 8MSps rate: but 20 samples * 800 * 1/8E6 samples/sec = 2 ms. Also yes I see the confusion in how it is repeated, in my answer below I assumed you repeated the vector , but if you held each value for 800 samples that would be quite different from what I described. – Dan Boschen Nov 5 '16 at 5:36

First to explain why you see a very small value on your frequency axis: digital frequency spectrums are often given as "normalized frequency" as your unit of time changes from "seconds" to "samples". For example angular frequency which in the analog domain is given in radians per second becomes radians per sample, and frequency given in terms of cycles per second (Hz) becomes cycles per sample. It is called "normalized frequency" as the frequency axis is scaled by the sampling rate. The normalized digital frequency related to the analog frequency using this conversion would have a range of -$\pi$ to $\pi$ for angular frequencies over the Nyquist bandwidth of $-2*\pi f_s/2$ to $+2*\pi f_s/2$, or $-1/2$ to $+1/2$ for frequencies over the Nyquist bandwidth of $-f_s to +f_s$, where in both cases $f_s$ is your sampling rate. Some plots may normalize to $f_s/2$ in which case you will see the frequency range go from -1 to +1. Note the digital frequency spectrum is itself periodic with the sampling rate, so digital frequency spectrums may be presented as starting at 0 and going to f_s (in which case 0 to $2*pi$ or 0 to 1 for frequencies in radians/sample or cycles/sample. In this case, the frequencies from 0.5 to 1 are identical to the frequencies from -.5 to 0: meaning you can vertically slice the entire second half of the plot (right side) and move it over to the left side of the first half of the plot to get a view over +/- frequency. If the signal is real, then the spectrum is conjugate symmetric and therefore you would only need to see and display the range of 0 to 0.5.
Second to explain what happens when you repeat your time domain signal: When you take an FFT of a time domain sample, the result is identical to what you would get if the time domain signal was repeating (see my answer to Intuition for sidelobes in FFT which further explains this property). Another property of the FFT is that there will be the same number of samples in the frequency domain as in the time domain. These N samples will be given as sample 0 to N-1, where sample 0 in the frequency domain represents DC and sample N-1 is one sample less than the sample that would truly represent $f_s$ in frequency. As explained above, these FFT samples may be presented on your plot as the frequency magnitudes over a range of +/- frequency (in this case samples [N/2 ... N-1 0 ...N/2-1] or if your time domain signal is real then only the positive frequency components may be given on the plot as DC to $f_s/2$ corresponding to samples [0 ... N/2]. If you added more samples, by repeating your time domain waveform evenly, sample N-1 would still represent $f_s$ but the process of the FFT would insert zeros between every sample in frequency (repeating your time domain waveform twice would insert 1 zero between every frequency sample, repeating three times would insert 2 zeros, etc). However each frequency value and their frequency location, other than a possible scaling in magnitude by the repetition rate, would not change which is consistent with my first sentence in this paragraph.