MATLAB Code % Set parameters fs = 1000; % Sampling rate in Hz t = 0:1/fs:1; % Time vector spanning 1 second analogSignal = (sin(2 * pi * 2 * t) + 1) / 2; % Generate a 2 Hz sine wave, scaled to [0,1] samplesPerPulse = 100; % Define number of samples per pulse ppmWidthFraction = 0.1; % Fraction of samplesPerPulse used for pulse width % Perform PPM modulation [ppmSignal, ppmPulseTrain] = ppmModulate(analogSignal, samplesPerPulse, ppmWidthFraction); % Perform PPM demodulation demodulatedSignal = ppmDemodulate(ppmSignal, samplesPerPulse); % Display the demodulated signal values disp('Demodulated Signal:'); disp(demodulatedSignal); % Plot results figure; % Plot original analog signal subplot(3, 1, 1); plot(t, analogSignal, 'b'); title('Original 2 Hz Sine Wave'); xlabel('Time (s)'); ylabel('Amplitude'); % Plot modulated PPM signal subplot(3, 1, 2); stem(ppmSignal(1:1000), 'filled'); title('Pulse Position Modulated (PPM) Signal'); xlabe...