Вы находитесь на странице: 1из 4

3.1.

1 Amplitude-Shift Keying
%Generate a 50 bits binary sequence b with the first 5 bits [ 1 0 0 1 0 ].
% Generate the ASK signal sa, with a carrier frequency of 8 kHz.
b = [ 1 0 0 1 0 binary(45)];
fc=8000;
%Carrier frequency
f=[0,20000];
xu= wave_gen(b,'unipolar_nrz');
%Unipolar NRZ signal
sa=mixer(xu,osc(fc));
%ASK signal
Display the first 500 samples of the waveform xu and sa representing the first 5 bits in the binary sequence.
Compare the two waveforms.
figure(1)
waveplot(xu(1:500));
%Plot of Unipolar NRZ signal to 500 samples
title('Unipolar NRZ');
figure(2)
waveplot(sa(1:500));
%Plot of ASK signal to 500 samples
title('ASK signal');
% From the two waveforms it can be seen that the ASK signal has a constant
% amplitude only for the positive value of unipolar nrz.

Display the respective Power Spectral Density (PSD) functions over the frequency interval [0, 20 kHz].
figure(3)
psd_plot(psd(xu,f));
%PSD of Unipolar NRZ signal
title('PSD of Unipolar NRZ signal');
figure(4)
psd_plot(psd(sa,f));
%PSD of ASK signal
title('PSD of ASK signal')
axis([0 20 10^-10 1]);

Published with MATLAB R2014a

Вам также может понравиться