Sie sind auf Seite 1von 1

clear all;

clc;
close all;
fm=input('enter the signal frequency=');
fc=input('enter the carrier frequency=');
Mi=input('enter the modulation index=');
fs=10*fc;
t=0:1/fs:1;
Fdev=(Mi*fm);
Sm=cos(2*pi*fm*t);
subplot(4,1,1);
plot(t,Sm);
xlabel('Time');
ylabel('Amplitude');
title('Message Signal');
grid on;
Sc=cos(2*pi*fc*t);
subplot(4,1,2);
plot(t,Sc);
xlabel('Time');
ylabel('Amplitude');
title('Carrier Signal');
grid on;
S_Mod=cos((2*pi*fc*t)+(Mi.*(sin(2*pi*fm*t))));
subplot(4,1,3);
plot(t,S_Mod);
xlabel('Time');
ylabel('Amplitude');
title('Modulated Signal');
grid on;
S_Dem = fmdemod(S_Mod,fc,fs,Fdev);
subplot(4,1,4);
plot(t,S_Dem);
xlabel('Time');
ylabel('Amplitude');
figure(2);
plot(t,Sm,'r',t,S_Mod,'b');

Das könnte Ihnen auch gefallen