Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute MATLAB/Octave Online

AM = input("\nEnter the amplitude of modulating signal");
fm = input("\nEnter the frequency of modulating signal");
Tm = 1/fm;
t = 0: Tm/100: 3*Tm;
M = AM * cos(2*pi*fm*t); %Formula for modulating signal
subplot(3, 1, 1);
plot(t, M); %plot message signal
title('Message Signal');
xlabel('Time');
ylabel('Amplitiude');
AC = input("\nEnter the amplitude of carrier signal");
fc = input("\nEnter the frequency of carrier signal");
Tc = 1/fc;
C = AC * cos(2*pi*fc*t); %Formula for carrier signal
subplot(3, 1, 2);
plot(t, C); %plot carrier signal
title('Carrier Signal');
xlabel('Time');
ylabel('Amplitiude');
k = AM / AC; % Formula for Modulation Index
disp("\nThe modulation index is");
disp(k);
%Ampitude Modulated(AM) Signal
AM_signal = AC * [ 1 + ( k.*cos(2*pi*fm*t ))].* cos( 2*pi*fc*t );  %Formulfor AmplitudeModulated(AM) signal
subplot(3, 1, 3);
plot(t, AM_signal); %plot AM signal
title('AM Signal');
xlabel('Time');
ylabel('Amplitiude');

print -dpng figure.png

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.