Frequency & Phase Modulation Matlab CODE

This post is based on Frequency & Phase Modulation Matlab CODE

Frequency Modulation:

clear all
 ts=0.0001;
 t = 0:ts:1;             % time variable
 fc =1000;               % carrier frequency
 F=5;
 %----------------------------------------------------------%
 % Create message signal m(t)%
 %----------------------------------------------------------%
 m = sawtooth(2*pi*F*t);
 kf  =2000*pi;           % frequency deviation constant
%----------------------------------------------------------%
 %Modulating the carrier with the message signal%
 %----------------------------------------------------------%
 carrier = cos(2*pi*fc*t);
 modulated = cos(2*pi*fc*t + kf*ts*cumsum(m));
 %----------------------------------------------------------%
 %Plotting the m(t)%
 %----------------------------------------------------------%
 subplot(3,1,1)
 plot(t,m,'b:','linewidth',2)
 title('Message Signal','Fontsize',12);
 xlabel('time(seconds)rightarrow');
 ylabel('amplitude(volts)rightarrow');
 grid on;
 %----------------------------------------------------------%
 %Plotting the carrier%
 %----------------------------------------------------------%
 subplot(3,1,2)
 plot(t,carrier,'b--','linewidth',2.5);
 title('carrier Signal','Fontsize',12);
 xlabel('time(seconds)rightarrow');
 ylabel('amplitude(volts)rightarrow');
 grid on;
 %----------------------------------------------------------%
 %Plotting the modulated%
 %----------------------------------------------------------%
 subplot(3,1,3)
 plot(t,modulated,'m:');
 title('Frequency Modulated Signal','Fontsize',12);
 xlabel('time(seconds)rightarrow');
 ylabel('amplitude(volts)rightarrow');
 grid on;
 axis([0 1 -1.5 1.5]);
 _______________________________________________

 

Phase Modulation:

clc;
 clear all;
 close all;
 %=======================================================%
 %Phase Modulation%
 %=======================================================%
 t = 0:0.0001:1;              % time variable
 fc=input('Enter carrier frequency between 50 to 100= ')%For better results
 Fm=5;
 %=======================================================%
 %Create message signal m(t)%
 %=======================================================%
 m = sawtooth(2*pi*Fm*t);
 kp  = pi/2;                 % phase deviation constant
%=======================================================%
 %Modulating the carrier with the message signal%
 %=======================================================%
 carrier =cos(2*pi*fc*t);
 modulated = cos(2*pi*fc*t + kp*m);
%=======================================================%
 %Plotting the signals%
 %=======================================================%
 subplot(3,1,1)
 plot(t,m,':r','linewidth',2)
 xlabel('time(seconds)----->');
 ylabel('amplitude(volts)----->');
 title('Message Signal','Fontsize',14);
 grid on;
 subplot(3,1,2)
 plot(t,carrier,'--k','linewidth',2);
 xlabel('time(seconds)----->');
 ylabel('amplitude(volts)----->');
 title('carrier Signal','Fontsize',14);
 grid on;
 subplot(3,1,3)
 plot(t,modulated,'.-b');
 xlabel('time(seconds)----->');
 ylabel('amplitude(volts)----->');
 title('Phase Modulated Signal','Fontsize',14);
 grid on;
 axis([0 1 -1.5 1.5]);

_____________________________________________

Untitled


clash of clans ipad download
minecraft free download
forbrukslånportalen
Innboforsikring Advokat
Beste Radonmåling Vest-Agder
Beste Innbruddsalarm I Asker
Låne Penger Uten Sikkerhet I 2016
Oversikt Over Hotell Tromsø