
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

% Frequency Modulation: close all syms A t wm fs kf kp wc A1 % Constucted variables to integrate the message signal for FM
m = A1cos(wmt) % Message Signal i = int(m,t) % Integrated Signal
% Arguments: t = 0:0.002:2; % Time vector with values 0 to 2, taking 1000 samples A = 1; % Amplitude of both message signal and of the expression of FM and PM wm = 2pi0.5; % Frequency of message signal fs = 500; % Sampling rate kf = pi/4; % Constant kp = pi/3; % Constant wc = 2pi10; % Frequency of carrier signal A1 = 10; % Amplitude of message signal
% After giving values: m = A1cos(wmt); i = A1/wmsin(wmt);
% Time Domain: phiFM = Acos((wct)+(kfi)); phiPM = Acos((wct)+(kpm));
figure, plot(t,m), title('Original Signal'),xlabel('time'),ylabel('Amplitude') figure, plot(t,phiFM), title('Frequency Modulated Signal'),xlabel('time'),ylabel('Amplitude') figure, plot(t,phiPM), title('Phase Modulated Signal'),xlabel('time'),ylabel('Amplitude')
% Frequency Domain: w=-250:(2*250)/1000:250; PHIFM = fftshift(abs(fft(phiFM))); PHIPM = fftshift(abs(fft(phiPM)));
figure, stem(w,PHIFM), title('Fourier Transform of FM signal that shows the frequencies produced'), xlabel('linear frequency'),ylabel('Amplitude') figure, stem(w,PHIPM), title('Fourier Transform of PM signal that shows the frequencies produced'), xlabel('linear frequency'),ylabel('Amplitude')