Sie sind auf Seite 1von 6

RAGHU INSTITUTE OF TECHNOLOGY

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING


MATLAB PROGRAMS

SUB: MICROWAVE ENGINEERING UNIT-3


------------------------------------------------------------------------------------------------------------------------------------------

PROGRAM-1

File Title: RotaryVane.m

% rotary vane type attenuator


clear all;
clc;

% Theta value
theta=pi/8;

% Attenuation formulation
alpha=40*log(cos(theta));

% Displaying the results


disp(['The attenuation of the rotary vane type attenuator (in dB) for
theta = ', num2str(theta),' (Rads) is:' ]);
disp([num2str(alpha),'dB']);

output:

The attenuation of the rotary vane type attenuator (in dB) for theta =
0.3927 (Rads) is:
-3.1669dB

------------------------------------------------------------------------------------------------------------------------------------------

PROGRAM-2

File Title: E_PlaneTEE.m

% S-Matrix representation of Series (E-Plane) TEE


% Initialization of elements of the S-Matrix for E-Plane TEE

clear all;
clc;

s11=1/2;
s12=s11;
s13=1/sqrt(2);
s21=s12;
s22=s11;
s23=-s13;
s31=s13;
s32=s23;
s33=0;
disp('The S-Matrix of E-Plane (Series) TEE is given as: ')
disp([s11 s12 s13]);
disp([s21 s22 s23]);
disp([s31 s32 s33]);

OUTPUT:

The S-Matrix of E-Plane (Series) TEE is given as:

0.5000 0.5000 0.7071

0.5000 0.5000 -0.7071

0.7071 -0.7071 0

------------------------------------------------------------------------------------------------------------------------------------------

PROGRAM-3

File Title: H_PlaneTEE.m

% S-Matrix representation of H-Plane TEE


% Initialization of elements of the S-Matrix for H-Plane TEE

% Port 3 is perfectly matched


s33=0;

% Applying the properties of the H-Plane TEE we have:


s11=1/2;
s13=1/sqrt(2);
s12=-s11;

%Similarly using symmetry property


s21=s12;
s31=s13;
s32=s23;

% From the above relations


s22=s11;
s23=s13;

% Display the S-Matrix of H-Plane TEE


disp('The S-Matrix of E-Plane (Series) TEE is given as: ')
disp([s11 s12 s13]);
disp([s21 s22 s23]);
disp([s31 s32 s33]);

OUTPUT:

The S-Matrix of E-Plane (Series) TEE is given as:

0.5000 -0.5000 0.7071

-0.5000 0.5000 0.7071

0.7071 -0.7071 0

------------------------------------------------------------------------------------------------------------------------------------------

PROGRAM-4

File Title: MagicTEE.m

% S-Matrix representation of MAGIC TEE


% Initialization of elements of the S-Matrix for MAGIC TEE

% All the ports are perfectely matched


s11=0;s22=0;s33=0;s44=0;

% Port 1 as output port


s12=s11;
s13=1/sqrt(2);
s14=1/sqrt(2);

% H-plane TEE
s23=s13;

% E-plane TEE
s24=-s14;

% Isolated Ports
s34=0;
s43=0;

% Symmetric Property
s21=s12;
s31=s13;
s32=s23;
s41=s14;
s42=s24;

% Displaying the S-Matrix of MAGIC TEE


disp('The S-Matrix of E-Plane (Series) TEE is given as: ')
disp([s11 s12 s13 s14]);
disp([s21 s22 s23 s24]);
disp([s31 s32 s33 s34]);
disp([s41 s42 s43 s44]);

OUTPUT:

The S-Matrix of E-Plane (Series) TEE is given as:

0 0 0.7071 0.7071

0 0 0.7071 -0.7071

0.7071 0.7071 0 0

0.7071 -0.7071 0 0

------------------------------------------------------------------------------------------------------------------------------------------

PROGRAM-5

File Title: RatRace.m

clear all; clc;


% Operation of Rat Race Hybrid: Perfectly matched ports
s11=0;s22=0;s33=0;s44=0;

% When power is applied to port (1), it is equally divided between port


(2) and port (4)
s21=1/sqrt(2);
s41=1/sqrt(2);

% while the power at port (3) is zero. % Since, the powers at port (2)
and (4) combine in phase but, the powers at port (3) cancel each other
due to a path difference of “lambda/2”.
s31=0;

% Similarly, when the power is fed at a port (3), the resulting power is
% equally divided between port (2) and port (4) and power at port (1) is
% zero. For two unequal inputs at port (1), a sum of them is obtained at
% port (2) and port (4) while their difference is obtained at port (3).
s23=1/sqrt(2);
s43=s23;
s13=0;

% When port-2 is input


s12=1/sqrt(2);
s32=s12;
s42=0;
% When port-4 is input
s14=1/sqrt(2);
s34=s14;
s24=0;

% Displaying the S-Matrix of RAT RACE


disp('The S-Matrix of E-Plane (Series) TEE is given as: ')
disp([s11 s12 s13 s14]);
disp([s21 s22 s23 s24]);
disp([s31 s32 s33 s34]);
disp([s41 s42 s43 s44]);
OUTPUT:

The S-Matrix of RAT-RACE waveguide junction is given as:


0 0.7071 0 0.7071

0.7071 0 0.7071 0

0 0.7071 0 0.7071

0.7071 0 0.7071 0

------------------------------------------------------------------------------------------------------------------------------------------

PROGRAM-6

File Title: DCoupler_1.m

% A directional coupler has 10 dB coupling coefficient and 40 dB


% directivity, insertion loss of 1 dB. For an input power of 10 mW at
the input port of the main arm, determine the power at different ports.
Other ports except the one at which the measurement is made are match
% terminated.
clear all; clc;

% Coupling coefficient (dB)


C = 10;

% Directivity (dB)
D = 40;

% Insertion loss (dB)


I = 1;

% Input power (10mW),


Pin = 10e-3;

% Coupled port power, Pf = ? and Isolated port power, Pb = ?


% C = 10 log10(Pin/Pf)
% Coupled Power
Pf=Pin/10;

% Isolated Power
Pb=Pf*1e-4;

% Received output power


Pr=Pin-Pf-Pb;

% Received Power in dB
PR=10*log10(Pin/Pr);

% Output Power in main arm


PRR=PR-1;
% Display output
disp(['overall output power is: ', num2str(PRR),'dB']);

OUTPUT:

overall output power is: -0.54238dB

------------------------------------------------------------------------------------------------------------------------------------------

Das könnte Ihnen auch gefallen