Académique Documents
Professionnel Documents
Culture Documents
clearing
close
all %for
closing
clear
all %for
deleting
t=0:.001:1; %
all
the
of
&
c=amp.*sin(2*pi*fc*t);%
window
the
memory
sampling
interval
wave:
frequency
Message
command
from
Carrier Sine
Amplitude(Assuming
Generating
subplot(3,1,1) %For
window
except
variables
Message
Carrier
command
window
the
setting
frequency
fm=input('Enter
the
all
For
fc=input('Enter
amp=input('Enter
the
Both
Carrier
Plotting The
');
');
Equal):');
Sine
Carrier wave
plot(t,c)
xlabel('Time')
ylabel('Amplitude')
title('Carrier')
m=square(2*pi*fm*t);%
subplot(3,1,2)
For
Plotting
Message
signal
plot(t,m)
xlabel('time')
ylabel('ampmplitude')
title('Message
Signal')% Sine
wave multiplied
with
square
wave
in
order
to generate PSK
x=c.*m;
subplot(3,1,3) %
For
Plotting
PSK
(Phase
Shift Keyed)
signal
plot(t,x)
xlabel('t')
ylabel('y')
title('PSK')
NOTE: Use Semicolon ';' in order to suppress the output from coming to the MATLAB's
Command Window, whenever declaring a periodic pulse, as it can display a vary large
matrix in the output, so you can miss what you want.
INPUTS GIVEN TO GENERATE ASK MODULATED WAVE:
Enter
Enter
frequency
Message
of
Carrier Sine
frequency
wave:
:
60
10