85

ME full lab manual

Embed Size (px)

DESCRIPTION

lab manual

Citation preview

  • 1

    OPEN:

    SHORT:

    S.No DISTANCE MOVED BY THE

    MOVABLE PROBE ON SLOTTED

    LINE(M)

    VOLTAGE(V)

    GAIN(dB)

    MISMATCHED:

    S.No DISTANCE MOVED BY THE

    MOVABLE PROBE ON SLOTTED

    LINE(M)

    VOLTAGE(V)

    GAIN(dB)

    S.No DISTANCE MOVED BY THE

    MOVABLE PROBE ON SLOTTED

    LINE(M)

    VOLTAGE(V)

    GAIN(dB)

  • 2

    EX.NO:1 MEASUREMENT OF TRANSMISSION LINE PARAMETERS

    AIM:

    To measure the frequency/wavelength, VSWR, impedance and return loss by using

    VRFT-03A-DSS and co-axial slotted line.

    APPARATUS REQUIRED:

    1. VRFT-03A-DSS (RF source) 2. BNC-BNC cable 3. Co-axial slotted line trainer (Vcom-03) 4. Load 50,100,short

    PROCEDURE:

    1. Switch ON the RF source. 2. RF source output is connected to the input of the co-axial slotted line. 3. Movable probe output is connected to input of the detector using BNC-BNC cable. 4. Detector output of the RF source is connected to CRO (or) multimeter to measure the

    detector voltage.

    5. Output of the co-axial slotted line trainer is kept short. 6. Difference between the voltage maximum or minimum or can be measured by

    adjusting the movable probe on the co-axial trainer.

    7. Repeat the same procedure for open matched and unmatched. 8. By using the formula.

    THEORY:

    Frequency:

    Frequency is the number of occurrences of a repeating event per unit time. It is also

    referred to as temporal frequency. The period is the duration of one cycle in a repeating

    event, so the period is the reciprocal of the frequency. For example, if a newborn baby's heart

    beats at a frequency of 120 times a minute, its period (the interval between beats) is half a

    second

    Wavelength:

    The wavelength of a sinusoidal wave is the spatial period of the wavethe distance over which the wave's shape repeats. It is usually determined by considering the distance

  • 3

  • 4

    between consecutive corresponding points of the same phase, such as crests, troughs, or zero

    crossings, and is a characteristic of both traveling waves and standing waves, as well as other

    spatial wave patterns. Wavelength is commonly designated by the letter lambda (). The concept can also be applied to periodic waves of non-sinusoidal shape. The term wavelength

    is also sometimes applied to modulated waves, and to the sinusoidal envelopes of modulated

    waves or waves formed by interference of several sinusoids. The SI unit of wavelength is the

    meter.

    Characteristic impedance:

    The characteristic impedance or surge impedance of a uniform transmission line,

    usually written Z0, is the ratio of the amplitudes of voltage and current of a single wave

    propagating along the line; that is, a wave travelling in one direction in the absence of

    reflections in the other direction. Characteristic impedance is determined by the geometry and

    materials of the transmission line and, for a uniform line, is not dependent on its length. The

    SI unit of characteristic impedance is the ohm.

    The characteristic impedance of a lossless transmission line is purely resistive, with no

    reactive component. Energy supplied by a source at one end of such a line is transmitted

    through the line without being dissipated in the line itself. A transmission line of finite length

    (lossless or lossy) that is terminated at one end with a resistor equal to the characteristic

    impedance appears to the source like an infinitely long transmission line.

    Return loss:

    In telecommunications, return loss is the loss of signal power resulting from the reflection

    caused at a discontinuity in a transmission line or optical fiber. This discontinuity can be a

    mismatch with the terminating load or with a device inserted in the line. It is usually

    expressed as a ratio in decibels (dB);

    Where RL (dB) is the return loss in dB, Pi is the incident power and Pr is the reflected

    power.

    Return loss is related to both standing wave ratio (SWR) and reflection coefficient (). Increasing return loss corresponds to lower SWR. Return loss is a measure of how well

    devices or lines are matched. A match is good if the return loss is high. A high return loss is

    desirable and results in a lower insertion loss.

    Return loss is used in modern practice in preference to SWR because it has better resolution for

    small values of reflected wave.

  • 5

  • 6

    VSWR:

    In telecommunications, standing wave ratio (SWR) is the ratio of the amplitude of a partial

    standing wave at antinodes (maximum) to the amplitude at an adjacent node (minimum), in

    an electrical transmission line.

    The SWR is usually defined as a voltage ratio called the VSWR, (sometimes pronounced

    "viswar"), for voltage standing wave ratio. For example, the VSWR value 1.2:1 denotes

    maximum standing wave amplitude that is 1.2 times greater than the minimum standing wave

    value. It is also possible to define the SWR in terms of current, resulting in the ISWR, which

    has the same numerical value. The power standing wave ratio (PSWR) is defined as the

    square of the VSWR.

    SWR is used as an efficiency measure for transmission lines, electrical cables that conduct

    radio frequency signals, used for purposes such as connecting radio transmitters and receivers

    with their antennas, and distributing cable television signals. A problem with transmission

    lines is that impedance mismatches in the cable tend to reflect the radio waves back toward

    the source end of the cable, preventing all the power from reaching the destination end. SWR

    measures the relative size of these reflections. An ideal transmission line would have an SWR

    of 1:1, with all the power reaching the destination and no reflected power. An infinite SWR

    represents complete reflection, with all the power reflected back down the cable. The SWR of

    a transmission line can be measured with an instrument called an SWR meter, and checking

    the SWR is a standard part of installing and maintaining transmission lines.

  • 7

    \

  • 8

    RESULT:

    Thus measurement of frequency, wavelength, VSWR, load impedance and return loss

    was done.

  • 9

    BLOCK DIAGRAM FOR S-PARAMETER ESTIMATION OF MICROWAVE

    DEVICES:

    KLYSTRON

    POWER

    SUPPLY

    KLYSTRON

    TUBE WITH

    MOUNT

    ISOLATOR

    PIN

    MODULATOR

    VARIABLE

    ATTENUATOR

    FREQUENCY

    METER

    MICROWAVE

    DEVICE

    CRO

  • 10

    AIM:

    To estimate the S-parameter of microwave devices like E-plane tee, H-plane tee and

    magic tee.

    APPARATUS REQUIRED:

    1. Klystron power supply 2. Klystron tube with mount 3. Isolator 4. Pin modulator 5. Variable attenuator 6. Frequency meter 7. Cathode ray oscilloscope(CRO) 8. E-plane tee, H-plane tee, magic tee.

    PROCEDURE:

    1. Connections are given according to block diagram. 2. Microwave devices like E-plane tee, H-plane tee and magic tee is connected as

    shown in the block diagram.

    3. Input is given to one of the port, one port is terminated with matched load and other port is connected to load. Power output in two arms is noted for E-plane tee

    and H-plane tee.

    4. Input is given to one of the port, two ports are terminated with matched load and other port is connected to load. Power output in two arms is noted for magic tee.

    5. VSWR is calculated for microwave devices.

    THEORY:

    E-PLANE TEE:

    An E-plane Tee is a waveguide tee in which the axis of its side arm in parallel to the

    E-field of the main guide. If the collinear arms are symmetric about the side arm, there are

    two different transmissions characteristic. When the waves are fed into the side arm, the

    waves appearing at port 1 and port 2 of the collinear arm will be in opposite phase and in the

    same magnitude. Therefore

    S13= - S23

    EX.NO:2

    S-PARAMETER ESTIMATION OF MICROWAVE DEVICES

  • 11

    TABULATION:-

    NATURE OF

    TEE

    LOAD

    PORT

    Vmax( mV)

    Vmin(mV)

    VSWR=

    Vmax/

    Vmin

    E-PLANE

    TEE

    H-PLANE

    TEE

    MAGIC TEE

    1

    2

    3

    1

    2

    3

    1

    2

    3

    4

  • 12

    H-PLANE TEE:

    An H plane Tee is a wave guide tee in which the axis of the side arm is shunting the

    E-field or parallel to the H field of the main guide as it can be seen that if two input waves

    are fed into port1 and port 2 of the collinear arm, the output wave at port 3 will be phase and

    additive.

    MAGIC TEE:

    A magic Tee is a combination of the E- plane Tee and H-plane Tee. The magic tee has

    several characteristic. The magic Tee is commonly used for mixing, duplexing and

    impedance measurement. Suppose the example there are two identical radar transmitters in

    equivalent stock.

  • 13

  • 14

    RESULT:

    Thus the S-parameter of microwave devices like E-plane tee, H-plane tee and magic

    tee was estimated.

  • 15

    BLOCK DIAGRAM FOR MICROSTRIP COUPLER:

    KLYSTRON

    POWER

    SUPPLY

    KLYSTRON

    TUBE WITH

    MOUNT

    ISOLATOR

    PIN

    MODULATOR

    VARIABLE

    ATTENUATOR

    FREQUENCY

    METER

    MICROSTRIP

    COUPLER

    CRO

  • 16

    EX.NO:3 DESIGN AND TESTING OF MICROSTRIP COUPLER

    AIM:

    To design and test the Microstrip coupler.

    APPARATUS REQUIRED:

    1. Klystron power supply 2. Klystron tube with mount 3. Isolator 4. Pin modulator 5. Variable attenuator 6. Frequency meter 7. Cathode ray oscilloscope(CRO) 8. Microstrip coupler.

    THEORY:

    A Microstrip coupler is a device in which measurement of incident wave and reflected

    wave can be done separately. It consists of two transmission lines the main arm and auxiliary

    arm both are electromagnetically coupled to each other.

    Coupling factor, Directivity and Insertion loss can be found by using following

    formulae,

    1. Coupling factor (dB) = 10 log [V1/V3] 2. Directivity (D in dB) = 10 log [V2/V3] 3. Insertion loss (dB) = 10 log [V1/V2]

    PROCEDURE:

    1. Connections are given according to block diagram. 2. Input is given to port 1 and power output at port 2 is measured by terminating port

    3 with matched load.

    3. Input is given to port 1 and power output at port 3 is measured by terminating port 2 with matched load.

    4. Input is given to port 2 and power output at port 3 is measured by terminating port 1 with matched load.

    5. Input is given to port 2 and power output at port 1 is measured by terminating port 3 with matched load.

    6. Coupling factor, Directivity and Insertion loss can be found by using above formulae.

  • 17

    TABULATION:

    DIRECTION

    PORT1

    PORT2

    PORT3

    PORT4

    FORWARD

    REVERSE

  • 18

    RESULT:

    Thus the Microstripcoupler was design and tested.

  • 19

    BLOCK DIAGRAM FOR MIOCROSTRIP COUPLER:

    HORN

    KLYSTRON

    POWER SUPPLY

    KLYSTRON TUBE

    WITH MOUNT

    ISOLATOR

    VARIABLE

    ATTENUATOR

    FREQUENCY

    METER

    ROTARY

    JOINT

    DETECTOR

    MOUNT

    CRO

  • 20

    EX.NO:4 ANTENNA RADIATION PATTERN MEASUREMENT

    AIM:

    To measure the pattern of the Horn Antenna.

    APPARATUS REQUIRED:

    1. Klystron power supply. 2. Klystron Mount. 3. Isolator. 4. Variable attenuator. 5. Frequency meter. 6. Horn antenna. 7. Crystal detector. 8. VSWR meter.

    THEORY:

    The horn antenna represents a transition or matching section from the guided mode

    inside the waveguide to the unguided mode outside the waveguides. The horn antenna

    reduces reflections and also leads to a lower standing wave ratio. The horn antenna is used in

    the transmission and reception of RF microwave signals and the antenna is normally used in

    conjunction with waveguide feed. The horn antenna gains the name from it appearance. The

    wavelength can be considered to open out or to be flared launching the signal towards the

    receiving antenna.

    PROCEDURE: Antenna Radiation pattern:

    1. Setup the equipment as keeping the axis of both antennas in same direction. 2. Energizes the Gunn oscillator for maximum output at desired frequency with square

    wave modulation by tuning square wave amplitude and frequency of modulation

    signal of Gunn power supply and by tuning the detector.

    3. Also tune the SS tuner in the line for maximum output. 4. Obtain the full scale deflection on normal dB scale at any convenient range switch

    position of VSWR, meter by gain control knob of VSWR meter or by variable

    attenuator.

    5. Tune the receiving horn to the left in 2 or 5 steps to 4 5 and note the corresponding VSWR dB reading in normal dB range. When necessary, change the

    range switch to next higher range and add 10 dB to the observed reading.

    6. Repeat the above steps but this time the receiving horn to right and note down the readings.S

    7. Plot a relative power pattern (i.e.), output vs. angle. From diagram determine 3 dB width of the horn antenna.

  • 21

    PATTERN MEASUREMENT:

    SIDE DEGREE VR(V) VT(V) GAIN IN dB

    ANTICLOKWISE DIRECTION CLOCKWISE DIRECTION

  • 22

  • 23

    GAIN MEASUREMENT:

    S.NO

    DISTANCE(CM)

    VT(V)

    VR(V)

    GAIN IN dB

  • 24

    RESULT:

    Thus the pattern of the wave of horn antenna was measured.

  • 25

    x(n) d^(n) d(n)

    GENERAL BLOCK DIAGRAM OF ADAPTIVE FILTER

    Filter i/p v(n) d^(n) d(n)

    Filter o/p

    Co-efficient vector

    wn(z)

    Adaptive

    algorithm

    ADAPTIVE

    FILTER

    ADAPTATION

    PROCEDURE

  • 26

    EX.NO:5 DESIGN OF CHANNEL EQUALIZER USING LMS ALGORITHM

    AIM:

    To write the MATLAB program for LMS algorithm & simulate it.

    REQUIREMENTS:

    MATLAB Software, PC.

    ALGORITHM:

    The steepest descent adaptive filter, which has a weight vector equation given

    by

    Wn+1=Wn +E [e (n-L) X*(n)] --- (1)

    So it must be replaced by an estimate such as sample mean.

    r-1

    E [e (n) x (n)] = 1/L e (n-1)*(n-1)

    i=0

    Now the equation (1) becomes

    r-1

    Wn+1= Wn +/L E [N-L] x (n-1) --- (2)

    i=0

    If we use one point sample of 2L=1 then we get

    Wn+1 = Wn + e (n)x (n)

    This is known as LMS algorithm.

  • 27

    OUTPUT:

  • 28

    THEORY:

    Least mean squares (LMS) algorithms are a class of adaptive filter used to mimic a

    desired filter by finding the filter coefficients that relate to producing the least mean squares

    of the error signal (difference between the desired and the actual signal). It is a stochastic

    gradient descent method in that the filter is only adapted based on the error at the current

    time. It was invented in 1960 by Stanford University professor Bernard Widrow and his first

    Ph.D. student, Ted Hoff.

    PROGRAM :

    clc;

    clearall;

    closeall;

    order=2;

    size=2;

    fs=8192;

    t=[0:1/fs:size];

    n=fs*size;

    f1=35;

    f2=99;

    voice=sin(2*pi*f1*t);

    subplot(4,1,1);

    plot(t,voice);

    title('voice (dont have access to)');

    noise=sin(2*pi*f2*t.^2);

    primary=voice+noise;

    subplot(4,1,2);

    plot(t,primary);

    title('primary=voice+noise(input1)');

    ref=noise+.25*rand;

    subplot(4,1,3);

    plot(t,ref);

    title('reference(noisy noise)(input2)');

    w=zeros(order,1);

    mu=.005;

    fori=1:n-order

    buffer=ref(i:i+order-1);

    desired(i)=primary(i)-buffer*w;

    w=w+(buffer.*mu*desired(i)/norm(buffer))';

    end

    subplot(4,1,4);

    plot(t(order+1:n),desired);

    title('adaptive output(hopefully its close to voice)');

  • 29

  • 30

    RESULT:

    Thus the MATLAB program for LMS algorithm was simulated.

  • 31

  • 32

    EX.NO:6 CHARACTERSTICS OF /4 AND /2 TRANSMISSION LINES

    AIM:

    To stimulate the characteristics of a /4 and /2 transmission lines using MATLAB.

    APPARATUS REQUIRED:

    1. A personal computer 2. MATLAB 6.5 software.

    THEORY:

    HALF WAVELENGTH LINE (/2 LINES)

    A half wave length transmission lines in one whose electrical length is one half

    wavelengths. When a /2 line whose characteristics impedance is Zo is transmitted in a load

    impedance ZL. Consider an RF sine wave of frequency f and wavelength transmitting from

    input to the load. If Vo cos (2 (/x + ft) are the voltage and current on the transmission line,

    then at the input x=0 and the input impedance is,

    Zs=Vo cos (2ft) / Io cos (2ft)

    At the load x=/2 and the load impedance of the lines is

    ZL = Vo cos (+2ft) / Io cos ( + 2ft)

    From the voltage trigonometry, we know that cos(+2ft)-cos(2ft).

    ALGORITHM:

    1. Initialization of parameter for /4 and /2 transmission lines ZL,Zs,Vs,Is. 2. Simulate the smith chart parameters and coordinates. 3. Find the location of stub and stub angle load and 4. Calculate the normalize value of impedance and admittance at the port on

    transmission lines where stub is connected.

    5. Calculate the normalized admittance of stub line and length of stub line. 6. Plot the characteristic of line on smith chart.

  • 33

  • 34

    LAMDA PROGRAM:

    Close all;

    Clear all;

    amp= rfckt.amplifer;

    read(amp,sample 1t2.s2p);

    analyse(amp,1.9e9);

    data=calculate(amp, s11, s12, s21, s22, none);

    [s11,s12,s21,s22]=deal(data{1},data{2},data{3},data{4});

    delta= s11*s22-s12*s21;

    k=(1-abs(s11)^2-abs(s22)^+abs(delta)^2,a2*abs(s12*s21);

    abs_delta=abs(delta);

    B=1+abs(s22)^2-abs(s11)^2-abs(delta)^2;

    C=s22-delta*conj(s11);

  • 35

  • 36

  • 37

    CHARACTERSTICS OF /4 AND /2 TRANSMISSION LINES:

    OUTPUT:

  • 38

    RESULT:

    Thus the characteristics of /4 and /2 transmission lines is studied.

  • 39

  • 40

    EX.NO:7 PERFORMANCE EVALUATION OF DIGITAL MODULATION

    SCHEMES

    AIM:

    To write the MATLAB programs for PERFORMANCE EVALUATION OF DIGITAL

    MODULATION SCHEMES (ASK, FSK, PSK, QPSK) & simulate it.

    REQUIREMENTS:

    MATLAB Software, PC.

    ALGORITHM:

    1. Start the program 2. Get the input binary sequence and determine its length 3. Append the analog input according to the digital input 4. Choose the sample value according for demodulation 5. Plot the waveform for input modulation and demodulation 6. Stop the program

    THEORY:

    Amplitude-shift keying (ASK):

    ASK is a form of modulation that represents digital data as variations in the amplitude

    of a carrier wave. Any digital modulation scheme uses a finite number of distinct signals to

    represent digital data. ASK uses a finite number of amplitudes, each assigned a unique

    pattern of binary digits. Usually, each amplitude encodes an equal number of bits. Each

    pattern of bits forms the symbol that is represented by the particular amplitude. The

    demodulator, which is designed specifically for the symbol-set used by the modulator,

    determines the amplitude of the received signal and maps it back to the symbol it represents,

    thus recovering the original data. Frequency and phase of the carrier are kept constant.

    Frequency-shift keying (FSK):

    FSK is a frequency modulation scheme in which digital information is transmitted

    through discrete frequency changes of a carrier wave. The simplest FSK is binary FSK

    (BFSK). BFSK uses a pair of discrete frequencies to transmit binary (0s and 1s) information.

    With this scheme, the "1" is called the mark frequency and the "0" is called the space

    frequency. The time domain of an FSK modulated carrier is illustrated in the figures to the

    right.

  • 41

  • 42

    Phase-shift keying (PSK)

    PSK is a digital modulation scheme that conveys data by changing, or modulating, the

    phase of a reference signal (the carrier wave).Any digital modulation scheme uses a finite

    number of distinct signals to represent digital data. PSK uses a finite number of phases, each

    assigned a unique pattern of binary digits. Usually, each phase encodes an equal number of

    bits. Each pattern of bits forms the symbol that is represented by the particular phase. The

    demodulator, which is designed specifically for the symbol-set used by the modulator,

    determines the phase of the received signal and maps it back to the symbol it represents, thus

    recovering the original data. This requires the receiver to be able to compare the phase of the

    received signal to a reference signal such a system is termed coherent (and referred to as CPSK).

    Alternatively, instead of operating with respect to a constant reference wave, the broadcast

    can operate with respect to itself. Changes in phase of a single broadcast waveform can be

    considered the significant items. In this system, the demodulator determines the changes in

    the phase of the received signal rather than the phase (relative to a reference wave) itself.

    Since this scheme depends on the difference between successive phases, it is termed

    differential phase-shift keying (DPSK). DPSK can be significantly simpler to implement

    than ordinary PSK since there is no need for the demodulator to have a copy of the reference

    signal to determine the exact phase of the received signal (it is a non-coherent scheme). In

    exchange, it produces more erroneous demodulations.

    Quadrature Phase-shift keying (QPSK)

    Sometimes this is known as quaternary PSK, quadriphase PSK, 4-PSK, or 4-QAM.

    (Although the root concepts of QPSK and 4-QAM are different, the resulting modulated radio

    waves are exactly the same.) QPSK uses four points on the constellation diagram, equispaced

    around a circle. With four phases, QPSK can encode two bits per symbol, shown in the

    diagram with gray coding to minimize the bit error rate (BER) sometimes misperceived as twice the BER of BPSK.

    The mathematical analysis shows that QPSK can be used either to double the data rate

    compared with a BPSK system while maintaining the same bandwidth of the signal, or to

    maintain the data-rate of BPSK but halving the bandwidth needed. In this latter case, the

    BER of QPSK is exactly the same as the BER of BPSK - and deciding differently is a

    common confusion when considering or describing QPSK.

    Given that radio communication channels are allocated by agencies such as the Federal

    Communication Commission giving a prescribed (maximum) bandwidth, the advantage of QPSK over

    BPSK becomes evident: QPSK transmits twice the data rate in a given bandwidth compared to BPSK -

    at the same BER. The engineering penalty that is paid is that QPSK transmitters and receivers are

    more complicated than the ones for BPSK. However, with modern electronics technology, the

    penalty in cost is very moderate.

  • 43

    OUTPUT FOR AMPLITUDE SHIFT KEYING:

  • 44

    PROGRAM FOR AMPLITUDE SHIFT KEYING:

    clc;

    clearall;

    x=[1 0 1 1 0 1];

    n=length(x);

    t=0:1:25;

    y=sin(t);

    ask=0;

    fori=1:n

    if (x(i)==1)

    ask=[ask 4*y];

    else (x(i)==0)

    ask=[ask 0*y];

    end

    end

    demod=0;

    ptr=10;

    fori=1:n

    if ask(ptr)>0

    demod(i)=1;

    else

    demod(i)=0;

    end

    ptr=ptr+length(t);

    end

    subplot(4,1,1);

    stem(x);

    title('message signal');

    xlabel('time');

    ylabel('amplitude');

    subplot(4,1,2);

    plot(y);

    title('carrier signal');

    xlabel('time');

    ylabel('amplitude');

    subplot(4,1,3);

    plot(ask);

    title('modulated signal');

    xlabel('time');

    ylabel('amplitude');

    subplot(4,1,4);

    stem(demod);

    title('demodulated signal');

    xlabel('time');

    ylabel('amplitude');

  • 45

    OUTPUT FOR FREQUENCY SHIFT KEYING:

  • 46

    PROGRAM FOR FREQUENCY SHIFT KEYING:

    clc;

    clearall;

    closeall;

    x=[1 0 1 1 0 1];

    n=length(x);

    t=0:1:25;

    y=sin(t);

    z=sin(2*t);

    fsk=0;

    fori=1:n

    if (x(i)==1)

    fsk=[fsk y];

    else (x(i)==0)

    fsk=[fsk z];

    end

    end

    demod=0;

    ptr=10;

    fori=1:n

    iffsk(ptr)>0

    demod(i)=1;

    else

    demod(i)=0;

    end

    ptr=ptr+length(t);

    end

    subplot(5,1,1);

    stem(x);

    title('message signal');

    xlabel('time');

    ylabel('amplitude');

    subplot(5,1,2);

    plot(y);

    title('carrier signal 1');

    xlabel('time');

    ylabel('amplitude');

    subplot(5,1,3);

    plot(z);

    title('carrier signal 2');

    xlabel('time');

    ylabel('amplitude');

    subplot(5,1,4);

    plot(fsk);

    title('modulated signal');

    xlabel('time');

    ylabel('amplitude');

    subplot(5,1,5);

    stem(demod);

    title('demodulated signal');

    xlabel('time');

    ylabel('amplitude');

  • 47

    OUTPUT FOR PHASE SHIFT KEYING:

  • 48

    PROGRAM FOR PHASE SHIFT KEYING:

    clc;

    clearall;

    closeall;

    x=[1 0 1 1 0 1];

    n=length(x);

    t=0:1:25;

    y=sin(t);

    z=-y;

    psk=0;

    fori=1:n

    if (x(i)==1)

    psk=[psk y];

    else (x(i)==0)

    psk=[psk z];

    end

    end

    demod=0;

    ptr=10;

    fori=1:n

    ifpsk(ptr)>0

    demod(i)=1;

    else

    demod(i)=0;

    end

    ptr=ptr+length(t);

    end

    subplot(5,1,1);

    stem(x);

    title('message signal');

    xlabel('time');

    ylabel('amplitude');

    subplot(5,1,2);

    plot(y);

    title('carrier signal 1');

    xlabel('time');

    ylabel('amplitude');

    subplot(5,1,3);

    plot(z);

    title('carrier signal 2');

    xlabel('time');

    ylabel('amplitude');

    subplot(5,1,4);

    plot(psk);

    title('modulated signal');

    xlabel('time');

    ylabel('amplitude');

    subplot(5,1,5);

    stem(demod);

    title('demodulated signal');

    xlabel('time');

    ylabel('amplitude');

  • 49

    OUTPUT FOR QUADRATURE PHASE SHIFT KEYING:

    OUTPUT FOR QUADRATURE PHASE SHIFT KEYING:

  • 50

    PROGRAM FOR QUADRATURE PHASE SHIFT KEYING:

    clc;

    clearall;

    closeall;

    input=randsrc(1,10,[1,0]);

    k=1;

    fori=1:10

    for j=1:50

    m(k)=input(i);

    k=k+1;

    end

    end

    figure(1);

    subplot(3,1,1);

    plot(m);

    title('INPUT BITS');

    xlabel('Time(s)');

    ylabel('Amplitude(v)');

    grid;

    axis([1,500,0,2]);

    k=1;

    l=50;

    fori=1:10

    if rem(i,2)~=0

    if(input(i)==1)

    for j=1:100

    msgodd(k)=1;

    k=k+1;

    end

    else

    for j=1:100

    msgodd(k)=-1;

    k=k+1;

    end

    end

    end

    if(input(i)==1)

    for j=50:150

    msgeven(l)=1;

    l=l+1;

    end

    else

    for j=50:150

    msgeven(l)=-1;

    l=l+1;

    end

    end

    end

    subplot(3,1,2);

    plot(msgodd);

    title('MESSAGE ODD');

    xlabel('Time(s)');

    ylabel('Amplitude(v)');

    grid;

  • 51

  • 52

    axis([1,500,-1.5,1.5]);

    subplot(3,1,3);

    plot(msgeven);

    title('MESSAGE EVEN');

    xlabel('Time(s)');

    ylabel('Amplitude(v)');

    grid;

    axis([1,500,-1.5,1.5]);

    n=1:100;

    s=sin(2*pi*2*n/50);

    c=cos(2*pi*2*n/50);

    k=1;

    fori=1:5

    for j=1:100

    c1(k)=s(j);

    c2(k)=c(j);

    k=k+1;

    end

    end

    fori=1:500

    qo(i)=msgodd(i)*c1(i);

    qe(i)=msgeven(i)*c2(i);

    qpsk(i)=qo(i)+qe(i);

    end

    figure(2);

    subplot(3,1,1);

    plot(qo);

    title('INPHASE BITS');

    xlabel('Time(s)');

    ylabel('Amplitude(v)');

    grid;

    axis([1,500,-1.5,1.5]);

    subplot(3,1,2);

    plot(qe);

    title('OFFSET QUADRATURE PHASE BITS');

    xlabel('Time(s)');

    ylabel('Amplitude(v)');

    grid;

    axis([1,500,-1.5,1.5]);

    subplot(3,1,3);

    plot(qpsk);

    title('OFFSET QPSK WAVEFORM');

    xlabel('Time(s)');

    ylabel('Amplitude(v)');

    grid;

    axis([1,500,-1.5,1.5]);

  • 53

  • 54

    RESULT:

    Thus theMATLAB programs for PERFORMANCE EVALUATION OF DIGITAL

    MODULATION SCHEMES (ASK, FSK, PSK, QPSK) was simulated.

  • 55

    OFDM Transmitter

    OFDM Receiver

  • 56

    EX.NO:8 ORTHOGONAL FREQUENCY DIVISION

    MULITIPLEXING(OFDM)TRANSCEIVER

    AIM:

    To write the program for Orthogonal Frequency Division

    Multiplexing(OFDM)transceiver and simulate it using MATLAB.

    APPARATUS REQUIRED:

    MATLAB software

    Personal Computer

    ALGORITHM:

    1. Start the program. 2. Get the values of G, Kmax, Kmin and Fs. 3. Run the program. 4. Encode by format. 5. Plot the graph. 6. Stop the program.

    THEORY:

    OFDM TRANSMITTER

    In an OFDM schemes , a large number of orthogonal ,overlapping, narrow band sub

    channel or sub carriers,transmitted in parallel, divide the available transmission bandwidth.

    The separation of the sub carriers is theoretically minimal such that there is a very compact

    spectral utilization. The attraction of OFDM is mainly due to how the system handles the

    multipath interference at the receiver. Multipath generated two effects :frequency selective

    fading and intersymbol interference.

    OFDM RECEIVER

    The design of OFDM receivers is open , there are only transmission standards. With

    an open receiver design, most of the research and innovations are done in the receiver. For

    example the frequency sensitivity drawback is mainly a transmission channel predicting

    issues, something that is done in the receiver.

  • 57

    OUTPUT:

    TRANSMITTER

  • 58

    PROGRAM:

    OFDM TRANSMITTER:

    %DVB-T 2K Transmission

    %The available bandwidth is 8 MHz

    %2K is intended for mobile services

    clearall;

    closeall;

    %DVB-T Parameters

    Tu=224e-6; %useful OFDM symbol period

    T=Tu/2048; %baseband elementary period

    G=0; %choice of 1/4, 1/8, 1/16, and 1/32

    delta=G*Tu; %guard band duration

    Ts=delta+Tu; %total OFDM symbol period

    Kmax=1705; %number of subcarriers

    Kmin=0;

    FS=4096; %IFFT/FFT length

    q=10; %carrier period to elementary period ratio

    fc=q*1/T; %carrier frequency

    Rs=4*fc; %simulation period

    t=0:1/Rs:Tu;

    %Data generator (A)

    M=Kmax+1;

    rand('state',0);

    a=-1+2*round(rand(M,1)).'+i*(-1+2*round(rand(M,1))).'; A=length(a);

    info=zeros(FS,1);

    info(1:(A/2)) = [ a(1:(A/2)).']; %Zero padding

    info((FS-((A/2)-1)):FS) = [ a(((A/2)+1):A).'];

  • 59

  • 60

    %Subcarriers generation (B)

    carriers=FS.*ifft(info,FS); tt=0:T/2:Tu;

    figure(1);

    subplot(2,1,1);

    stem(tt(1:20),real(carriers(1:20)));

    subplot(2,1,2);

    stem(tt(1:20),imag(carriers(1:20))); figure(2);

    f=(2/T)*(1:(FS))/(FS); subplot(2,1,1);

    plot(f,abs(fft(carriers,FS))/FS); subplot(2,1,2);

    pwelch(carriers,[],[],[],2/T);

    % D/A simulation

    L = length(carriers);

    chips = [ carriers.';zeros((2*q)-1,L)]; p=1/Rs:1/Rs:T/2;

    g=ones(length(p),1); %pulse shape figure(3);

    stem(p,g);

    dummy=conv(g,chips(:));

    u=[dummy(1:length(t))]; % (C) figure(4);

    subplot(2,1,1);

    plot(t(1:400),real(u(1:400))); subplot(2,1,2);

    plot(t(1:400),imag(u(1:400))); figure(5);

    ff=(Rs)*(1:(q*FS))/(q*FS); subplot(2,1,1);

    plot(ff,abs(fft(u,q*FS))/FS); subplot(2,1,2);

    pwelch(u,[],[],[],Rs);

    [b,a] = butter(13,1/20); %reconstruction filter

    [H,F] = FREQZ(b,a,FS,Rs);

    figure(6);

    plot(F,20*log10(abs(H)));

    uoft = filter(b,a,u); %baseband signal (D)

  • 61

  • 62

    figure(7);

    subplot(2,1,1);

    plot(t(80:480),real(uoft(80:480))); subplot(2,1,2);

    plot(t(80:480),imag(uoft(80:480))); figure(8);

    subplot(2,1,1);

    plot(ff,abs(fft(uoft,q*FS))/FS); subplot(2,1,2);

    pwelch(uoft,[],[],[],Rs);

    %Upconverter

    s_tilde=(uoft.').*exp(1i*2*pi*fc*t);

    s=real(s_tilde); %passband signal (E)

    figure(9);

    plot(t(80:480),s(80:480)); figure(10);

    subplot(2,1,1);

    %plot(ff,abs(fft(((real(uoft).').*cos(2*pi*fc*t)),q*FS))/FS);

    %plot(ff,abs(fft(((imag(uoft).').*sin(2*pi*fc*t)),q*FS))/FS);

    plot(ff,abs(fft(s,q*FS))/FS);

    subplot(212);

    %pwelch(((real(uoft).').*cos(2*pi*fc*t)),[],[],[],Rs);

    %pwelch(((imag(uoft).').*sin(2*pi*fc*t)),[],[],[],Rs);

    pwelch(s,[],[],[],Rs);

  • 63

  • 64

    OFDM RECEIVER:

    %DVB-T 2K Reception

    clearall;

    closeall;

    Tu=224e-6; %useful OFDM symbol period

    T=Tu/2048; %baseband elementary period

    G=0; %choice of 1/4, 1/8, 1/16, and 1/32

    delta=G*Tu; %guard band duration

    Ts=delta+Tu; %total OFDM symbol period

    Kmax=1705; %number of subcarriers

    Kmin=0;

    FS=4096; %IFFT/FFT length

    q=10; %carrier period to elementary period ratio

    fc=q*1/T; %carrier frequency

    Rs=4*fc; %simulation period

    t=0:1/Rs:Tu;

    tt=0:T/2:Tu;

    %Data generator

    sM = 2;

    [x,y] = meshgrid((-sM+1):2:(sM-1),(-sM+1):2:(sM-1)); alphabet = x(:) + 1i*y(:);

    N=Kmax+1;

    rand('state',0);

    a=-1+2*round(rand(N,1)).'+i*(-1+2*round(rand(N,1))).'; A=length(a);

    info=zeros(FS,1);

    info(1:(A/2)) = [ a(1:(A/2)).'];

    info((FS-((A/2)-1)):FS) = [ a(((A/2)+1):A).']; carriers=FS.*ifft(info,FS);

  • 65

    OUTPUT:

    RECEIVER

  • 66

    %Upconverter

    L = length(carriers);

    chips = [ carriers.';zeros((2*q)-1,L)]; p=1/Rs:1/Rs:T/2;

    g=ones(length(p),1);

    dummy=conv(g,chips(:));

    u=[dummy; zeros(46,1)];

    [b,aa] = butter(13,1/20);

    uoft = filter(b,aa,u);

    delay=64; %Reconstruction filter delay

    s_tilde=(uoft(delay+(1:length(t))).').*exp(1i*2*pi*fc*t);

    s=real(s_tilde);

    %OFDM RECEPTION

    %Downconversion

    r_tilde=exp(-1i*2*pi*fc*t).*s; %(F) figure(1);

    subplot(2,1,1);

    plot(t,real(r_tilde));

    axis([0e-7 12e-7 -60 60]); grid on;

    figure(1);

    subplot(2,1,2);

    plot(t,imag(r_tilde));

    axis([0e-7 12e-7 -100 150]); grid on;

    figure(2);

    ff=(Rs)*(1:(q*FS))/(q*FS); subplot(2,1,1);

    plot(ff,abs(fft(r_tilde,q*FS))/FS); grid on;

    figure(2);

    subplot(2,1,2);

    pwelch(r_tilde,[],[],[],Rs);

  • 67

  • 68

    %Carrier suppression

    [B,AA] = butter(3,1/2);

    r_info=2*filter(B,AA,r_tilde); %Baseband signal continuous-time (G)

    figure(3);

    subplot(2,1,1);

    plot(t,real(r_info));

    axis([0 12e-7 -60 60]); grid on;

    figure(3);

    subplot(2,1,2);

    plot(t,imag(r_info));

    axis([0 12e-7 -100 150]); grid on;

    figure(4);

    f=(2/T)*(1:(FS))/(FS); subplot(2,1,1);

    plot(ff,abs(fft(r_info,q*FS))/FS); grid on;

    subplot(2,1,2);

    pwelch(r_info,[],[],[],Rs);

    %Sampling

    r_data=real(r_info(1:(2*q):length(t)))... %Baseband signal, discrete-time

    +1i*imag(r_info(1:(2*q):length(t))); % (H)

    figure(5);

    subplot(2,1,1);

    stem(tt(1:20),(real(r_data(1:20)))); axis([0 12e-7 -60 60]);

    gridon;

    figure(5);

    subplot(2,1,2);

    stem(tt(1:20),(imag(r_data(1:20)))); axis([0 12e-7 -100 150]);

    gridon;

    figure(6); f=(2/T)*(1:(FS))/(FS); subplot(2,1,1);

  • 69

  • 70

    plot(f,abs(fft(r_data,FS))/FS); grid on;

    subplot(2,1,2);

    pwelch(r_data,[],[],[],2/T);

    %FFT

    info_2N=(1/FS).*fft(r_data,FS); % (I)

    info_h=[info_2N(1:A/2) info_2N((FS-((A/2)-1)):FS)];

    %Slicing

    for k=1:N,

    a_hat(k)=alphabet((info_h(k)-alphabet)==min(info_h(k)-alphabet));

    end;

    figure(7)

    plot(info_h((1:A)),'.k');

    title('info-h Received Constellation')

    axissquare;

    axisequal;

    figure(8)

    plot(a_hat((1:A)),'or');

    title('a_hat 4-QAM')

    axissquare;

    axisequal;

    gridon;

    axis([-1.5 1.5 -1.5 1.5]);

  • 71

  • 72

    RESULT:

    Thus the Orthogonal Frequency Division Multiplexing (OFDM) Transceiver was simulated in

    MATLAB.

  • 73

  • 74

    EX.NO:9 SIMULATION OF MICROSTRIP ANTENNA

    AIM:

    To design and test the Microstrip antenna using MATLAB.

    REQUIREMENTS:

    MATLAB Software, PC.

    ALGORITHM:

    1. Enter the dielectric constant value, the resonant frequency value in GHz, height of the micro-strip antenna in mm and width of the micro-strip antenna in cm.

    2. Effective dielectric constant of micro-strip is Calculated and displayed. 3. Increase in length of micro-strip in cm is Calculated and displayed. 4. Length of micro-strip in cm is Calculated and displayed. 5. Effective length of micro-strip in cm is Calculated and displayed. 6. The program is run and output is visualized in the command window.

    THEORY:

    Micro strip radiation can be transmitted through space or through the atmosphere in a

    microwave beam from a microwave antenna and the microwave energy can be collected with

    a microwave antenna.

    Microwave antennas are used for transmitting and receiving the microwave are used

    for transmitting and receiving the microwave radiation. Microwave antenna are usually

    essential parts of microwave telecommunication systems. Microwave antennas are as

    antennas typically comprise an open ended wave guide and a parabolic reflector or horn and

    they typically transmit a predetermined frequency in a predetermined direction. Microwave

    antennas are usually equipped with a reflector having a structure of predetermined shape on

    which is placed a micro of reflecting microwaves. The structure and the mirror are supported

    by a frame mainly formed of tubes welded together or of welded or viveted compartments.

  • 75

    OUTPUT:

    Enter the dielectric constant value=25

    Enter the resonant frequency value in ghz:15

    Enter the height of the Microstrip antenna in mm:20

    Width of the Microstrip in cm=

    w = 0.2774

    ereff = 13.4077

    The effective dielectric constant of the Microstrip=

    ereff =

    13.4077

    increase in length of the Microstrip in cm=

    inclen =

    2.8865

    Length of the Microstrip in cm=

    len =

    -5.5000

    Effective length of the Microstrip in cm=

    leff =

    0.2731

  • 76

    PROGRAM:

    clc;

    clearall;

    er=input('Enter the dielectric constant value=');

    fr=input('Enter the resonant frequency value in ghz:');

    h=input('Enter the height of the microstrip antenna in mm:');

    c=30;%10^9cm/sec

    %--------------width calculation-------------

    w=((sqrt(2/(er+1))*c)/(2*fr));

    display('Width of the microstrip in cm=');

    display(w);

    %----------dielectric constant calculation----------

    wbyh=w/h;

    ereff=((er+1)/2)+((er-1)/2)*(1+12*1/wbyh)^-0.5

    display('The effective dielectric constant of the microstrip=');

    display(ereff);

    %---------increase in length calculation--------------

    a=((ereff+0.3)/(ereff-0.258));

    b=((wbyh+0.264)/(wbyh+0.813));

    inclen=0.412*h*a*b;

    display('increase in length of the microstrip in cm=');

    display(inclen);

    %----------length------------

    len=(c/(2*fr*sqrt(ereff)))-(2*inclen);

    display('Length of the microstrip in cm=');

    display(len);

    %------------effective length of microstrip----

    leff=len+(2*inclen);

    display('Effective length of the microstrip in cm=');

    display(leff);

  • 77

  • 78

    RESULT:

    Thus the Microstrip antenna was designed and tested by using MATLAB.

  • 79

  • 80

    EX.NO:10 PERFORMANCE EVALUATION OF SIMULATED CDMA

    SYSTEM

    AIM:

    To evaluate the performance of CDMA using MATLAB.

    REQUIREMENTS:

    MATLAB Software, PC.

    ALGORITHM:

    1. Pseudo noise sequence is generated by using the maximum length sequence shift register of length = 3 and length of PN sequence is 7.

    2. Random digital is generated by using maximum length sequence. 3. The spread message is modulated by using primary phase shift keying technique

    and it is transmitted over AWGN channel.

    4. The received message is demodulated and despread using correlation of the same PN sequence.

    5. Bit Error Rate (BER) is calculated.

  • 81

  • 82

    PROGRAM:

    clc;

    clearall;

    N=128;

    M=32;

    snr_db=0:15;

    K=[0 10];

    r1=(pi/4)*(exp(-K(1))/(K(1)+1))*((1+K(1))*besseli(0,K(1)/2)+K(1)*besseli(1,K(1)/2))^2;

    r2=(pi/4)*(exp(-K(2))/(K(2)+1))*((1+K(2))*besseli(0,K(2)/2)+K(2)*besseli(1,K(2)/2))^2;

    fori=1:length(snr_db)

    snr=10^(snr_db(i)/10);

    p_awgn(i)=(sqrt(snr));

    p_ray(i)=(sqrt((pi/2)*(snr/(((2-pi/2)*snr/N)+(M-1)*snr/N)+1)));

    p_rician1(i)=(sqrt((r1*snr)/((M*(1-r1)*snr)/N+1)));

    p_rician2(i)=(sqrt((r2*snr)/((M*(1-r2)*snr)/N+1)));

    end

    figure(1);

    semilogy(snr_db,p_awgn,'-*',snr_db,p_ray,'-^',snr_db,p_rician1,'-+',snr_db,p_rician2,'-+');

    title('signal to noise ratio of AWGN,RAYLEIGH,RICIAN CHANNEL');

    xlabel('10*log10SNR');

    ylabel('Average error probability');

    legend('AWGN','RAYLEIGH','K=0 RICIAN','K=10 RICIAN');

    clearall;

    snr_db=0:15;

    p_ray1=ray(128,8);

    p_ray2-ray(128,64);

    p_ray3=ray(128,128);

    figure(2);

    semilogy(snr_db,p_ray1,'-+',snr_db,p_ray2,'-*',snr_db,p_ray3,'-^');

    title('BER in rayleigh fading(number of users=8)');

    xlabel('10*log10SNR');

    ylabel('Average error probability');

    legand('M=8 rayleigh','M=64 rayleigh','M=128 rayleigh');

    clearall;

    snr_db=0:15;

    p_rician1=rician(128,8);

    p_rician2=rician(128,64);

    p_rician3=rician(128,128);

    figure(3);

    semilogy(snr_db,p_rician1,'-^',snr_db,p_rician2,'-*',snr_db,p_rician3,'-+');

    title('BER in rician fading channel K=0(number of users=8)');

    xlabel('10*log10SNR');

    ylabel('Average error probability');

    legand('M=8 rician','M=64 rician','M=128 rician');

    clearall;

    snr_db=0:15;

    p_rician1=rician(128,64);

    p_rician2=rician(128,128);

    p_rician3=rician(128,256);

    figure(4);

    semilogy(snr_db,p_rician1,'-^',snr_db,p_rician2,'-*',snr_db,p_rician3,'-+');

    title('BER in rician fading channel K=0(number of users=64)');

    xlabel('10*log10SNR');

    ylabel('Average error probability');

    legand('M=64 rician','M=128 rician','M=256 rician');

  • 83

    OUTPUT:

  • 84

    RESULT:

    Thus the performance evaluation of CDMA system was done by using MATLAB.