Beruflich Dokumente
Kultur Dokumente
Contents
Page No.
3 6 14 16 19 24 26 27 29 31
Sr Title of the Experiment No. 1. Implementation of Delta Modulation and Demodulation using Matlab. 2. Implementation of Pulse Data Coding techniques for various formats using Matlab 3. Implementation of Amplitude Shift Keying Modulator and Demodulator using Matlab. 4. Implementation of Time Division Multiplexing system using Matlab. 5. Implementation of Pulse Code Modulation and Demodulation using Matlab. 6. To find reflection coefficient and VSWR using slotted line. 7. To measure directivity, coupling coefficient and isolation of a Directional coupler. 8. Implementation of Frequency Shift Keying Modulator and Demodulator using Matlab 9. To measure Radiation pattern and Gain of an horn antenna. 10. To determine the guide wavelength and frequency using slotted line.
PRACTICAL NO 1
Aim
Implementation of delta modulation and demodulation using matlab.
Equipments Required Software Matlab. Learning Objectives - : To be familiar with concept of delta modulation and demodulation with the use of MATLAB.
THEORY Delta Modulation:
Delta modulation (DM or -modulation) is an analog-to- digital and digital-to- analog signal conversion technique used for transmission of voice information where quality is not of primary importance. DM is the simplest form of differential pulse-code modulation (DPCM) where the difference between successive samples is encoded into n-bit data streams. In delta modulation, the transmitted data is reduced to a 1-bit data stream. This scheme sends only the difference between pulses, if the pulse at time tn+1 is higher in amplitude value than the pulse at time tn, then a single bit, say a 1 , is used to indicate the positive value. If the pulse is lower in value, resulting in a negative value, a 0 is used. This scheme works well for small changes in signal values between samples. If changes in amplitude are large, this will result in large errors.
Program Code :
% *** Function for Delta Modulation*********** clc; clear all; close all; td=0.002; % original sampling rate rate 500 t=0:td:1.; % time interval of 1 sec xsig=sin(2*pi*t)-sin(6*pi*t); % 1hz +3 hz sinusoidals Lsig=length(xsig); ts=0.02; % sampling rate Delta1=0.5; % obtaind the DM signal % plot the original signal and DM signal in time domain if (rem(ts/td,1)==0) nfac=round(ts/td); p_zoh=ones(1,nfac); s_down=downsample(xsig,nfac); Num_it=length(s_down); s_DMout1(1)=Delta1/2; for k=2:Num_it xvar=s_DMout1(k-1); s_DMout1(k)=xvar+Delta1*sign(s_down(k-1)-xvar); end s_DMout1=kron(s_DMout1,p_zoh); else warning('Error! ts/td is not an integer!'); s_DMout1=[]; end figure(1); sfig1=plot(t,xsig,'k',t,s_DMout1(1:Lsig),'r'); set(sfig1,'Linewidth',2); title('Signal and its delta modulation') xlabel('time(sec.)'); grid on
Results:
PRACTICAL NO 2
Aim
Implementation of pulse data coding techniques for various formats using Matlab.
Equipments Required Software Matlab. Learning Objectives - : To be familiar with concept of pulse data coding techniques with the use of MATLAB.
THEORY Data Encoding Methods:
We can roughly divide line coding schemes into five broad categories, as shown in figure: 2.1.
In NRZ-L the level of the voltage determines the value of the bit. In NRZ-I the inversion or the lack of inversion determines the value of the bit
In Manchester and differential Manchester encoding, the transition at the middle of the bit is used for synchronization The minimum bandwidth of Manchester and differential Manchester is 2 times that of NRZ
Pseudoternary
Pesudotenary :
Same as AMI, but 1 bit is encoded as a zero voltage and the 0 bit is encoded as alternating positive and negative voltages.
Multilevel Schemes:
The desire to increase the data speed or decrease the required bandwidth has resulted in the creation of many schemes. The goal is to increase the number of bits per baud by encoding a pattern of m data elements into a pattern of n signal elements. Different types of signal elements can be allowing different signal levels. n If we have L different levels, then we can produce L combinations of signal patterns. The data element and signal element relation is mBnL coding, where m is the length of the binary pattern, B means binary data, n is the length of the signal pattern, and L is the number of levels in the signaling. B (binary, L=2), T (tenary, L=3), and Q (quaternary, L=4). In mBnL schemes, a pattern of m data elements is encoded as a pattern of n signal m n elements in which 2 L
2B1Q is used in DSL (digital subscriber line) technology to provide a high-speed connection to the Internet by using subscriber telephone lines
8B6T:
Eight binary, six ternary (8B6T) This code is used with 100BASE-4T cable. Encode a pattern of 8 bits as a pattern of 6 signal elements, where the signal has three levels (ternary). 8 6 2 =256 different data patterns and 3 =478 different signal patterns. (The mapping is shown in Appendix D.) There are 478-256=222 redundant signal elements that provide synchronization and error detection. Part of the redundancy is also used to provide DC (direct-current) balance. + (positive signal), - (negative signal), and 0 (lack of signal) notation. To make whole stream DC-balanced, the sender keeps track of the weight
4D-PAM5 :
Four-dimensional five-level pulse amplitude modulation (4D-PAM5) 4D means that data is sent over four wires at the same time. It uses five voltage levels, such as -2, -1, 0, 1, and 2. The level 0 is used only for forward error detection. If we assume that the code is just one-dimensional, the four levels create something similar to 8B4Q.
The worst signal rate for this imaginary one-dimensional version is Nx4/8, or N/2. 4D-PAM5 sends data over four channels (four wires). This means the signal rate can be reduced to N/8. All 8 bits can be fed into a wire simultaneously and sent by using one signal element. Gigabit Ethernet use this technique to send 1-Gbps data over four copper cables that can handle 1Gbps/8 = 125Mbaud
10
Matlab code:
clc; clear all; close all; x=-4:4; % s=input('Enter the binary sequence: '); s=[1 0 1 0 0 1 1]; sl=length(s); vm = 2; for i=1:sl for n=(i-1)*100+1:i*100 inp(n)=vm*s(1,i); end end subplot(6,1,1); inp1 = plot(inp); axis([1 n+2 -4 4]); set(inp1,'Color','red','LineWidth',3) title('Input Sequence'); grid on; % unipolar NRZ for i=1:sl for n=(i-1)*100+1:i*100 unrz(n)=vm*s(1,i); end end subplot(6,1,2); unrz1 = plot(unrz); axis([1 n+2 -4 4]); set(unrz1,'Color','red','LineWidth',3) title('Unipolar NRZ'); grid on; %Bipolar NRZ for i=1:sl for n=(i-1)*100+1:i*100
11
if s(1,i)==1 bpnrz(n)=vm; else if s(1,i)==0 bpnrz(n)=-vm; end end end end subplot(6,1,3); bpnrz1 = plot(bpnrz); axis([1 n+2 -4 4]); set(bpnrz1,'Color','red','LineWidth',3) title('Bipolar NRZ'); grid on; % Polar NRZ for i=1:sl for n=(i-1)*100+1:i*100 if s(1,i)==1 pnrz(n)=vm/2; else if s(1,i)==0 pnrz(n)=-vm/2; end end end end subplot(6,1,4); pnrz1 = plot(pnrz); axis([1 n+2 -4 4]); set(pnrz1,'Color','red','LineWidth',3) title('Ploar NRZ'); grid on; % AMI (Alternet mark Inversion) am1=1; for i=1:sl if s(1,i)==1 if am1==1 for n=(i-1)*100+1:i*100 ami(n)=vm; end am1=am1+1; else if am1==2 for n=(i-1)*100+1:i*100 ami(n)=-vm; end am1=1; end end end end subplot(6,1,5); am11 = plot(ami); axis([1 n+2 -4 4]); set(am11,'Color','red','LineWidth',3) title('AMI'); grid on; % MANCHESTER i2=0; for i=1:sl if s(1,i)==1
12
for n=(i-1)*100+1:i*100 if i2<50 manch(n)=vm/2; else if (i2>49&&i2<100) manch(n)=-vm/2; end end i2=i2+1; end i2=0; else for n=(i-1)*100+1:i*100 if i2<50 manch(n)=-vm/2; else if (i2>49&&i2<100) manch(n)=vm/2; end end i2=i2+1; end i2=0; end end subplot(6,1,6); manch1 = plot(manch); axis([1 n+2 -4 4]); set(manch1,'Color','red','LineWidth',3) title('MANCHESTER'); grid on;
Results:-
PRACTICAL NO 3
Aim
Implementation of amplitude shift keying modulator and demodulator using matlab.
Equipments Required Software Matlab. Learning Objectives - : To be familiar with concept of amplitude shift keying with the use of MATLAB.
THEORY ASK (amplitude shift keying) modulator:
Amplitude-shift keying (ASK) is a form of modulation that represents digital data as variations in the amplitude of a carrier wave. The amplitude of an analog carrier signal varies in accordance with the bit stream (modulating signal), keeping frequency and phase constant. The level of amplitude can be used to represent binary logic 0s and 1s. We can think of a carrier signal as an ON or OFF switch. In the modulated signal, logic 0 is represented by the absence of a carrier, thus giving OFF/ON keying operation and hence the name given. ASK is implemented by changing the amplitude of a carrier signal to reflect amplitude levels in the digital signal. For example: a digital 1 could not affect the signal, whereas a digital 0 would, by making it zero. The line encoding will determine the values of the analog waveform to reflect the digital data being carried.
14
Matlab Code :
clc; clear all; close all; s1=[1 0 1 0 1 1]; %input sequence ls=length(s1); %calculate input size fc=30; %Carrier frequency for i=1:ls amp=s1(1,i); for t=(i-1)*100+1:i*100 x(t)=amp*cos(2*pi*fc*t/1000); %ask signal end end % plotting output signal plot(x); title('ask') ylabel('Amplitude---------->'); xlabel('Time--------->'); grid on; Results -
15
PRACTICAL NO 4
Aim
Implementation of Time Division Multiplexing system using matlab.
Equipments Required Software Matlab. Learning Objectives - : To be familiar with concept of time division multiplexing with the use of MATLAB.
THEORY
Time-division multiplexing (TDM) is a type of digital or (rarely) analog multiplexing in which two or more signals or bit streams are transferred apparently simultaneously as sub-channels in one communication channel, but are physically taking turns on the channel. The time domain is divided into several recurrent timeslots of fixed length, one for each sub-channel. A sample byte or data block of sub-channel 1 is transmitted during timeslot 1, sub-channel 2 during timeslot 2, etc. One TDM frame consists of one timeslot per sub-channel plus a synchronization channel and sometimes error correction channel before the synchronization. After the last sub-channel, error correction, and synchronization, the cycle starts all over again with a new frame, starting with the second sample, byte or data block from sub-channel 1, etc. For multiple signals to share one medium, the medium must somehow be divided, giving each signal a portion of the total bandwidth. The current techniques that can accomplish this include Frequency division multiplexing (FDM) Time division multiplexing (TDM)-Synchronous vs Statistical1 Wavelength division multiplexing (WDM), Code division multiplexing (CDM).
Multiplexing:
Two or more simultaneous transmissions on a single circuit.
Figure 5 Multiplexing
Time Division Multiplexing:
Sharing of the signal is accomplished by dividing available transmission time on a medium among users. Digital signaling is used exclusively. Time division multiplexing comes in two basic forms: 1. Synchronous time division multiplexing, and 2. Statistical, or asynchronous time division multiplexing.
16
T-1 and ISDN telephone lines are common examples of synchronous time division multiplexing. If one device generates data at a faster rate than other devices, then the multiplexor must either sample the incoming data stream from that device more often than it samples the other devices, or buffer the faster incoming stream. If a device has nothing to transmit, the multiplexor must still insert a piece of data from that device into the multiplexed stream. So that the receiver may stay synchronized with the incoming data stream, the transmitting multiplexor can insert alternating 1s and 0s into the data stream. Three types popular today of Synchronous Time Division Multiplexing: T-1 multiplexing (the classic) ISDN multiplexing SONET (Synchronous Optical NETwork)
The T1 (1.54 Mbps) multiplexor stream is a continuous series of frames of both digitized data and voice channels. The ISDN multiplexor stream is also a continuous stream of frames. Each frame contains various control and sync information SONET massive data rates
17
xlabel('Time---------->'); % After sampling of analog input subplot(2,3,4); stem(sig1,'r'); grid on; title('sampled signal 1'); ylabel('Amplitude---------->'); xlabel('Time--------->'); subplot(2,3,5); stem(sig2,'g'); grid on; title('sampled signal 2'); ylabel('Amplitude---------->'); xlabel('Time---------->'); % computing TDM for i=1:l sig(1,i)=sig1(i); sig(2,i)=sig2(i); end tdmsig=reshape(sig,1,2*l); subplot(2,3,[3,6]); stem(tdmsig); grid on; title('TDM Signal'); ylabel('Amplitude---------->'); xlabel('Time--------->');
Results:
PRACTICAL NO 5
Aim
Implementation of pulse code modulation and demodulation using matlab.
Equipments Required Software Matlab. Learning Objectives - : To be familiar with concept of pulse coded modulation and demodulation with the use of MATLAB.
THEORY ANALOG-TO-DIGITAL CONVERSION:
A digital signal is superior to an analog signal because it is more robust to noise and can easily be recovered, corrected and amplified. For this reason, the tendency today is to change an analog signal to digital data. In this section we describe two techniques, pulse code modulation and delta modulation
Before we sample, we have to filter the signal to limit the maximum frequency of the signal as it affects the sampling rate. Filtering should ensure that we do not distort the signal, ie remove high frequency components that affect the signal shape.
19
Sampling:
Analog signal is sampled every TS secs. Ts is referred to as the sampling interval. fs = 1/Ts is called the sampling rate or sampling frequency. There are 3 sampling methods: Ideal - an impulse at each sampling instant Natural - a pulse of short width with varying amplitude Flattop - sample and hold, like natural but with single amplitude value The process is referred to as pulse amplitude modulation PAM and the outcome is a signal with analog (non integer) values
According to the Nyquist theorem, the sampling rate must be at least 2 times the highest frequency contained in the signal.
Quantization:
Sampling results in a series of pulses of varying amplitude values ranging between two limits: a min and a max. The amplitude values are infinite between the two limits. We need to map the infinite amplitude values onto a finite set of known values. This is achieved by dividing the distance between min and max into L zones, each of height = (max - min)/L
Quantization Levels:
The midpoint of each zone is assigned a value from 0 to L-1 (resulting in L values) Each sample falling in a zone is then approximated to the value of the midpoint.
Quantization Error:
When a signal is quantized, we introduce an error - the coded signal is an approximation of the actual amplitude value. The difference between actual and coded value (midpoint) is referred to as the quantization error. The more zones, the smaller which results in smaller errors. BUT, the more zones the more bits required to encode the samples -> higher bit rate
20
PCM Decoder:
To recover an analog signal from a digitized signal we follow the following steps: We use a hold circuit that holds the amplitude value of a pulse till the next pulse arrives. We pass this signal through a low pass filter with a cutoff frequency that is equal to the highest frequency in the pre-sampled signal. The higher the value of L, the less distorted a signal is recovered.
21
for i=1:l1 if(ind(i)~=0% To make index as binary decimal so started from 0 to N ind(i)=ind(i)-1; end i=i+1; end for i=1:l2 if(q(i)==vmin-(del/2))% To make quantize value in between the levels q(i)=vmin+(del/2); end end % Encoding figure code=de2bi(ind,'left-msb'); % Cnvert the decimal to binary k=1; for i=1:l1 for j=1:n coded(k)=code(i,j);% convert code matrix to a coded row vector j=j+1; k=k+1; end i=i+1; end % plottings subplot(2,1,1); plot(s); % Display the encoded signal title('Input Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); grid on; subplot(2,1,2);
22
stairs(coded); signal axis([0 100 -2 3]); title('Encoded Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); grid on;
Results: Input: Enter n value for n-bit PCM system : 5 Enter number of samples in a period : 20
23
PRACTICAL NO 6
Aim
To find reflection coefficient and VSWR using slotted line.
Equipments Required Microwave Bench, CRO, Klystron tube and generator. Learning Objectives - : To be familiar with concept of VSWR.
.
is a complex number that describes both the magnitude and the phase shift of the reflection. The simplest cases, when the imaginary part of is zero, are:
For the calculation of VSWR, only the magnitude of , denoted by , is of interest. Therefore, we define
= | |
24
At some points along the line the two waves interfere constructively, and the resulting amplitude Vmax is the sum of their amplitudes:
At other points, the waves interfere destructively, and the resulting amplitude Vmin is the difference between their amplitudes:
As , the magnitude of , always falls in the range [0,1], the VSWR is always +1.
The SWR can also be defined as the ratio of the maximum amplitude of the electric field strength to its minimum amplitude, i.e. Emax / Emin
25
PRACTICAL NO 7
Aim
Measurement of Directivity and coupling coefficient and isolation of a directional coupler.
Equipments Required Microwave Bench, CRO, Klystron tube and generator. Learning Objectives - : To be familiar with concept of Directional coupler and its various applications in microwave circuits.
THEORY Directional coupler:
One specific class of power divider is the directional coupler. This is a four port device that samples the power flowing into port 1 coupled in to port 3 (the coupled port) with the remainder of the power delivered to port 2 (the through port) and no power delivered to the isolated port.
Usually the isolated port is terminated within the coupler casing. In such case, the coupler appears to be a three port device. In ideal case no power is delivered to port 4 (the isolated port). Directional couplers are described by three specifications: C Coupling (C) - The ratio of input power to the couple power. Directivity (D)- The ratio of coupled power to the power at the isolated port. Isolation (I) The ratio of input power to power out of the isolated port.
P
10log
P
D 10log
3
P
I 10log
1
C dB
P4
P4
Ideally Directivity should be infinite but is mostly between 30-35 dB If all ports matched (S 11=S22=S33= S44=0), symmetry and S 14=S23=0 to be satisfied
Results:
S/N P1 P2 P3 P4 C D I
PRACTICAL 8 Aim
Implementation of frequency shift keying modulator and demodulator using matlab.
Equipments Required Software Matlab Learning Objectives - : To be familiar with concept of digital modulation techniques.
THEORY FSK (frequency shift keying) modulator:
Frequency-shift keying (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 literally implies using a pair of discrete frequencies to transmit binary (0s and 1s) information.
Applications:
Most early telephone-line modems used audio frequency-shift keying to send and receive data, up to rates of about 300 bits per second. Matlab Code: clc; clear all; close all; s1=[1 0 1 0 1 1]; %input sequence ls=length(s1); %calculate input size fc=30; %Carrier frequency for i=1:ls amp=s1(1,i); for t=(i-1)*100+1:i*100 x(t)=amp*cos(2*pi*fc*t/1000); %ask signal end end % plotting output signal plot(x); title('ask') ylabel('Amplitude---------->'); xlabel('Time--------->'); grid on
27
Results: -
28
PRACTICAL NO 9
Aim
To measure the radiation pattern and gain of an horn antenna.
Equipments Required Microwave Bench, CRO, Klystron tube and generator, horn antenna, stand for placing antenna at the receiver end. Learning Objectives - : To be familiar with concept of gain of horn antenna.
THEORY
The radiation pattern of the antenna is a plot of its field intensity or the radiated power as a function of or at a constant distance from radiating source. The 3-dB beamwidth is the angle between two points on the main lobe where the power intensity is half the maximum power intensity. The 3-dB bandwidth can be directly calculated from the radiation pattern of the antenna.
PROCEDURE:
RADIATION PATTERN MEASUREMENT: 1. Obtain a maximum deflection on the power meter connected to the receiving antenna by adjusting the variable attenuator. 2. Tune the frequency meter to determine the frequency of operation. After the frequency has been determined detune the frequency meter. 3. Turn the receiving antenna to right in steps of 5 degrees and note the power meter reading. 4. Repeat the above step by turning the antenna towards left. 5. Plot the radiation pattern as power meter reading vs degrees and determine the 3-dB beamwidth of the antenna. GAIN MEASUREMENT: To calculate gain we use two identical antennas for transmission and reception. Using the Friis equation, 2 2 Pr =Pt Gt / (4R ) we have: G=(4R/ ) * sqrt(Pr/Pt)
29
30
o 2
g2
c 2
where ois free space wavelength, g is guide wavelength and c is cutoff wavelength For TE10 mode, c = 2a where a is broad dimension of waveguide. PROCEDURE % Set up the components and equipments as shown in Fig. 1. % Set the variable attenuator at maximum position. % Keep the control knobs of VSWR meter as below: Range db Input Switch Meter switch Gain (Coarse & fine)
50 db position Crystal low Impedance Normal position Mid Position
Off AM Fully anticlockwise Fully clockwise Around fully clockwise Around Mid Position
% Switch ON the Klystron power supply, VSWR Meter and cooling fan. % Rotate the meter switch of power supply to beam voltage position and set beam voltage at with help of beam voltage knob. % Adjust the reflector voltage to get some deflection in VSWR meter. % Maximize the deflection with AM amplitude and frequency control knob of power supply. % Tune the plunger of Klystron mount for maximum deflection. % Tune the reflector voltage knob for maximum deflection. % Tune the probe for maximum deflection in VSWR meter. % Tune the frequency meter knob to get a dip on the VSWR scale and note down the frequency directly from frequency meter. % Replace the termination with movable short, and detune the frequency meter. % Move probe along with the slotted line, the deflection in VSWR meter will vary. Move the probe to a minimum deflection position, to get accurate reading; it is necessary to increase the VSWR meter range db switch to higher position. Note and record the probe position. % Move the probe to next minimum position and record the probe position again. % Calculate the guide wavelength as twice the distance between two successive minimum position obtained as above. % Measure the waveguide inner broad dimension a which will be around 2.286cm for X-band. % Calculate the frequency by following equation:
% Verify with frequency obtained by frequency meter. % Above experiment can be verified at different frequencies. % Record the experimental results in a tabulated form as per format given below: -----------------------------------------------------------------------------------------------------------------------------Guided wavelength measured Calculated
fo
Phase velocity
(fo g ) =vp
Remark
-----------------------------------------------------------------------------------------------------------------------------(N.B. Same experiment can be done using Gunn diode as a microwave power source)
Learning Outcomes: To be written by students in 50-70 words
32
33