Last active 1 month ago

bpsk.m Raw
1clc;
2clear all;
3close all;
4A = 5;
5t = 0:0.001:1;
6F1 = input ('carrier signal frequency');
7F2 = input ('message signal frequency');
8x = A.*sin(2*pi*F1*t);
9u = square(2*pi*F2*t);
10y = x.*u; subplot(3,1,1);
11plot(t,x); xlabel('t');
12ylabel('x(t)');
13title('modulating signal')
14subplot(3,1,2);
15plot(t,u);
16xlabel('t');
17ylabel('u(t)');
18title('carrier signal')
19subplot(3,1,3);
20plot(t,y);
21xlabel('t');
22ylabel('y(t)');
23title('modulated signal')