-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemod.m
More file actions
25 lines (22 loc) · 784 Bytes
/
demod.m
File metadata and controls
25 lines (22 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
t1=0;
t2=Tb;
for i=1:N % For each signal element in the modulated (BASK) signal
t=[t1:Tb/100:t2] % the product of the carrier signal level and the corresponding
%correlator % modulated signal level is calculated , and the sum is found
x=sum(c.*ask_sig(i,:)); % If sum > 0 , assign demod=1
%decision device % Else assign demod=0
if x>0 % demod is the demodulated signal obtained from BASK
demod(i)=1;
else
demod(i)=0;
end
t1=t1+(Tb+.01);
t2=t2+(Tb+.01);
end
% Plotting demodulated binary data bits
subplot(5,1,5);
stem(demod);
title('BASK demodulated signal');
xlabel('n');
ylabel('b(n)');
grid on