fc = input('Enter the carrier signal frequency in hz, fc='); fm = input('Enter the modulating signal frequency in hz, fm='); m=input('Modulation index, m='); t = 0:0.0001:0.1; c=cos(2*pi*fc*t); %carrier signal M=sin(2*pi*fm*t); %modulating signal
fm = input('Enter the value of message signal frequency: '); fc = input('Enter the value of carrier signal frequency: '); Am = input('Enter the value of message signal amplitude: '); Ac = input('Enter the value of carrier signal amplitude: ');
Pratham_Dave says:
clc;
close all;
clear all;
fc = input('Enter the carrier signal frequency in hz, fc=');
fm = input('Enter the modulating signal frequency in hz, fm=');
m=input('Modulation index, m=');
t = 0:0.0001:0.1;
c=cos(2*pi*fc*t); %carrier signal
M=sin(2*pi*fm*t); %modulating signal
subplot(3,1,1);plot(t,c);
ylabel('Amplitude');xlabel('time index');title('Carrier Signal');
subplot(3,1,2);plot(t,M);
ylabel('Amplitude');xlabel('time index');title('Modulating Signal');
y=cos(2*pi*fc*t-(m.*cos(2*pi*fm*t)));
subplot(3,1,3);plot(t,y);
ylabel('Amplitude');xlabel('time index');title('Frequency Modulated Signal');
Pratham_Dave says:
clear all;
close all;
fc=input('Enter the carrier signal freq in hz,fc=');
fm=input('Enter the modulating signal freq in hz,fm=');
m=input('Modualtion index,m= ');
t=0:0.0001:0.1;
c=cos(2*pi*fc*t);%carrier signal
M=sin(2*pi*fm*t);%modulating signal
subplot(3,1,1);
plot(t,c);
ylabel('amplitude');
xlabel('time index');
title('Carrier signal');
subplot(3,1,2);plot(t,M);
ylabel('amplitude');
xlabel('time index');
title('Modulating signal');
y=cos(2*pi*fc*t-(m.*cos(2*pi*fm*t)));
subplot(3,1,3);
plot(t,y);
ylabel('amplitude');
xlabel('time index');
title('Frequency Modulated signal');
fs=10000;
p=fmdemod(y,fc,fs,(fc-fm));
figure;
subplot(1,1,1);
plot(p);
axis([0 1000 -1 1]);
Pratham_Dave says:
clear all;
clc;
fm = input('Enter the value of message signal frequency: ');
fc = input('Enter the value of carrier signal frequency: ');
Am = input('Enter the value of message signal amplitude: ');
Ac = input('Enter the value of carrier signal amplitude: ');
Tm = 1/fm;
Tc = 1/fc;
t1 = 0:Tm/999:6*Tm;
message_signal = Am*sin(2*pi*fm*t1);
subplot(3,1,1)
plot(t1, message_signal, 'r');
grid();
title('Message signal');
carrier_signal = Ac*sin(2*pi*fc*t1);
subplot(3,1,2)
plot(t1, carrier_signal, 'b');
grid();
title('Carrier signal');
amplitude = message_signal.*carrier_signal;
subplot(3,1,3)
plot(t1, amplitude, 'g');
grid();
title('DSBSC');
Pratham_Dave says:
fH = 15;
fL = 2;
Ah=5;
Al=10;
xH = Ah*sin(2*pi*fH.*t);
xL = Al*sin(2*pi*fL.*t);
%modulation
y = xL.*xH;
% De-Modulation By Synchoronous Method
m = (y.*xH)./(Ah*Ah);
%Filtering High Frequencies\
[n,w] = buttord(2/1000,4/1000,.5,5);
[a,b] = butter(n,w,'low');
dem = filter(a,b,m);
subplot(2,2,1);
plot(t,xH, 'b',t,xL,'r');
title('m(t) & c(t)');
grid;
subplot(2,2,2);
plot(t,y,'k');
title('DSBSC');
grid;
subplot(2,2,3);
plot(t,m);
title('De-Modulated');
grid;
subplot(2,2,4);
plot(t,dem);
title('De-Modulated output');
grid;