Last active 1 month ago

phase_shift_keying.m Raw
1clc;
2clear all;
3A=5;
4t=0:0.001:1;
5f1=input("Carrier signal frequency: ");
6f2=input("Message signal frequency: ");
7
8x1 = A*sin(2*pi*f1*t);
9u = square(2*pi*f2*t);
10
11y = x1 .* u;
12
13subplot(3, 1, 1);
14plot(t, x1);
15title("Carrier Signal");
16xlabel("Time");
17ylabel("Amplitude");
18
19
20subplot(3, 1, 2);
21plot(t, u);
22title("Message Signal");
23xlabel("Time");
24ylabel("Amplitude");
25
26
27subplot(3, 1, 3);
28plot(t, y);
29title("PSK Signal");
30xlabel("Time");
31ylabel("Amplitude");