DC LAB
DC LAB
%Sampling Frequency
FS = 1000;
TS = 1/FS;
t = 0:TS:2-TS;
%Message Signal
F0 = 1;
msg = sin(2*pi*F0*t);
%Pulse Carrier
FC = 20*F0;
dutycycle = 50;
pulse = square(2*pi*FC*t, dutycycle);
pulse(pulse<0) = 0;
figure(1);
plot(t, msg, 'r', 'LineWidth', 2);
xlabel('time');
ylabel('amplitude');
title('Message Signal', date);
axis([0 2 -1.05 1.05]);
grid on;
figure(2);
plot(t, pulse, 'b', 'LineWidth', 2);
xlabel('time');
ylabel('amplitude');
title('Pulse Carrier Signal', date);
axis([0 2 0 1.05]);
grid on;
figure(3);
plot(t, Natural_PAM, 'k', 'LineWidth', 2);
xlabel('time');
ylabel('amplitude');
title('Natural Sampled PAM Signal', date);
axis([0 2 -1.05 1.05]);
grid on;
figure(4);
subplot(3,1,1);
plot(t, msg, 'r', 'LineWidth', 2);
xlabel('time');
ylabel('amplitude');
title('Message Signal', date);
axis([0 2 -1.05 1.05]);
grid on;
subplot(3,1,2);
plot(t, pulse, 'b', 'LineWidth', 2);
xlabel('time');
ylabel('amplitude');
title('Pulse Carrier Signal', date);
axis([0 2 0 1.05]);
grid on;
subplot(3,1,3);
plot(t, Natural_PAM, 'k', 'LineWidth', 2);
xlabel('time');
ylabel('amplitude');
title('Natural Sampling', date);
axis([0 2 -1.05 1.05]);
grid on;
figure(5);
plot(t, msg, 'r--', 'LineWidth', 2);
hold on;
plot(t, 2*demod_Natural_PAM, 'cy', 'LineWidth', 2);
%hold on;
%plot(t, Lowpass_PAM, 'm', 'LineWidth', 2);
%hold off;
xlabel('time');
ylabel('amplitude');
title('Demodulated PAM Signal', date);
axis([0 2 -1.05 1.05]);
legend('Message Signal', 'Demodulated PAM Signal');
%legend('Message Signal', 'Demodulated PAM Signal', 'Low Pass Filtered');
grid on;
figure(6);
plot(t, Flat_top_PAM, 'r', 'LineWidth', 2);
xlabel('time');
ylabel('amplitude');
title('Flat-top PAM Signal', date);
axis([0 2 -1.05 1.05]);
grid on;
figure(7);
plot(t, msg, 'r--', 'LineWidth', 2);
hold on;
plot(t, 2*demod_Flat_top_PAM, 'cy', 'LineWidth', 2);
hold on;
%plot(t, Lowpass_Flat_top_PAM, 'm', 'LineWidth', 2);
%hold off;
xlabel('time');
ylabel('amplitude');
title('Demodulated Flat-top PAM Signal', date);
axis([0 2 -1.05 1.05]);
legend('Message Signal', 'Demodulated Flat-top PAM Signal');
%legend('Message Signal', 'Demodulated Flat-top PAM Signal', 'Low Pass Filtered');
grid on;
figure(8);
subplot(4,2,[1,2]);
plot(t, msg, 'r', 'LineWidth', 2);
xlabel('time');
ylabel('amplitude');
title('Message Signal', date);
axis([0 2 -1.05 1.05]);
grid on;
subplot(4,2,[3,4]);
plot(t, pulse, 'b', 'LineWidth', 2);
xlabel('time');
ylabel('amplitude');
title('Pulse Carrier Signal', date);
axis([0 2 0 1.05]);
grid on;
subplot(4,2,5);
plot(t, Natural_PAM, 'k', 'LineWidth', 2);
xlabel('time');
ylabel('amplitude');
title('Natural Sampled PAM Signal', date);
axis([0 2 -1.05 1.05]);
grid on;
subplot(4,2,6);
plot(t, msg, 'r--', 'LineWidth', 2);
hold on;
plot(t, 2*demod_Natural_PAM, 'cy', 'LineWidth', 2);
%hold on;
%plot(t, Lowpass_PAM, 'm', 'LineWidth', 2);
%hold off;
xlabel('time');
ylabel('amplitude');
title('Demodulated PAM Signal', date);
axis([0 2 -1.05 1.05]);
legend('Message Signal', 'Demodulated PAM Signal');
%legend('Message Signal', 'Demodulated PAM Signal', 'Low Pass Filtered');
grid on;
subplot(4,2,7);
plot(t, Flat_top_PAM, 'r', 'LineWidth', 2);
xlabel('time');
ylabel('amplitude');
title('Flat-top PAM Signal', date);
axis([0 2 -1.05 1.05]);
grid on;
subplot(4,2,8);
plot(t, msg, 'r--', 'LineWidth', 2);
hold on;
plot(t, 2*demod_Flat_top_PAM, 'cy', 'LineWidth', 2);
hold on;
%plot(t, Lowpass_Flat_top_PAM, 'm', 'LineWidth', 2);
%hold off;
xlabel('time');
ylabel('amplitude');
title('Demodulated Flat-top PAM Signal', date);
axis([0 2 -1.05 1.05]);
legend('Message Signal', 'Demodulated Flat-top PAM Signal');
%legend('Message Signal', 'Demodulated Flat-top PAM Signal', 'Low Pass Filtered');
grid on;
clc;
clear all;
close all;
FS = 1000;%Sampling Frequency
TS = 1/FS;
t = 0:TS:2-TS;
sample_factor = 20;
tn = downsample(t,sample_factor);
sampled_msg = downsample(msg,sample_factor);
%Quantization
n = 4;%no. of bits for quantization
L = 2^n;%no. of levels
Vmax = max(msg);
Vmin = min(msg);
del = (Vmax-Vmin)/L;
partions = Vmin+del:del:Vmax-del;%Defining the levels
approx_val = Vmin+(del/2):del:Vmax-(del/2);%Defining the quantized values in the
% respective levels
[index, quant_vals] = quantiz(msg, partions, approx_val);%index and quantized values
%PCM Decoding
[decoded_data] = PCM_dec(coded_data,n);
figure(1);
plot(t, msg, 'r', 'LineWidth', 2);
xlabel('Time');
ylabel('Amplitude');
title('Message Signal');
axis([0 2 -1.05 1.05]);
grid on;
figure(2);
stem(tn, sampled_msg, 'b', 'filled', 'LineWidth', 2);
hold on;
plot(t, msg, 'r--', 'LineWidth', 2);
xlabel('Time');
ylabel('Amplitude');
title('Sampled Message Signal');
legend('Sampled Signal','Original Message Signal');
axis([0 2 -1.05 1.05]);
grid on;
figure(3);
stem(tn, sampled_msg, 'b', 'filled', 'LineWidth', 1);
hold on;
stairs(t, quant_vals, 'r', 'LineWidth', 2);
xlabel('Time');
ylabel('Amplitude');
title('Quantized Sequence');
%legend('Sampled Signal', 'Quantized Signal','Fontsize', 14);
axis([0 2 -1.05 1.05]);
grid on;
figure(4);
stairs(coded_data, 'k', 'LineWidth', 2);
xlabel('Time');
ylabel('Amplitude');
title('Encoded data');
axis([0 700 -0.05 1.05]);
grid on;
figure(5);
plot(t, decoded_data, 'b', 'LineWidth', 2);
hold on;
xlabel('Time');
ylabel('Amplitude');
title('Decoded Signal');
axis([0 2 0 15]);
grid on;
figure(6);
plot(t, dequant_vals, 'b', 'LineWidth', 2);
hold on;
plot(t, msg, 'r--', 'LineWidth', 2);
xlabel('Time');
ylabel('Amplitude');
title('Dequantization');
legend('Dequantized Signal', 'Original Message Signal');
axis([0 2 -1.05 1.05]);
grid on;
figure(7);
plot(t, reconst_signal, 'b', 'LineWidth', 2);
hold on;
plot(t, msg, 'r--', 'LineWidth', 2);
xlabel('Time');
ylabel('Amplitude');
title('Dequantization');
legend('Reconstructed Signal', 'Original Message Signal');
axis([0 2 -1.05 1.05]);
grid on;
clc;
clear all;
close all;
FS = 1000;
TS = 1/FS;
t= 0:TS:2-TS;
Am = 8;
Fm = 1;
%msg = Am*sin(2*pi*Fm*t);
msg = Am*exp(-2*t).*cos(2*pi*Fm*t);
n = 4;
L = 2^n;
Vmax = max(msg);
Vmin = min(msg);
del = (Vmax-Vmin)/L;
partition_boundaries = Vmin+del:del:Vmax-del;
approx_vals = Vmin+(del/2):del:Vmax-(del/2);
dequant_data = Vmin+(del/2)+(decoded_data*del);
mu = 255;
norm_msg = msg./Vmax;
abs_norm_msg = abs(norm_msg);
abs_msg = abs(msg);
%comp_samples = sign(norm_msg).*(log(1+(mu*abs_norm_msg))/log(1+mu));
%comp_samples = sign(msg).*(log(1+(mu*abs_norm_msg))/log(1+mu));
if (-1 <= msg) & (msg <= 1)
comp_samples = sign(msg).*(log(1+(mu*abs_msg))/log(1+mu));
else
comp_samples = msg;
end
comp_Vmax = max(comp_samples);
comp_Vmin = min(comp_samples);
comp_del = (comp_Vmax-comp_Vmin)/L;
comp_partition_boundaries = comp_Vmin+comp_del:comp_del:comp_Vmax-comp_del;
comp_approx_vals = comp_Vmin+(comp_del/2):comp_del:comp_Vmax-(comp_del/2);
comp_dequant_data = comp_Vmin+(comp_del/2)+(comp_decoded_data*comp_del);
max_comp_dequant_data = max(comp_dequant_data);
norm_comp_dequant_data = comp_dequant_data./max_comp_dequant_data;
abs_norm_dequant_vals = abs(norm_comp_dequant_data);
%expand_vals = sign(norm_comp_dequant_data).*((((1+mu).^(abs_norm_dequant_vals))-1)/mu);
%expand_vals = sign(comp_dequant_data).*((((1+mu).^(abs_norm_dequant_vals))-1)/mu);
if (-1 <= comp_dequant_data) & (comp_dequant_data <= 1)
expand_vals = sign(comp_dequant_data).*((((1+mu).^(abs(comp_dequant_data)))-1)/mu);
else
expand_vals = comp_dequant_data;
end
comp_reconst_msg = signal_lpf(Fm, FS, expand_vals);
figure(1);
plot(t, msg, 'r', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Original Message Signal');
%axis([0 2 -1.05 1.05]);
grid on;
figure(2);
stem(sampled_time, sampled_msg, 'b', 'filled', 'LineWidth', 2);
hold on;
plot(t, msg, 'r--', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Sampled Signal vs Original Message Signal');
legend('Sampled Signal', 'Original Message Signal');
%axis([0 2 -1.05 1.05]);
grid on;
figure(3);
plot(t, msg, 'r', 'LineWidth', 2);
hold on;
plot(t, comp_samples, 'b', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Compressed Samples vs Original Message Signal');
%axis([0 2 -1.05 1.05]);
grid on;
figure(4);
plot(t, msg, 'r--', 'LineWidth', 2);
hold on;
stairs(t, comp_qunat_vals, 'm', 'LineWidth', 2);
hold on;
stairs(t, qunat_vals, 'b', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Original Message Signal vs Compressed Quantized Signal vs Original Quantized Signal');
legend('Sampled Signal', 'Compressed Quantized Signal', 'Original Quantized Signal');
%axis([0 2 -1.05 1.05]);
grid on;
figure(5);
stairs(comp_coded_data, 'k', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Coded Data');
%axis([0 700 -0.05 1.05]);
grid on;
figure(6);
plot(t, comp_decoded_data, 'r', 'LineWidth', 2);
hold on;
plot(t, decoded_data, 'g', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Compressed Decoded Data vs Original Decoded Data');
legend('Compressed Decoded Data', 'Original Decoded Data');
%axis([0 2 -1.05 1.05]);
grid on;
figure(7);
plot(t, comp_dequant_data, 'r', 'LineWidth', 2);
hold on;
plot(t, dequant_data, 'g', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Dequnatized Data');
legend('Compressed Dequnatized Data', 'Original Dequnatized Data');
%axis([0 2 -1.05 1.05]);
grid on;
figure(8);
plot(t, msg, 'r--', 'LineWidth', 2);
hold on;
plot(t, comp_reconst_msg, 'k', 'LineWidth', 2);
hold on;
plot(t, reconst_msg, 'g', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Reconstructed Message vs Original Message Signal');
legend('Original Message Signal', 'Compressed Reconbstructed Signal', 'Original Reconbstructed
Signal')
%axis([0 2 -1.05 1.05]);
grid on;
clc;
clear all;
close all;
FS = 1000;
TS = 1/FS;
t= 0:TS:2-TS;
Am = 8;
Fm = 1;
%msg = Am*sin(2*pi*Fm*t);
msg = Am*exp(-2*t).*cos(2*pi*Fm*t);
n = 4;
L = 2^n;
Vmax = max(msg);
Vmin = min(msg);
del = (Vmax-Vmin)/L;
partition_boundaries = Vmin+del:del:Vmax-del;
approx_vals = Vmin+(del/2):del:Vmax-(del/2);
dequant_data = Vmin+(del/2)+(decoded_data*del);
A = 87.56;
abs_msg = abs(msg);
if abs_msg < (1/A)
abs_comp_samples = (A*abs_msg)/(1+log(A));
comp_samples = sign(msg).*abs_comp_samples;
elseif ((1/A) <= abs_msg) & (abs_msg <= 1)
abs_comp_samples = (1+log(A*abs_msg))/(1+log(A));
comp_samples = sign(msg).*abs_comp_samples;
else
comp_samples = msg;
end
comp_Vmax = max(comp_samples);
comp_Vmin = min(comp_samples);
comp_del = (comp_Vmax-comp_Vmin)/L;
comp_partition_boundaries = comp_Vmin+comp_del:comp_del:comp_Vmax-comp_del;
comp_approx_vals = comp_Vmin+(comp_del/2):comp_del:comp_Vmax-(comp_del/2);
comp_dequant_data = comp_Vmin+(comp_del/2)+(comp_decoded_data*comp_del);
abs_comp_dequant_data = abs(comp_dequant_data);
if abs_comp_dequant_data < (1/(1+log(A)))
expand_vals_temp = (abs_comp_dequant_data.*(1+log(A)))/(A);
expand_vals = sign(comp_dequant_data).*expand_vals_temp;
elseif ((1/(1+log(A))) <= abs_comp_dequant_data) & (abs_comp_dequant_data < 1)
expand_vals_temp = exp(-1+(abs_comp_dequant_data.*(1+log(A))))/(A);
expand_vals = sign(comp_dequant_data).*expand_vals_temp;
else
expand_vals = comp_dequant_data;
end
figure(1);
plot(t, msg, 'r', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Original Message Signal');
%axis([0 2 -1.05 1.05]);
grid on;
figure(2);
stem(sampled_time, sampled_msg, 'b', 'filled', 'LineWidth', 2);
hold on;
plot(t, msg, 'r--', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Sampled Signal vs Original Message Signal');
legend('Sampled Signal', 'Original Message Signal');
%axis([0 2 -1.05 1.05]);
grid on;
figure(3);
plot(t, msg, 'r', 'LineWidth', 2);
hold on;
plot(t, comp_samples, 'b', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Compressed Samples vs Original Message Signal');
%axis([0 2 -1.05 1.05]);
grid on;
figure(4);
plot(t, msg, 'r--', 'LineWidth', 2);
hold on;
stairs(t, comp_qunat_vals, 'm', 'LineWidth', 2);
hold on;
stairs(t, qunat_vals, 'b', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Original Message Signal vs Compressed Quantized Signal vs Original Quantized Signal');
legend('Sampled Signal', 'Compressed Quantized Signal', 'Original Quantized Signal');
%axis([0 2 -1.05 1.05]);
grid on;
figure(5);
stairs(comp_coded_data, 'k', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Coded Data');
%axis([0 700 -0.05 1.05]);
grid on;
figure(6);
plot(t, comp_decoded_data, 'r', 'LineWidth', 2);
hold on;
plot(t, decoded_data, 'g', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Compressed Decoded Data vs Original Decoded Data');
legend('Compressed Decoded Data', 'Original Decoded Data');
%axis([0 2 -1.05 1.05]);
grid on;
figure(7);
plot(t, comp_dequant_data, 'r', 'LineWidth', 2);
hold on;
plot(t, dequant_data, 'g', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Dequnatized Data');
legend('Compressed Dequnatized Data', 'Original Dequnatized Data');
%axis([0 2 -1.05 1.05]);
grid on;
figure(8);
plot(t, msg, 'r--', 'LineWidth', 2);
hold on;
plot(t, comp_reconst_msg, 'k', 'LineWidth', 2);
hold on;
plot(t, reconst_msg, 'g', 'LineWidth', 2);
xlabel('Time-->');
ylabel('Amplitude -->');
title('Reconstructed Message vs Original Message Signal');
legend('Original Message Signal', 'Compressed Reconbstructed Signal', 'Original Reconbstructed
Signal')
%axis([0 2 -1.05 1.05]);
grid on;
clc;
clear all;
close all;
%% Delat Modulation
mod_pred_input = zeros(1,length(sampled_msg));
error = zeros(1,length(sampled_msg));
quantiz_err = zeros(1,length(sampled_msg));
DM_enc_sequence = zeros(1,length(sampled_msg));
del = (Am)*2*pi*Fm*sample_factor*Ts;
%del = 0.15;
error(1) = sampled_msg(1);
DM_enc_sequence(1) = 0;
for i = 2:length(sampled_msg)
error(i) = sampled_msg(i)-mod_pred_input(i-1);
quantiz_err(i) = del*sign(error(i));
mod_pred_input(i) = mod_pred_input(i-1)+quantiz_err(i);
DM_enc_sequence(i) = (sign(quantiz_err(i))+1)/2;
end
%DM_enc_sequence(2:end) = (sign(quantiz_err(2:end))+1)/2;
%%
%% Delat Demodulation
DM_dec_sequence = zeros(1,length(sampled_msg));
dequantiz_err = zeros(1,length(sampled_msg));
demod_pred_input = zeros(1,length(sampled_msg));
DM_dec_sequence(1) = DM_enc_sequence(1);
demod_pred_input(1) = del*sign(DM_dec_sequence(1));
for i = 2:length(sampled_msg)
DM_dec_sequence(i) = DM_enc_sequence(i);
dequantiz_err(i) = del*(2*DM_dec_sequence(i)-1);
%% Message Reconstruction
cutoff_freq = Fm;%Cutoff frequency is same as Message Signal Frequency
reconst_msg = signal_lpf(cutoff_freq,Fs/sample_factor,demod_pred_input);
%%
%% SQNR
signal_power = mean(sampled_msg.^2);
noise_power = (del^2)/3;
SQNR_linear = signal_power/noise_power;
SQNR_dB = 10*log10(SQNR_linear);
%%
figure(1);
plot(t,msg,'r','LineWidth',2);
xlabel('Time-->');
ylabel('Amplitude-->');
title('Message Signal');
grid on;
figure(2);
stem(tn,sampled_msg,'r--','LineWidth',2);
hold on;
stairs(tn,mod_pred_input,'b','LineWidth',2);
xlabel('Time-->');
ylabel('Amplitude-->');
title('Sampled Message Signal vs Approximated Signal');
legend('Sampled Message Signal', 'Approximated Signal');
grid on;
figure(3);
%stairs(t,DM_enc_sequence,'b','LineWidth',2);
stairs(DM_enc_sequence,'b','LineWidth',2);
xlabel('Time-->');
ylabel('Amplitude-->');
title('Delta Modulation Encoded Sequence');
axis([0 100 -0.1 1.1]);
grid on;
figure(4);
stairs(DM_dec_sequence,'b','LineWidth',2);
xlabel('Time-->');
ylabel('Amplitude-->');
title('Delta Modulation Decoded Sequence');
axis([0 100 -0.1 1.1]);
grid on;
figure(5);
plot(tn,sampled_msg,'r--','LineWidth',2);
hold on;
stairs(tn,demod_pred_input,'b','LineWidth',2);
xlabel('Time-->');
ylabel('Amplitude-->');
title('Predicted Signal at RXer');
legend('Sampled Message Signal', 'Predicted Signal at RXer');
grid on;
figure(6);
plot(t,msg,'r--','LineWidth',2);
hold on;
plot(tn,reconst_msg,'b','LineWidth',2);
xlabel('Time-->');
ylabel('Amplitude-->');
title('Message Signal vs Reconstructed Signal');
legend('Original Message Signal', 'Reconstructed Signal');
axis([0 2 -1.1 1.1]);
grid on;
clc;
clear all;
close all;
figure(1);
stairs(unipolar_data, 'r', 'LineWidth', 2);
title('Unipolar Random Bits');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([0 50 -0.1 1.1]);% selected only 50 to visualize the data
grid on;
figure(2);
stairs(bipolar_data, 'b', 'LineWidth', 2);
title('Bipolar Random Bits');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([0 50 -1.1 1.1]);% selected only 50 to visualize the data
grid on;
figure(3);
stairs(converted_bipolar_data, 'k', 'LineWidth', 2);
title('Unipolar to Bipolar Converted Bits');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([0 50 -1.1 1.1]);% selected only 50 to visualize the data
grid on;
figure(4);
stairs(converted_unipolar_data, 'm', 'LineWidth', 2);
title('Bipolar to Unipolar Converted Bits');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([0 50 -0.1 1.1]);% selected only 50 to visualize the data
grid on;
figure(5);
stairs(upsampled_bipolar_data, 'g', 'LineWidth', 2);
title('Upsampled Bipolar data');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([0 1600 -1.1 1.1]);% selected only 1600 to visualize the data
grid on;
figure(6);
stairs(nrz, 'cy', 'LineWidth', 2);
title('NRZ Pulse');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([1 upsample_factor -0.1 1.1]);
grid on;
figure(7);
stairs(nrz_polar, 'r', 'LineWidth', 2);
title('Pulse shaped NRZ');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([0 1600 -1.1 1.1]);
grid on;
figure(8);
stairs(rz, 'b', 'LineWidth', 2);
title('RZ Pulse');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([1 upsample_factor -0.1 1.1]);
grid on;
figure(9);
stairs(rz_polar1, 'b', 'LineWidth', 2);
title('RZ Polar Pulse');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([1 1600 -1.1 1.1]);
grid on;
figure(10);
plot(half_sinusoid, 'b', 'LineWidth', 2);
title('Half Sinusoid Pulse');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([1 upsample_factor -0.1 1.1]);
grid on;
figure(11);
plot(half_sinusoid_polar, 'b', 'LineWidth', 2);
title('Half Sinusoid Polar Waveform');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([1 1600 -1.1 1.1]);
grid on;
figure(12);
plot(rcos, 'b', 'LineWidth', 2);
title('Raised Cosine Pulse');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([1 length(rcos) -0.15 1.05]);
grid on;
figure(13);
plot(rcos_train, 'b', 'LineWidth', 2);
title('Raised Cosine Pulse Train');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([1 1600 -1.5 1.5]);
grid on;
figure(14);
plot(rrcos, 'b', 'LineWidth', 2);
title('Root-Raised Cosine Pulse');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([1 length(rrcos) -0.15 1.05]);
grid on;
figure(15);
plot(rrcos_train1, 'b', 'LineWidth', 2);
hold on
plot(rrcos_train2, 'k', 'LineWidth', 2);
hold on
title('Root-Raised Cosine Pulse Train');
xlabel('Time-->');
ylabel('Amplitude-->');
axis([1 1600 -1.5 1.5]);
grid on;
figure(16);
stairs(rz_polar2, 'b', 'LineWidth', 2);
title('RZ Polar Pulse');
xlabel('Time-->');
ylabel('Amplitude-->');
%axis([1 50 -5 5]);
grid on;