Aim:

1. To generate a amplitude shift keyed signal with different message signal and carrier
signal frequencies.
2. 2.To plot the constellation diagram and power spectral density for generated ASK signal.
3. 3.To measure and plot the bit error rate performance of ASK signal.

Program:
clc;
clear all;
close all;
f=200;
fs=1500;
Ts=1/fs;
t=0:10^-4:5/f;
x1=sin(2*pi*f*t);
subplot(421);
plot(t,x1);
xlabel('time');

Algorithm:
1. Clear command window
2. Clear all variables in workspace window
3. Close all the files in current folder window
4. Generate the sinusoidal expression (sig1) with frequency (f) to 200/300/400/500/600 Hz
and time (t) from 0 to 10/f in interval of 10−4 sec
5. Generate the expression for sampled signal (sig) with time (t2) from 0 to 10/f in interval
of sampling frequency (Fs) of 2500/3500/4500/5500/6500 Hz
6. Plot the original signal (sig1) Vs t, sampled signal (sig) Vs t2, title as “Original sinusoidal
signal”, “sampled signal”, label on x-axis & y-axis
7. Determine maximum (Vh) and minimum (Vl) of sampled signal (sig)
8. Determine the no.of bits per sample (N) and code words to represent (M=2N) and also
step size (S)
9. Determine the no.of intervals (partition), possibly M-1
10. Determine the no.of entries in each interval (codebook), possibly M
11. Perform the quantization process of the sampled signal, determine the quantization
levels (index) and quantized values (quantized_sig)
12. Plot the quantized values (quantized_sig) Vs time (t2), title as “Quantized signal”, label
on x-axis & y-axis
13. Convert the quantization levels (index) from decimal to binary to (codesig) and
transpose it
14. Determine the time duration for PCM encoded signal (tt) possibly from 0 to N*(length of
sampled signal time duration t2) -1
15. Plot the PCM encoded signal (codesig) using stairs command Vs time duration for PCM
encoded signal (tt), title as “PCM Encoded signal”, label on x-axis & y-axis
16. Reconstruct the original signal (rxbits) from PCM encoded signal (codesig), N, no.of
elements in sampled signal (sig) and transpose the vector
17. Convert the reconstructed signal (rxbits) from binary to decimal to index1
18. Modify the amplitude of the reconstructed signal by the expression S*index1+Vl+(S/2) to
index2
19. Plot the reconstructed signal index2 Vs sampled signal time duration t2, title as
“Reconstructed signal”, label on x-axis & y-axis.
20. Create a forloop and initialize the bandwidth’bw’ of the signal.
21. Create a signal ‘ASK Signal’ by mixing the bw and sinusoidal message input.
22. Plot the ASK signal and give title.
23. Calculate the number of bits transmitted by ASK signal from its length.
24. Initialize the SNR value from 10 to 20.
25. List the command AWGN in order to perform the step y=awgn(complex(asksig),
SNRdB(k)).
26. Now create an another for loop and initialize a variable C in order to find the errors.
27. calculate error= error/number_bits.
28. End the for loop.
29. Using the semilogy command, calculate the square root of SNR (dB) value.
30. Plot the curve for bit error rate (BER).
31. Now using the ‘lim’ command find the real and imaginary part of the system.
32. Plot the ASK constellation diagram.
33. Now by plotting real part on X-axis and imaginary part on Y-axis, plot the power spectral
density of system using ‘pwelch’ command.