- 4 A Generate A Cosine Waveform With Given Specifications N 64 Signal Length Power Of 2 T 1 Sampling Period 1 (46.48 KiB) Viewed 16 times
4. (a) Generate a cosine waveform with given specifications. N=64; % signal length (power of 2) T = 1; % sampling period
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
4. (a) Generate a cosine waveform with given specifications. N=64; % signal length (power of 2) T = 1; % sampling period
4. (a) Generate a cosine waveform with given specifications. N=64; % signal length (power of 2) T = 1; % sampling period is set to 1 A = 1; % sinusoid amplitude f-0.25;%f-1/4 nT [0:N-1]*T; x = cos(2*pi*f*nT); % sinusoid Plot its time and frequency versions. 4. (b) The above example was somewhat contrived. It is more likely that the signals you analyze will have sinusoidal components that don't complete a full cycle or, said differently, have frequency components that lie between frequency bins. Let's see what happens in such a case. First, increase the frequency in the above example by one-half of a bin: f=0.25 +0.5/N; % Move frequency up 1/2 bin x1 = cos(2*pi*f*nT); % Signal to analyze x-[x1 x1]; % Periodic Extension Now plot the time & frequency versions of this new signal. Compare the results of a & b. The best approach to minimize leakage in practical applications is to multiply the time record by a suitable window function before performing FFT. A window function generally has a unit gain at the center of the FFT segment, decreasing gradually to zero or a small value at both ends of the FFT segment, and becomes zero outside the FFT segment. Thus it greatly suppresses the discontinuity of the time record between FFT segments.