[Compressed sensing collection 4] Spectrum analysis of two sampling signals, ideal sampling signal and random sampling signal, and comparison of sampling effects

[Compressed Sensing Collection 1] (Background Knowledge) Mathematical Derivation and Graphical Analysis of Shannon Nyquist Sampling Theorem
[Compressed Sensing Collection 2] (Background Knowledge) Mathematical Derivation and Interpretation of Signal Sparse Representation
[Compressed Sensing Collection 3] Compressed Sensing The background and significance of
[compressed sensing collection 4] (background knowledge) Spectrum analysis of two sampling signals, ideal sampling signal and random sampling signal, and comparison of sampling effects

main target

Study the frequency spectrum of ideal sampled signal and random sampled signal, and some related instructions

environmental assumptions

The parameters are as follows:

  • The total number of points in the time domain of the sampled signal: 1024
  • Sampling frequency for the two signals to be studied (ideal sampling signal and random sampling signal): 1KHz
  • The sampling frequency of the two signals
    • For the ideal sampling signal, it is assumed that when the sampling frequency is 10Hz, there will be ten pulse signals in one second, and they are equally spaced, which is the highest frequency upper limit of the ideal signal spectrum ω m \ omega_mohm
    • For random sampling signals, it is assumed that when the sampling frequency is 10Hz, for the convenience of comparison, the same number of pulse signals is also set in one second, the spacing is random, and the minimum interval between pulses can reach 1

The assumptions are as follows:

  • The pulse height is 10
  • Simulate a pulse signal in an ideal sampled signal with a narrower square wave signal
  • Only simulate 1024 points, the ideal sampling signal is periodic in this 1024 points, so as to replace the periodic ideal sampling signal in the full time domain

The legend is as follows:

Each figure legend

Figure 1 (10Hz)

Figure 2 (20Hz)

Figure 3 (50Hz)

Figure 4 (100Hz)

image-20210710222823271

analysis description

Explanation 1: The spectrum of the ideal sampled signal in Figure 1->4 is slightly inconsistent with the result of mathematical reasoning

From 10Hz to 100Hz, the spectrum of the ideal sampling signal (the upper right corner of each picture) found that the spectrum effect becomes better and sharper, and gradually conforms to the supplementary proof in the Nyquist sampling law (what should the spectrum of an ideal sampling signal look like? Yes, you can refer to the previous blog [Compressed Sensing Collection 1] (Background Knowledge) Mathematical Derivation and Graphical Analysis of Shannon Nyquist Sampling Theorem )

Why does this happen? I don’t do too much mathematical derivation this time, just try to analyze it logically.

The reason is as follows: At 10Hz, there are 10 pulse signals at 1024 points in the entire time domain, which are respectively distributed at 0, 100, ..., 1000 points, and then do the fft of 1024 points, but we need to know that there is a problem after the fft is done. The 1024 points are different from energy analysis at every frequency point seen in the analog domain. There is a theoretical spectrum accuracy, and the lowest accuracy is Δ = 500 Hz / 512 = 0.9765625 \Delta = 500\text { Hz}/512 = 0.9765625D=500Hz/512=0 . 9 7 6 5 6 2 5 , that is to say, it cannot reflect the frequency energy of each frequency, but can only accurately reflectΔ \DeltaThe energy above integer multiples of Δ . Example10 Hz 10\text{Hz}The two closest precise points of 1 0 Hz are 10 ∗ Δ = 9.765625 10*\Delta = 9.76562510D=9 . 7 6 5 6 2 511 ∗ Δ = 10.7421875 11*\Delta =11D=10.7421875

From this we can make two theoretical examples to illustrate our assumptions just now

Example 1: When our frequency accuracy is high enough, can we see a clearer spectrum

The parameters are set as follows

  • The total number of points in the time domain of the ideal sampling signal 1: 1024
  • The total number of points in the time domain of the ideal sampling signal 2: 1024*4
  • The total number of points in the time domain of the ideal sampling signal 3: 1024*16
  • Sampling frequency for ideal sampling signal: 1KHz
  • The sampling frequency of 3 signals is 10Hz

It can be seen that the leakage at the bottom is very small, and as the number of sampling points increases, the periodicity becomes more and more obvious, which is a sharp impact. As for why the height is different, let's look at the second example

Example 2: The problem of uneven frequency spectrum height (this problem can be avoided if the spectrum energy is exactly above the integer multiple of the spectrum accuracy)

In fact, this problem is also due to the problem of spectrum accuracy. Even if the third sampling signal in example 1 has a lot of points, the spectrum accuracy is very low and it cannot be correctly placed above 10Hz, which leads to the current spectrum energy cycle. For example, the difference of integer multiples of 10Hz is periodic, but the correct value is actually at the least common multiple. But in this example, I change the way to deduce.

The parameters are set as follows

  • The total number of points in the time domain of the ideal sampled signal: 1024
  • Sampling frequency for ideal sampling signal: 512Hz
  • The sampling frequency of 3 signals is 10Hz

In the case of this parameter setting, it can be found that every place with spectrum energy falls on the lowest frequency resolution. The complete frequency spectrum of the pulse shape extended according to the frequency period can be completely displayed here.

Explanation 2: How does the difference between the random sampling signal and the ideal periodic sampling signal in Figure 1->4 come from?

It can be found that the periodic sampling signal has spectral energy only at integer multiples of its own sampling frequency, and it is 0 in other places.

  • Analysis 1 (derived from the mathematical formula): The periodic signal can be written in the form of Fourier series (as mentioned in the blog of the Nyquist sampling theorem). The specific form can be written in this form. So it can be easily understood that there is no energy at other frequency points.

S i g n a l ( t ) = ∑ k = − ∞ ∞ a k e j k ω s t Signal(t)=\sum_{k=-\infty}^{\infty} a_{k} e^{j k \omega_{s} t} Signal(t)=k=akejkωst

  • Analysis 2 (abstract description): When analyzing a single cycle, every frequency point must have energy. But in the case of repeating this cycle continuously, it will play a role of spectrum addition. When the signal moves in the time domain, the absolute value of the spectrum will not change, but the phase will change. Periodic repetition can actually be understood as a single-period signal moves through a certain time domain and then added, and repeated infinitely. Then this corresponds to the operation in the spectrum, that is, the original spectrum is added after a certain phase shift. The energy at some frequency points will disappear because (in fact, it is similar to the problem of frequency accuracy just now) the energy at the frequency point that is not an integer multiple of its own period, in the superposition of countless times of different phases, because the sum of integrals cancels out, it is an integer with its own period The energy at the frequency point of multiple times will be accumulated in countless times of different phase superpositions.
  • Based on these two analyses, it will be found that the random sampling signal and the spectrum are like this mainly because each small frequency point caused by random superposition has some spectrum leakage. The reason for the height of the main peak is mainly reflected in the mean energy at the 0 frequency point.

Explanation 3: The reason why random sampling signals can be used for compressed sensing

This will be described again in a later blog, and here is a brief description.

Analysis of Ideally Sampled Signals

If the sampling points of these sampled signals are evenly distributed, the sampled signal will approach the ideal sampled signal, and the time-domain convolution between the ideal sampled signal and the sampled signal is equivalent to multiplication in the frequency domain. The effect of spectrum shifting will be achieved, and the specific effects are as follows:

This is why it is necessary to sample twice the highest frequency spectrum of the sampled signal.

Analysis of Randomly Sampled Signals

With the increase of sampling points in the signal at the same time, the main peak of the random signal spectrum gradually becomes higher, and the proportion of the difference between the pull-up and the spectrum energy leakage. At this time, because the main peak of the randomly sampled signal is high, the sidelobe has an indeterminate random spectrum leak. These leaks will also move the previously sparse spectrum in a small amount, but will not affect the main shifting effect of the main peak.

The effect during the specific sampling process may be as shown in the figure below (the three peaks in the spectrum are drawn in different colors in the last picture to show different spectrum shift and leakage effects, and the blue lines are the three effects. Composite image)

image-20210710221735344

As for how to use this property and how to restore this signal, I will talk about it in the next article. (if i can make it clear)

Last, this blog has no references, most of it is my idea, not necessarily correct

Last and not least, the code is ok, I haven’t done github yet, maybe I will put it on it in the future

Guess you like

Origin blog.csdn.net/qq_41554005/article/details/118641916