% to generate ssb using phase methood and detection of ssb signal using
% matlab
close all
clear all
clc
fs = 8000;
fm =20;
fc = 50;
Am = 1;
Ac =1;
t=[0:0.1*fs]/fs;
subplot(5,1,1);
m1 = Am * cos(2 * pi * fm * t);
plot(t, m1);
title('Message Signal');
xlabel('Time (s)');
ylabel('Amplitude');
m2 = Am*sin(2*pi*fm*t);
subplot(5,1,2)
c1=Ac*cos(2*pi*fc*t);
plot(t,c1);
title('Carrier Signal');
c2=Ac*sin(2*pi*fc*t);
subplot(5,1,3)
S_usb = 0.5*m1.*c1-0.5*m2.*c2;
plot(t, S_usb);
title('Upper Sideband (USB) Signal');
xlabel('Time (s)');
ylabel('Amplitude');
subplot(5,1,4);
S_lsb = 0.5*m1.*c2 + 0.5*m2.*c1;
plot(t, S_lsb);
title('Lower Sideband (LSB) Signal');
xlabel('Time (s)');
ylabel('Amplitude');
r=S_usb.*c1;
subplot(5,1,5)
[b a] = butter(1,0.0001);
mr=filter(b,a,r);
plot(t,mr);
title('Filtered Signal');
xlabel('Time (s)');
ylabel('Amplitude');
sgtitle('Sujal Singh (04119051723)')
