Binary signal modulation ?

4 次查看(过去 30 天)
Biro Darius
Biro Darius 2018-10-26
Hello guys. I have to modulate a random binary signal such that I obtain the ASK, BFSK and BPSK signals. I should have all the signal representations from the image below.
I have the following code until now, but it doesn't work properly at the ASK step and maybe someone can give me suggestions about BPSK and BFSK steps:
clear all;
Fs = 100000; %Sampling freq
Fc1=5000; % Carrier freq
D=5000;
data = randint(200,1,2); % Random sequence
t = (0:1/Fs:0.02-1/Fs)';
x=zeros(1,2000);
datai=zeros(200,1);
datap=zeros(100,1);
c1=sin(2*pi*Fc1*t);
c2=sin(2*pi*Fc2*t+pi);
for j=1:100
if mod(j,2) ~= 0
datai(j)=data(j);
else
datai(j)=data(j-1);
end
end
for i=1:2000
idx=fix((i-1)/20)+1;
x(i) = data(idx);
end
ask = c1.*x(i);
figure(1);
subplot(5,1,1);
plot(t,x);
axis([0 0.002 0 1.2]);
title('Binary signal');
subplot(5,1,2);
plot(t,c1);
axis([0 0.002 -1.2 1.2]);
title('Carrier 1');
subplot(5,1,3);
plot(t,ask);
axis([0 0.002 -1.2 1.2]);

回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by