Working on...

your queries, use contact form

9 Dec 2021

AM and FM practical codes for scilab software

 

Modulation is the process of superimposing of information signal onto carrier signal. In amplitude modulation (AM), the amplitude of carrier signal changes in accordance with information or message signal and in frequency modulation (FM), frequency of carrier signal changes in accordance with information or message signal. In this tutorial, scilab codes for generation of AM and FM are given. Anyone having scilab software installed on their PC can directly can copy, paste and generates AM and FM wave, only you need to insert required parameters.

Amplitude Modulation practical code for scilab

Ac=input('enter carrier signal amplitude');

Am=input('enter message signal amplitude');

fc=input('enter carrier frequency');

fm=input('enter message frequency');

m=input('enter modulation index');

t=input('enter time period');

t1=linspace(0,t,1000);

y1=sin(2*%pi*fm*t1); // message signal

y2=sin(2*%pi*fc*t1); // carrier signal

eq=(1+m.*y1).*(Ac.*y2);

subplot(311);

plot(t1,y1);

xlabel('Time');

ylabel('Amplitude');

title('Message signal')

subplot(312)

plot(t1,y2);

xlabel('Time');

ylabel('Amplitude');

title('Carrier signal');

subplot(313);

plot(t1,eq);

plot(t1,eq,'r');

xlabel('Time');

ylabel('Amplitude');

title('Modulated signal');

  


 

Frequency Modulation practical code for scilab

clc;

clear;

close;

fm=input('message frequency=');

fc=input('carrier frequency=');

mi=input('modulation index=');

t=0:0.0001:0.1;

 

vm=cos(2*%pi*fm*t);

subplot(3,1,1);

plot(t,vm);

xlabel('time');

ylabel('amplitude');

title('message signal');

 

//grid on;

vc=sin(2*%pi*fc*t);

subplot(3,1,2);

plot(t,vc);

xlabel('time');

ylabel('amplitude');

title('carrier signal');

 

//grid on;

vfm=cos(2*%pi*fc*t+(mi*sin(2*%pi*fm*t)));

subplot(3,1,3);

plot(t,vfm);

xlabel('time');

ylabel('amplitude');

title('FM signal');

//grid on;

         


No comments:

Post a Comment