Program:
clc;
clear all;
n = input('Enter the number of values to be compared = ');
for i = 1:n;
m = 2^i;
r = (3/(m-1))/(2*(sin(pi/m))^2);
rm = 10*log10(r);
if(m==4)
disp('QAM & PSK have comparable performance by = ');
else
disp('SNR of QAM is better than PSK by = ');
end
disp(rm);
end
Output:
Enter the number of values to be compared = 5
SNR of QAM is better than PSK by =
1.7609
QAM & PSK have comparable performance by =
9.6433e-16
SNR of QAM is better than PSK by =
1.6531
SNR of QAM is better than PSK by =
4.1953
SNR of QAM is better than PSK by =
7.0213
clc;
clear all;
n = input('Enter the number of values to be compared = ');
for i = 1:n;
m = 2^i;
r = (3/(m-1))/(2*(sin(pi/m))^2);
rm = 10*log10(r);
if(m==4)
disp('QAM & PSK have comparable performance by = ');
else
disp('SNR of QAM is better than PSK by = ');
end
disp(rm);
end
Output:
Enter the number of values to be compared = 5
SNR of QAM is better than PSK by =
1.7609
QAM & PSK have comparable performance by =
9.6433e-16
SNR of QAM is better than PSK by =
1.6531
SNR of QAM is better than PSK by =
4.1953
SNR of QAM is better than PSK by =
7.0213
No comments:
Post a Comment