Beruflich Dokumente
Kultur Dokumente
OUTPUT:
QPSK:
clc;
clear all;
close all;
a=1; n=20; t=1/n;
fs=4000;
ts=1/fs;
fcarr=1000;
data=sign(randn(1,n));
st=ones((t/ts),1);
stt=st*data;
sttt=stt(:);
s=sttt>0;
f1 =1:(fs/2);
for i=1:2:fs
if ((s(i)==0)&&(s(i+1)==0))
tx(i)=a*cos((i*2*pi*fcarr/fs)+(pi/2));
tx(i+1)=a*cos((i*2*pi*fcarr/fs)+(pi/2));
else if((s(i)==1)&&(s(i+1)==0))
tx(i)=a*cos((i*2*pi*fcarr/fs)+(pi));
tx(i+1)=a*cos((i*2*pi*fcarr/fs)+(pi));
end
end
end
y=tx;
FFTY=fft(y);
FFTY=FFTY(1:(fs/2));
sp=abs(FFTY);
figure(1);
semilogx(f1,(20*log10(sp)));
legend('QPSK');
xlabel('frequency in hertz');
ylabel('power in db');
grid on;
OUTPUT:
FSK:
clc;
clear all;
close all;
a=1; n=20; t=1/n;
fs=10000;
ts=1/fs;
fcarr=1000;
data=sign(randn(1,n));
st=ones((t/ts),1);
stt=st*data;
sttt=stt(:);
s=sttt>0;
f1 =1:fs/2;
for i=1:fs
if (s(i)==1)
tx(i)=a*cos(i*pi*fcarr/fs);
else
tx(i)=a*cos(i*2*pi*fcarr*4/fs);
end
end
y=tx;
FFTY=fft(y);
FFTY=FFTY(1:(fs/2));
sp=abs(FFTY);
f1=1:fs/2;
semilogx(f1,(20*log10(sp)));
legend('FSK');
xlabel('frequency in hertz');
ylabel('power in db');
grid on;
OUTPUT:
ERROR PERFORMANCE:
clc;
clear all;
eb_no=1:20;
x=sqrt(eb_no);
for i=1:20
bpsk(i)=0.5*erfc(sqrt(10^(eb_no(i)/10)));
qpsk(i)=erfc((sqrt(10^(eb_no(i)/10)))- 1/4*(erfc(sqrt(10^(eb_no(i)/10)))^2));
qam(i)=3/2*(erfc(sqrt(0.2*10^(eb_no(i)/10))));
fsk(i)=0.5*exp(sqrt(10^(0.5*eb_no(i)/10)));
end
semilogy(eb_no,bpsk,eb_no,qpsk,eb_no,qam,eb_no,fsk);
xlabel('freq(hz)');
ylabel('ber');
legend('bpsk','qpsk','qam','fsk');
grid on;
OUTPUT:
OUTPUT:
2. MICROWAVE COMMUNICATION:
clc;
clear all;
close all;
d=input('enter the dia of parabolic dishes:');
R=input('enter the reliability:');
D=input('enter the distance between stations:');
C_n=input('enter the c/n ratio:');
f=input('enter the freq:');
BW=input('enter the noise bw:');
A=input('enter the roughness factor:');
B=input('enter the terrain cond fact:');
C=3*10^8;
At=48; Ar=48; br=3;
Lp=(20*log10((D*4*pi*10^3*f*10^9)/C));
FM=(30*log10(D))+(10*log10)(f*A*B*610^9))-(10*log10(1-R))-(70);
Lb=br*2;
Lf=4.7*2;
N=-173.977+10*log10(BW);
Cmin=C_n+N;
Gs=FM+Lp+Lf+Lb-At-Ar;
Pt=Gs+Cmin;
G=(20*log10((d*pi*f*10^9)/C));
fprintf('\n fade margin :%d',FM);
fprintf('\n antenna gain :%d',G);
fprintf('\n free space path loss :%d',Lp);
fprintf('\n branching loss :%d',Lb);
fprintf('\n feeder loss :%d',Lf);
6
OUTPUT:
disp('---------------------------------------')
EIRP=pt+at-lbo-lbf;
disp('UPLINK BUDGET')
disp('---------------------------------------')
%EIRP (Earth Station)
fprintf('EIRP (Earth Station) = %f dBW \n',EIRP);
c1=EIRP-lp-lu;
%Carrier power density at the satellite antenna :
fprintf('Carrier power density at the satellite antenna = %f dBW\n',c1);
cn0=c1+gte-(10*log10(1.38*(10^(-23))));
fprintf('C/No at the satellite = %f dB\n',cn0);
ebn0=cn0-(10*log10(br));
fprintf('Eb/No : = %f dB\n',ebn0);
cn=ebn0-10*(log10((40*(10^6))/(br)));
fprintf('for a minimum bandwidth system, C/N = %f dB\n',cn);
disp('---------------------------------------')
disp('DOWNLINK BUDGET')
disp('---------------------------------------')
%EIRP (satellite transponder)
EIRP2=pt2+at2-lbo2-lbf2;
fprintf('EIRP (satellite transponder) = %f dBW \n',EIRP2);
c12=EIRP2-lp2-ld;
%Carrier power density at the earth station antenna :
fprintf('Carrier power density at earth station antenna = %f dBW\n',c12);
cn02=c12+gte2-(10*log10(1.38*(10^(-23))));
fprintf('C/No at the earth station receiver = %f dB\n',cn02);
ebn02=cn02-(10*log10(br2));
fprintf('Eb/No : = %f dB\n',ebn02);
cn2=ebn02-10*(log10((40*(10^6))/(br2)));
fprintf('for a minimum bandwidth system, C/N = %f dB\n',cn2);
a=10^(ebn0/10);
b=10^(ebn02/10);
ebn0all=(a*b)/(a+b);
ebn02db=10*log10(ebn0all);
fprintf('Eb/No(overall) : = %f dB\n',ebn02db);
SAMPLE INPUT
ENTER UPLINK PARAMETERS
Earth station Transmitter output power :33
Earth Station back-off loss : 3
Earth station branching and feeder losses :4
Earth station Transmit antenna gain : 64
Additional uplink atmospheric losses : .6
Free-space path loss : 206.5
Satellite receiver G/Te ratio : -5.3
Satellite branching and feeder losses : 0
Bit rate : 120*(10^6)
ENTER DOWNLINK PARAMETERS
Satellite transmitter output power :10
Satellite back-off loss : .1
Satellite branching and feeder losses :.5
Satellite Transmit antenna gain : 30.8
Additional downlink atmospheric losses : .4
Free-space path loss : 205.6
Earth station receiver G/Te ratio : 37.7
Earth station branching and feeder losses : 0
Bit rate : 120*(10^6)
OUTPUT
UPLINK BUDGET
EIRP (Earth Station) = 90.000000 dBW
Carrier power density at the satellite antenna = -117.100000 dBW
C/No at the satellite = 106.201209 dB
Eb/No : = 25.409397 dB
for a minimum bandwidth system, C/N = 30.180609 dB
DOWNLINK BUDGET
EIRP (satellite transponder) = 40.200000 dBW
Carrier power density at earth station antenna = -165.800000 dBW
C/No at the earth station receiver = 100.501209 dB
Eb/No : = 19.709397 dB
for a minimum bandwidth system, C/N = 24.480609 dB
Eb/No(overall) : = 18.674255 Db
10
11
OUTPUT:
subplot(4,1,2);
plot(bpsk_sig);
axis([-100 3100 -1.5 1.5]);
title('BPSK modulated signal:');
t1=(0:2*pi/9:2*pi);
t2=(0:2*pi/19:2*pi);
t3=(0:2*pi/29:2*pi);
t4=(0:2*pi/39:2*pi);
t5=(0:2*pi/59:2*pi);
t6=(0:2*pi/119:2*pi);
c1=cos(t1);
c1=[c1 c1 c1 c1 c1 c1 c1 c1 c1 c1 c1 c1];
c2= cos(t2);
c2=[c2 c2 c2 c2 c2 c2];
c3=cos(t3);
c3=[c3 c3 c3 c3];
c4=cos(t4);
c4=[c4 c4 c4];
c5=cos(t5);
c5=[c5 c5];
c6=cos(t6);
spread_signal=[];
for n=1:25
c=Randint(1,1,[1 6]);
switch(c)
case(1)
spread_signal=[spread_signal c1];
case(2)
spread_signal=[spread_signal c2];
case(3)
spread_signal=[spread_signal c3];
case(4)
spread_signal=[spread_signal c4];
case(5)
spread_signal=[spread_signal c5];
case(6)
spread_signal=[spread_signal c6];
end
end
subplot(4,1,3);
plot((1:3000),spread_signal);
axis([-100 3100 -1.5 1.5]);
title('spread signal with 6 frequency:');
freq_hopped_sig=bpsk_sig.*spread_signal;
subplot(4,1,4);
plot((1:3000),freq_hopped_sig);
axis([-100 3100 -1.5 1.5]);
title('frequency hopped sprad sprectrum signal:');
13
OUTPUT:
disp(couplefact1);
disp('Directivity (dB): ');
disp(direct1);
disp('Insertion Loss (dB): ');
disp(iserloss2);
disp('Isolation Loss (dB): ');
disp(isoloss2);
disp('S-matrix of Directional Coupler: ');
disp(sm2);
disp('MAGIC TEE');
disp('INPUT: ');
Ps15=input('Enter Output Power: ');
p15=Ps15-Ps;
an15=p15/20;
sp15=10^(an15);
Ps16=input('Enter Output Power: ');
p16=Ps16-Ps;
an16=p16/20;
sp16=10^(an16);
Ps17=input('Enter Output Power: ');
p17=Ps17-Ps;
an17=p17/20;
sp17=10^(an17);
Ps18=input('Enter Output Power: ');
p18=Ps18-Ps;
an18=p18/20;
sp18=10^(an18);
Ps19=input('Enter Output Power: ');
p19=Ps19-Ps;
an19=p19/20;
sp19=10^(an19);
Ps20=input('Enter Output Power: ');
p20=Ps20-Ps;
an20=p20/20;
sp20=10^(an20);
Ps21=input('Enter Output Power: ');
p21=Ps21-Ps;
an21=p21/20;
sp21=10^(an21);
Ps22=input('Enter Output Power: ');
p22=Ps22-Ps;
an22=p22/20;
sp22=10^(an22);
Ps23=input('Enter Output Power: ');
p23=Ps23-Ps;
an23=p23/20;
sp23=10^(an23);
Ps24=input('Enter Output Power: ');
p24=Ps24-Ps;
an24=p24/20;
sp24=10^(an24);
Ps25=input('Enter Output Power: ');
p25=Ps25-Ps;
an25=p25/20;
sp25=10^(an25);
16
5.
19
20
21
OUTPUT:
iv)VELOCITY
close all
clear all
pt = 1.e+6; % peak power in Watts
freq = 5.6e+9; % radar operating frequency in Hz
g = 40.0; % antenna gain in dB
sigma = 0.1; % radar cross section in m squared
te =300.0; % effective noise temperature in Kelvins
nf = 5.0; %noise figure in dB
loss = 6.0; % radar losses in dB
range = [75e3,100e3,150e3]; % three range values
snr_db = linspace(5,20,200); % SNR values from 5 dB to 20 dB 200 points
snr = 10.^(0.1.*snr_db); % convert snr into base 10
gain = 10^(0.1*g); %convert antenna gain into base 10
loss = 10^(0.1*loss); % convert losses into base 10
F = 10^(0.1*nf); % convert noise figure into base 10
lambda = 3.e8 / freq; % compute wavelength
% Implement Eq.(1.57)
den = pt * gain * gain * sigma * lambda^2;
num1 = (4*pi)^3 * 1.38e-23 * te * F * loss * range(1)^4 .* snr;
num2 = (4*pi)^3 * 1.38e-23 * te * F * loss * range(2)^4 .* snr;
num3 = (4*pi)^3 * 1.38e-23 * te * F * loss * range(3)^4 .* snr;
tau1 = num1 ./ den ;
tau2 = num2 ./ den;
tau3 = num3 ./ den;
% plot tau versus snr
22
figure(1)
semilogy(snr_db,1e6*tau1,'k',snr_db,1e6*tau2,'k -.',snr_db,1e6*tau3,'k:')
grid
legend('R = 75 Km','R = 100 Km','R = 150 Km')
xlabel ('Minimum required SNR - dB');
ylabel ('\tau (pulse width) in \mu sec');
OUTPUT:
6.
ISDN:
clc;
clear all;
use=input('Enter the no. of users: ');
ts=input('Enter the no. of time slots: ');
on=0.35;
ton=zeros(use,ts);
n=ton;
for i=1:use
for j=1:ts
ton(i,:)=poissrnd((on*10),1,ts);
if (ton(i,j)>=3.5)
n(i,j)=1;
end
end
end
test=randint(use,ts,[1,1000]);
23
data=n;
for i=1:use
for j=1:ts
if n(i,j)==1
if test(i,j)>=1 & test(i,j)<=980
data(i,j)=64000;
elseif test(i,j)>980 & test(i,j)<=990
data(i,j)=128000;
elseif test(i,j)>990 & test(i,j)<=998
data(i,j)=256000;
else
data(i,j)=512000;
end
end
end
end
%timeslot vs bandwidth
d= sum(data);
figure(1);
bar(d);
xlabel('Time slot');
ylabel('Bandwidth(bps)');
%timeslot vs error rate
e=zeros(1,ts);
bm=1540000;
for i=1:ts
if d(i)>bm
e(i)=d(i)-bm;
end
end
figure(2);
bar(e);
xlabel('Timeslot');
ylabel('Error rate (bps)');
avg=sum(e')/ts;
ber=avg/bm;
buff=0;
disp('Average bit error rate without buffering');
disp(ber);
while (ber)>1e-6
buff=buff+10;
bm=bm+10;
for i=1:ts
if e(i)>0
e(i)=d(i)-bm;
end
end
s=sum(e');
ber=s/(ts*bm);
end
disp('Bit error rate with buffer');
disp(ber);
disp('Optimum buffer size');
disp(buff);
24
INPUT
Enter the no. of users: 50
Enter the no. of time slots: 100
OUTPUT
Average bit error rate without buffering
0.0743
Bit error rate with buffer
9.8224e-007
Optimum buffer size
699780
25
end
end
d=sum(n);
figure(2);
bar(t,d);
xlabel('Time Slots');
ylabel('Number of Users');
%Time slots Vs Bandwidth
bw=64000*n;
for i=1:10
figure(3);
subplot(5,2,i);
bar(t,bw(i,:),0.2)
xlabel('Time Slots');
ylabel('BW Alloted');
end
INPUT
Enter the Average ON Time: 0.5
OUTPUT
27
28
bm=bm+10;
for i=1:ts
if e(i)>0
e(i)=d(i)-bm;
end
end
s=sum(e);
ber=s/(ts*bm);
end
disp('Bit Error Rate with Buffer: ');
disp(ber);
disp('Optimum Buffer Size: ');
disp(buff);
INPUT
Enter The Number Of Users: 50
Enter The Number Of Time Slots: 100
OUTPUT
Average Bit Error Rate without Buffering:
0.1004
Bit Error Rate with Buffer:
9.9836e-007
Optimum Buffer Size:
763770
30
31
7.
BANDPASS FILTER:
clc;
alphap=2;
alphas=30;
omegap=[0.2 0.8];
omegas=[0.4 0.6];
[N,Wc]=buttord(omegap,omegas,alphap,alphas);
disp(N);
disp(Wc);
[Nu,De]=butter(N,Wc,'bandpass','s');
disp(Nu);
disp(De);
[Nu1,De1]=bilinear(Nu,De,1);
disp(Nu1);
disp(De1);
[H,W]=freqz(Nu1,De1);
plot(W,abs(H));
axis([0 3.5 0 2]);
title('frequency response of butterworth BPF using bilinear transformation');
xlabel('Normalized frequency');
ylabel('Magnitude|H(z)|');
OUTPUT:
32
OUTPUT:
clc;
alphap=2;
alphas=30;
omegap=0.2;
omegas=0.4;
[N,wc]=cheb1ord(omegap,omegas,alphap,alphas);
disp(N);
disp(wc);
[Nu,De]=cheby1(N,0.1,wc,'s');
disp(Nu);
disp(De);
[Nu1,De1]=bilinear(Nu,De,1);
disp(Nu1);
disp(De1);
[H,w]=freqz(Nu1,De1);
plot(w,abs(H));
title('frequency response of chebyshev LPF using bilinear transformation');
xlabel('Normalized frequency');
ylabel('Magnitude|H(z)|');
OUTPUT:
34