Matlab code for pwm and ppm5/22/2023 Figure 3.58(b) illustrates the spectrum in the neighborhood off = 200 Hz. ![]() Since the individual spectral components are spaced 1 Hz apart, corresponding to the 1-Hz sinusoid, they cannot be clearly seen. Figure 3.58(a) illustrates the spectrum in the range 0 < 1000. The spectrum, as determined by the FFT, is illustrated in Figure 3.58(a) and (b). The FFT covers 10 periods of the waveform. ![]() The message signal is sampled at 200 samples per period or 200 Hz. In the preceding program the message signal is a sinusoid having a frequency of 1 Hz. The MATLAB code follows: % File: c3ce5.m clear all %be safe N = 20000: %FFT size N_samp - 200: % 200 samples per period f=1 % frequency beta -0.7: % modulation index period - N/N_samp % sample period (TS) Max_width-beta*N/N_samp: % maximum width y-zeros(1,N): % initialize for n-1:N_samp x = sin(2*pi*f*(n-1)/N_samp) width-(period/2) + round ((Max_width/2)*x): for k=1:Max_width nn - (n-1) period+k if k
0 Comments
Leave a Reply. |