Sine Cosine Signal DFT Spectrum Analysis (continued), cosine dft
As mentioned in the previous article, the sequence length can be increased by adding zeros, so that the final increase of N can be used to increase the video resolution. However, it cannot solve the problem of frequency leakage. The root cause of frequency leakage is the selection of windows.
Due to the abrupt truncation of the rectangular window, the relatively large amplitude of the spectral Side Lobe leads to a large number of leaks. Therefore, like the FIR filter, we think of other windows.
The following example shows the rectangular window:
Ts = 0.01;
N = 0: 24;
Y = [sin (2 * pi * 20 * n * ts), zeros (1,999)];
Xk = abs (fft (y, 1024 ));
Stem (xk );
Spectrum
Let's change the triangle window: yd = [y. * triang (25) ', zeros (1,999)]; pay attention to weighting and then adding zero (in fact, it is not very definite ). The spectrum is as follows:
Hamming window:
Although the width of the main flap is widened, we can continue to increase N, so it is not a problem. The key is that the current spectrum will not leak.
DFT Analysis of the spectrum of continuous time signals
N = [0: 1: 99];
X = 2 * sin (4 * pi * 0.01 * n) + 5 * cos (8 * pi * 0.01 * n );
N1 = []; y1 = x );
Y1 = dft (y1, 45); magY1 = abs (Y1 );
K1 =; w1 = 2 * pi/45 * k1;
Subplot (2, 2, 1); plot (w1/pi, mag (Y1 ));
Title ('sample of DTFT magn ');
N2 = []; y2 = x (1: 1: 60 );
Y2 = dft (y2, 60); magY2 = abs (Y2 );
K2 =; w2 = 2 * pi/60 * k2;
Subplot (2, 2); plot (w2/pi, mag (Y2 ));
Title ('sample of DTFT magn ');
N3 = [0: 1: 69]; y3 = x (1: 1: 70 );
Y3 = dft (y3, 70); magY3 = abs (Y3 );
K3 = 0: 1: 69; w3 = 2 * pi/70 * k3;
Subplot (2, 2, 3); plot (w3/pi, mag (Y3 ));
Title ('sample of DTFT magn ');
2nd question;
Y4 = randn) (1, 70 );
X4 = y3 + y4;
Y4 = dft (x4, 70); magY4 = abs (Y4 );
K4 = 0: 1: 69; w4 = 2 * pi/70 * k4;
Subplot (2, 2, 4); plot (w4/pi, mag (Y4 ));
Title ('sample of DTFT magn ');
Spectral Analysis of positive Cosine Signal
From your implementation point of view, your t should be associated with Ryy, and t should take a range value, which is generally expressed as 0: π/n: a number, it indicates the incremental relationship. This is basically the case. If you need