Frequency modulation programs (FM program)
Aim: Write scilab code to get the Frequency modulation
Requirements: PC with Scilab software
Program:
A=input('enter the un-modulated carrier signal peak Amplitude')
f1=input('enter the baseband signal frequency')
f2=input('enter the carrier signal frequency')
k= input('enter the frequency Sensitivity')
T=input('enter the duration over which the signal is to be plotted')
fs=input('enter the sampling frequency')
t=0:T/fs:T; //generation of Modulating signal
m=cos(2*%pi*f1*t); //generation of FM signal
M1=A*cos(2*%pi*f2*t+(k*2*%pi*cumsum(m)/fs))
M=diff(M1)
M(find(M<0))=0;
y=T*f2;
z=(length(t)-1)/y;
x=zeros(1,y);
p=x;
for i=1:y
[d n1]=max(M((z*(i-1))+1:i*z))
x(i)=z*(i-1)+n1
p(i)=d
end
enter the un-modulated carrier signal peak Amplitude 1
enter the baseband signal frequency 5
enter the carrier signal frequency 20
enter the frequency Sensitivity 4
enter the duration over which the signal is to be plotted 0.4
enter the sampling frequency 200
-
UpdatedFeb 05, 2020
-
Views4,080
You May Like
MATLAB code for Pulse position modulation
DSB-SC Amplitude Modulation program scilab-code
Single Side Band Suppressed Carrier (SSB - SC) - Modulation Scilab code using hilbert transform
MATLAB code for Pulse width modulation
DSB-SC Demodulation program scilab
MATLAB code for Double side band suppressed carrier