need the correct code of ASK for Matlab as i need to create GUI to visualize it.
Im new to Matlab as Im trying some codes but it doesnt exactly matches.
how do i add the result for the calculation of bit rate, baudrate and bandwidth on this program?
clear;
clc;
b = input('Enter the Bit stream \n ');
%b = [0 1 0 1 1 1 0];
n = length(b);
t = 0:.01:n;
x = 1:1n+1)*100;
for i = 1:n
for j = i:.1:i+1
bw(x(i*100i+1)*100)) = b(i);
end
end
bw = bw(100:end);
sint = sin(2*pi*t);
st = bw.*sint;
subplot(3,1,1)
plot(t,bw)
grid on ; axis([0 n -2 +2])
subplot(3,1,2)
plot(t,sint)
grid on ; axis([0 n -2 +2])
subplot(3,1,3)
plot(t,st)
grid on ; axis([0 n -2 +2])
I have created a GUI in Matlab and Im unable to implement some codes.?
I have created a GUI in Matlab for Amplitude Shift Keying so that it would prompt the user to input the binary bit stream, then it would be able to produce the modulated graph and the bit rate and baudrate below.
I have done three months research on the codes and it is successful; Unfortunately something went wrong when i programmed into the GUI and Im unable to produce the correct teaching aid in GUI;
Its a simple work but a little confusing, I've done my attempts, a little guidance will be very helpful as my codes are below ;
clear;
clc;
b = input('Enter the Bit stream \n ');
%b = [0 1 0 1 1 1 0];
n = length(b);
t = 0:.01:n;
x = 1:1n+1)*100;
for i = 1:n
for j = i:.1:i+1
bw(x(i*100i+1)*100)) = b(i);
end
end
bw = bw(100:end);
sint = sin(2*pi*t);
st = bw.*sint;
subplot(3,1,1)
plot(t,bw)
grid on ; axis([0 n -2 +2])
subplot(3,1,2)
plot(t,sint)
grid on ; axis([0 n -2 +2])
subplot(3,1,3)
plot(t,st)
grid on ; axis([0 n -2 +2])