You are on page 1of 47

DHANALAKSHMI SRINIVASAN COLLEGE OF

ENGINEERINGAND TECHNOLOGY
ECR, MAMALLAPURAM,CHENNAI-603104.

DEPARTMENT OF ELECTRONICS
AND
COMMUNICATION

M.E - COMMUNICATION SYSTEMS

CU4211-WIRELESS COMMUNICATION LABORATORY

LAB MANUAL

Regulations 2021

Branch :M.E-CS

Year & Semester :1st Year & 2nd Semester


INDEX
LIST OF EXPERIMENTS

S.NO Date Name of the Experiments Page no Mark Signature

1 SPECTRAL CHARACTERISATIONOF
COMMUNICATION SIGNALS(USING
SPECTRUM ANALYZER)

2 DESIGN AND ANALYSIS OF


SPECTRUM ESTIMATORS
(BARTLETT, WELCH)
3 DESIGN AND ANALYSIS OF DIGITAL
MODULATION TECHNIQUES ON AN
SDR PLATFORM

4 DESIGN AND PERFORMANCE


ANALYSIS OF ERROR
CONTROL ENCODER AND
DECODER(BLOCK AND
CONVOLUTIONAL CODES)
5 WIRELES CHANNEL EQUALIZER
DESIGN USING DSP(ZF/LMS/RLS)

6 DESIGN AND SIMULATION OF


MICROSTRIPPATCH ANTENNA

7 ANALYSIS OF RADIATION
PATTERN AND
MEASUREMENT

8 NOISE CANCELLATION

9 NOISE CANCELLATION

10 MULTIRATE SIGNAL
PROCESSING
EX N O :
DATE :
SPECTRAL CHARACTERISATION OF COMMUNICATION
SIGNALS (USING SPECTRUM ANALYZER)

AIM:
Analyze the spectral content of a simple sign
EQUIPMENTS REQUIRED:

The equipment used in this experiment are:

Oscilloscope: Rohde & Schwarz RTM


3004Function Generator: Tektronix
AFG 3022B

THEORY:

A waveform representing amplitude, as a function of time, is called a time domain display. It is also
possiblefor a waveform to represent amplitude as a function of frequency. This is called a frequency
domain display.A Spectrum Analyzer is an instrument, which can display the frequency domain
of a signal. However, the RTM3004 Oscilloscope has the capability of producing both time domain
and frequency domain displays.
A sine wave is the simplest signal for spectral analysis. The amplitude of the sine wave can be
determinedon the vertical scale and the frequency can be determined on the horizontal scale.
The units of amplitude used in this experiment will be dBV, which is dB relative to 1 VRMS (0 dBV =
1VRMS), according to the formula:

Vsignal
dBV = 20log( ) (1.1)
Vref

where Vsignal is the RMS voltage of the signal and Vref = 1 volt RMS.
Another common unit of amplitude used for spectrum analysis is dBm, which is dB relative to 1
milliwatt, according to the formula:

Psignal
dBm = 10log( ) (1.2)
Pref

where Psignal is the power of the signal in milliwatts and Pref = 1 mW.
PROCEDURE
a. Set the Function Generator for a sine wave output with a frequency of 4 KHz. Set the amplitude to 2 voltpeak-to-
peak with zero DC offset.

Oscilloscope Reset:
b. Connect the Channel 1 output of the Function Generator to Channel 1 input of the Oscilloscope using aBNC to
BNC cable. Turn on the Channel 1 output of the Function Generator.

c. Set the oscilloscope to the default state (PRESET).


d. Before beginning the exercise, configure the oscilloscope to use the maximum sample rate.

Switch the oscilloscope to MAX. SA. RATE mode. You can achieve that by clicking on the second
upper label near C1 and change the GSa/s Acquire Mode to High Resolution after a menu
appears on the right of the screen.

e. Press Auto Set.

This sets the vertical, horizontal, and trigger for a stable display of the waveform.

f. Press Channel 1 button to display the menu on the right side of the screen and select an Input Impedanceof 50 Ohms
under the Termination label.

For this experiment, the output of the Function Generator must be terminated into a 50 Ohm

The time domain waveform should now be display


View the frequency domain waveform of the input signal on the Oscilloscope:
a. Change the Horizontal Scale to display 10 cycles. You can achieve that either by rotating the second upper knob
until 10 cycles appear on the screen. Or by double clicking on the top pane where the the valueof seconds per division
appears (the label to the left of Run). This is called the Timebase. A scroll menu containing specified durations per
division appear.
Since, there are a total of 12 horizontal divisions and a total of 10 vertical divisions. For a 4KH𝑥
sine wave where the center of the screen is at 0s time. You can find the time duration per division
:
Each cycle of the sine wave is

But the total number of horizontal divisions is 12. Then, for 10 cycles to appear we need the time
duration per division (i.e., Timebase) to be 2500/12 = 208.33µs/div. But the available
durations per division are specified. So pick the value appearing in the scroll menu just above the
calculated valued, that is 500µs. Or click on the menu button and adjust the value to the
calculated one 208.33µs/div.

b. Press on the FFT icon touch button on the right top pane.

The screen is split into two panes; see Fig. 1.1. The upper pane (2) displays the previously defined
voltage-time trace for the measured signal and the settings for the horizontal system. That is, the
waveform in the time domain. The zoom and position information is displayed in between the two
panes (3). Only the signalsegment that is displayed on the monitor and bound by the two vertical
white lines is used for the FFT.
The FFT displays the frequency domain by expressing the input signal as a combination of
simple sig- nals and produces a waveform to display the amplitude verses frequency of the
component frequenciesof the input signal.

c. Now, either
i) Double press the FFT button under the Analysis grouping and a menu will appear on the right of thescreen
(Fig. 1.2),
ii) or by clicking on the FFT label on the bottom pane, a menu will appear (Fig. 1.3), then Press on Menu.The right
menu will appear (Fig. 1.2).

On this right pane menu ,these should be selected, if not already set:

FFT Source: C1 (Channel


1)FFT Window: Hanning
Vertical Scale: dBV RMS

d. First, adjust the time duration per division (timebase) on the top pane from 833.33µs/div to 200ms/div
and then select a maximum signal segment for the FFT.
Span shows the size of the currently displayed frequency range. The span, time- base and selected segment
are directly linked to one another. As the selection for the timebase and the range in the time domain
displayed between the two vertical lines increases, so too decreases the frequency band that can be set.
Center defines the frequency at the center ofthe segment displayed on the monitor. The minimum step
size can be set indirectly via the number of points.

e. Set now the value of the RBW (5 in Fig. 1.4) to the maximum (i.e. by clicking on RBW on the bar betweenthe two
screen and adjusting the value to the maximum allowed).
f. On the bar between the two panes that display time and frequency domains respectively, set Start (1 in Fig. 1.4)
value to 0, you can achieve that by clicking on the Start label where calculator form menu appearsand you can set the
value. This will be the value of the minimum frequency displayed.
g. Similarly, adjust the Stop (2 in Fig. 1.4) value to a value above 4KH𝑥, let’s say 8KH𝑥. N.B. Usuallyyou need
this value of 8KH𝑥 to fall between the minimum value and maximum value allowed for the Stop value. Therefore, you
need to readjust the time duration per division (timebase) so that is satisfied. Adjustthe center frequency to 4KH𝑥
you can set this value through clicking on Center in the middle bar. See the blue frame comments.
Using the Cursors:
First, for a better view of the frequency domain screen. Move the double arrow bar of the lower
screen upwards so that the frequency domain is the only display on the oscilloscope. There are a
variety of ways to measure the amplitude. One method is to use the Cursors.
a. Press the Cursors button twice on the front panel to activate the cursors. At the first click a bar will appearshowing
the values at the used cursors. After the second click a right menu will appear. On the Type, set toVertical & Horizontal,
so that both types of cursors appear on the screen. Set the Source to FFT: Spectrum,so that the frequency domain
cursors appear.
Cursors 1 and 2 are the horizontal
cursors.Cursors 3 and 4 are the vertical
cursors.
Click on number 1 on the cursor line and move it to the desired point on the spectrum. Its peak
value in our case. The amplitude measured by the Cursor 1 is now displayed on the bar near label
L1 and the corresponding frequency value near label f1.
Taking a Measurement:
a. Decrease the amplitude of the Function Generator out− put to 10 dBV as measured in the
frequency domain display. Now, switch to the time domain display. Press on the measure button.
A menu will appearon the right of the screen. Set the Measure Place to 1. Turn the Measure 1 bar
to on. Choose the Type to the type of measurement (peak to peak). Read the peak-to-peak voltage
measurement that will appear onthe bottom left of the screen above the channels bar. Does this
measurement agree with the value that youcalculated in the Preparation?
Using the Zoom Feature:
a. Turn the time domain on again by pressing the CH1 button. Turn the Zoom on by pressing the
Zoom button. Press on the part of the signal you want to zoom in. By using the two fingers motion
that you use onthe i-pad for zooming, double-tap with two fingers to zoom in and back out so that
you can adjust the signalpart you want to inspect to the right resolutio

In your report, describe what you have learned in this experiment. Compare your experimental measure- ments with
the theoretical calculations. Remember to insert the picture that you saved as part of your report.Write all conclusions.
Follow the instructions listed in the Appendix regarding outline and required analysis.
RESULT:
Thus the spectral content of given simple signal is analyzed
EX NO: DESIGN AND ANALYSIS OF SPECTRUM ESTIMATORS
DATE :
(BARTLETT, WELCH)

AIM:
To Stimulate and Performance of Design and Analysis of Spectrum Estimators-
(Bartlett, Welch) by using MAT Lab.

SOFTWARE REQUIRED

PC with MATLAB 7.0.4 Software Package.

THEORY:
 To estimate the power spectral density of a wide-sense stationary random process.
 Recall that the power spectrum is the Fourier transform of the autocorrelation
sequence.
 For an ergodic process, the following holds.

Bartlett’s method
Averaging (same mean) a set of uncorrelated measurements of a random variable results
in a consistent estimate of its mean In other words: Variance of the sample mean is inversely
proportional to the number of measurements Hence this should also work here, by averaging
Periodograms

Welch’s Method
 Two modifications to Bartlett’s method
1) the subsequences are allowed to overlap
2) instead of Periodograms, modified Periodograms are averaged

 Assuming that successive sequences are offset by D points and that each sequence
is L points long, then the ith sequence is
 Thus, the overlap is L-D points and if K sequences cover the entire N data points,
then

Program For Bartlett Method

Function Px=Barlett (x, n Subseq)


L=Floor (Length (x)/n Subseq);
Px=0;
n 1=1;
for i=1: subseq
Px=Px+Periodogram (x(n1:n1+L-1))/n subseq;
n 1=n1+L;
end
end
close all;
clear;
clc;
%Generate the Discrete time Random process
X=[3 5 1 6 9 0.3-4-6 9-3.5];
Stem(x)
X=randn(1,50);
Stem(x)
%%%%%%%% Spectral Estimation
Px=barlett (x,3);
%%%% Plotting the Spectrum Estimation of Input Discrete Time Sequence
%figure, Plot (Px)
figure, Plot (10* log 10(px))
f=5*(0:1023)/1024;
figure plot f, (px)
Outputs
Program For Welch’s Method

Close all; Clear;


Clc;
rng default

n = 0:511;
x = cos(pi/3*n)+randn(size(n)); segmentLength
= 132;
[pxx,w] = pwelch(x,segmentLength);

plot(w/pi,10*log10(pxx))
xlabel('\omega / \pi')

Output

RESULT:
Thus, the Performance of Design and Analysis of Spectrum Estimators-(Bartlett, Welch) by
using MAT Lab.
EX NO:
DATE: DESIGN AND ANALYSIS OF DIGITAL MODULATION
TECHNIQUES ON AN SDR PLATFORM

Aim:

To write and simulate a MATLAB program to Generate and detect Binary Digital
ModulationTechnique (BASK).

Equipment Required:
 Computer
 Windows 7
 MATLAB 7

Algorithm:
BASK Modulation

1. Clear the command window, workspace and close the figure windows.
2. Generate carrier signal.
3. Generate message signal.
4. Generate ASK modulated signal.
5. Plot message signal, carrier signal and ASK modulated signal.

BASK Demodulation

1. Perform correlation of ASK signal with carrier to get decision variable.


2. Make decision to get demodulated binary data.
3. Plot the demodulated binary.

PROGRAM:

%%preliminaries
clc
clear all;
close all;
%%inputs
F1 =25;
F2 =5;
A =3;
t = 0:0.001:1;

%declaration of carrier signal


x = A.*cos(2 *pi*F1*t);
%declaration of message signal
u = A/2.*square(2*pi*F2*t)+A/2;
%declaration of ask modulated signal
v=x.*u;

%%plots
subplot(5,1,1)
plot (t,x);
xlabel('time')
ylabel ('amplitude')
title('carrier signal')
grid on;

subplot(5,1,2)
plot(t,u);
xlabel('time')
ylabel ('amplitude')
title('Message signal');
grid on;

subplot(5,1,3)
plot(t,v);
xlabel('time')
ylabel ('amplitude')
title('ASK modulated signal')
grid on;

%%demodulated carrier signal


c= v./u;
%plots
subplot (5,1,4)
plot(t,c);
xlabel('time')
ylabel ('amplitude')
title('carrrier signal')
grid on;
%demodulated original signal
o= v./x;
%plots
subplot (5,1,5)
plot(t,o);
xlabel('time')
ylabel ('amplitude')
title('original signal')
grid on;

OUTPUT:

RESULT:
Thus the program for BASK modulation and demodulation has been simulated in MATLAB and
necessary graphs were plotted.
EX NO:
DATE:
DESIGN AND PERFORMANCE ANALYSIS OF ERROR CONTROL
ENCODER AND DECODER(BLOCK AND CONVOLUTIONAL CODES)

AIM:
To simulate the generates Matrix, Code word, Parity check Matrix and error syndrome for
a (7, 4) cyclic code using MATLAB.

APPARATUS REQUIRED:
1. Personal computer.

2.MATLAB software.

PROGRAM FOR CONVOLUTIONAL CODE:

for n = 1:length(EbNoVec)
% Convert Eb/No to SNR
snrdB = EbNoVec(n) + 10*log10(k*rate);
% Noise variance calculation for unity average signal power.
noiseVar = 10.^(-snrdB/10);
% Reset the error and bit counters
[numErrsSoft,numErrsHard,numBits] = deal(0);

while numErrsSoft < 100 && numBits < 1e7


% Generate binary data and convert to symbols
dataIn = randi([0 1],numSymPerFrame*k,1);

% Convolutionally encode the data


dataEnc = convenc(dataIn,trellis);

% QAM modulate
txSig = qammod(dataEnc,M,'InputType','bit','UnitAveragePower',true);

% Pass through AWGN channel


rxSig = awgn(txSig,snrdB,'measured');

% Demodulate the noisy signal using hard decision (bit) and


% soft decision (approximate LLR) approaches.
rxDataHard = qamdemod(rxSig,M,'OutputType','bit','UnitAveragePower',true);
rxDataSoft = qamdemod(rxSig,M,'OutputType','approxllr', ...
'UnitAveragePower',true,'NoiseVariance',noiseVar);

% Viterbi decode the demodulated data


dataHard = vitdec(rxDataHard,trellis,tbl,'cont','hard');
dataSoft = vitdec(rxDataSoft,trellis,tbl,'cont','unquant');

% Calculate the number of bit errors in the frame. Adjust for the
% decoding delay, which is equal to the traceback depth.
numErrsInFrameHard = biterr(dataIn(1:end-tbl),dataHard(tbl+1:end));
numErrsInFrameSoft = biterr(dataIn(1:end-tbl),dataSoft(tbl+1:end));

% Increment the error and bit counters


numErrsHard = numErrsHard + numErrsInFrameHard;
numErrsSoft = numErrsSoft + numErrsInFrameSoft;
numBits = numBits + numSymPerFrame*k;

end
Plot the estimated hard and soft BER data. Plot the theoretical performance for an uncoded64-QAM
channel.
semilogy(EbNoVec,[berEstSoft berEstHard],'-*')
hold on
semilogy(EbNoVec,berawgn(EbNoVec,'qam',M))
legend('Soft','Hard','Uncoded','location','best')
grid
xlabel('Eb/No (dB)')
ylabel('Bit Error Rate')

RESULT:

Thus the simulation for convolutional code is done using MATLAB


EX NO:
DATE:
WIRELESS CHANNEL EQUALIZER DESIGN
USING DSP(ZF/LMS/RLS)

AIM:
To design a Channel Equalizer (LMS, RLS) using MATLAB.
SOFTWARE REQUIRED:

 PC with MATLAB 7.0.4 Software Package.


THEORY:

ISI caused by multipath in bandlimited time dispersive channels distorts the transmitted
signal causing bit error at the receiver . ISI has been recognized as the major obstacle to light speed
data transmission over wireless channels. Equalization technique is used to compact ISI.

An equalizer is usually implemented at base band in a receiver. Since the band pass
waveforms represent the channel response demodulated signal, adaptive equalizer algorithms are
usually simulated and implemented at the baseband.

 Linear Equalizer:
In linear equalizer the current and past values of the received signal are linearly
weighed by equalizing co-efficient and summed to produce the output using the relation,

C(z)= ∑ Ck z-kk

 Zero Forcing Equalizer:


In such type of equalizer, it removes the complete ISI without taking it
consideration about the noise enhancement using this there is a substantial increment of
the noise power.

C(z)= h-1(z)

 Mean square error equalization:


Such type of equalizer attempts to minimize the total error between the slices input
and transmitted data symbol.
PROCEDURE:

(i) Give the system simulated parameters Fs number of bits maximum errors.
(ii) Give the modulated signal parameters.
(iii) Give the channel parameters.
(iv) Give the maximum likelihood sequence estimates (MLSE) parameter.
(v) Give the channel estimation parameters.
(vi)Construct RLS & LMS linear equalizers objects.
(vii) Run linear equalizer.

PROGRAM:

%Design of RLS Channel Equalizer


clear all;
close all;
clc;
hold off;
N=2000;
inp=randn(N,1);
n=randn(N,1);
[b,a]=butter(2,0.25);
Gz=tf(b,a,-1);
sysorder=10;
imp=[1;zeros(49,1)];
h=filter(b,a,imp);
h=h(1:sysorder);
y=lsim(Gz,inp);
n=n*std(y)/(10*std(n));
d=y+n;
totallength=size(d,1);
N=80;
lamda=0.9995;
delta=1e10;
P=delta*eye(sysorder);
w=zeros(sysorder,1);
for n=sysorder:N
u=inp(n:-1:n-sysorder+1);
phi=u'*P;
k=phi'/(lamda+phi*u);
y(n)=w'*u;
e(n)=d(n)-y(n);
w=w+k*e(n);
P=(P-k*phi)/lamda;
Recordedw(1:sysorder,n)=w;
end
for n=N+1:totallength
u=inp(n:-1:n-sysorder+1);
y(n)=w'*u;
e(n)=d(n)-y(n);
end
plot(d);
hold on;
plot(y,'r-');
title('System Output');
xlabel('Samples');
ylabel('True and Estmated Output');
figure;
semilogy(abs(e));
title('Error Curve');
xlabel('Samples');
ylabel('Error Value');

OUTPUT:

System Output
2.5

1.5

0.5

-0.5

-1

-1.5

-2
0 200 400 600 800 1000 1200 1400 1600 1800 2000
Samples
101

100

10-1

10-2

10-3

10-4

10-5
0 200 400 600 800 1000 1200 1400 1600 1800 2000
Samples

PROGRAM:

%Design of LMS Channel Equalizer


clear all;
close all;
clc;
hold off
sysorder = 5 ;
N=2000;
inp = randn(N,1);
n = randn(N,1);
[b,a] = butter(2,0.25);
h= [0.0976; 0.2873; 0.3360; 0.2210; 0.0964;];
Gz = tf(b,a,-1);
y = lsim(Gz,inp);
n = n * std(y)/(10*std(n));
d = y + n;
totallength=size(d,1);
N=60 ;
w = zeros ( sysorder , 1 ) ;
for n = sysorder : N
u = inp(n:-1:n-sysorder+1) ;
y(n)= w' * u;
e(n) = d(n) - y(n) ;
if n < 20
mu=0.32;
else
mu=0.15;
end
w = w + mu * u * e(n) ;
end

for n = N+1 : totallength


u = inp(n:-1:n-sysorder+1) ;
y(n) = w' * u ;
e(n) = d(n) - y(n) ;
end
hold on
plot(d)
plot(y,'r-');
legend('Actual weights','Estimated weights')
title('System Output');
xlabel('Samples');
ylabel('True and Estimated Output');
figure
semilogy((abs(e))) ;
title('Error Curve');
xlabel('Samples');
ylabel('Error Value');
figure
plot(h, 'k+')
hold on
plot(w, 'r*')
legend('Actual weights','Estimated weights')
title('Comparison of the Actual Weights and the Estimated Weights');
axis([0 6 0.05 0.35])
OUTPUT:
System Output
2

1.5

0.5

-0.5

-1

-1.5

-2
0 200 400 600 800 1000 1200 1400 1600 1800 2000
Samples

Error Curve
100

10-1

10-2

10-3

10-4

10-5
0 200 400 600 800 1000 1200 1400 1600 1800 2000
Samples
Comparison of the Actual Weights and the Estimated Weights

Actual weights
Estimated weights

0.3

0.25

0.2

0.15

0.1

0.05 0 1 2 3 4 5 6

PROGRAM:
%Design of LMS Channel Equalizer

close all;
clear all;
clc;
randn('state',sum(100*clock));
rand('state',sum(100*clock));
numPoints = 5000;
numTaps=5;
Mu=0.01;
r=randn(numPoints,1);
x=(r+1i*r);
% h=rand(numTaps,1);
h=[1 0.2 -0.08];
h=h/max(h);
d=filter(h,1,x);
w=[];
y=[];
n1=[];
e=[];
w=zeros(numTaps+1,1)+1i*zeros(numTaps+
1,1); for n=numTaps+1:numPoints
in=x(n:-1:n-
numTaps);
y(n)=w'*in;
e(n)=d(n)-y(n);
w=w+Mu*(real(e(n)*conj(in))-
1i*imag(e(n)*conj(in))); end
figure(10);
semilogy(abs(e));
title(['LMS Adaptation Learning Curve using Mu=',num2str(Mu)]);
xlabel('Iteration Number');
ylabel('Output Estimation Error in dB');

OUTPUT

LMS Adaptation Learning Curve using Mu=0.01


102

100

10-2

10-4

10-6

10-8

10-10

10-12

10-14

10-16

10-18 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
Iteration Number

RESULT:

Thus the Channel Equalizers (LMS, RLS) were designed with the given parameters using
MATLAB.
EX NO:
DATE:

DESIGN AND SIMULATION OF MICROSTRIP PATCH ANTENNAS

AIM:
To simulate and plot the radiation characteristics of microstrip antennas using MATLAB.

SOFTWARE REQUIRED:
 PC with MATLAB 7.0.4 Software Package.

THEORY:

Microstrip antennas are popular due to their light weight, comfort, ability and low cost.
These antennas are integrated with printed strip line feed networks and active devices. Rectangular
and Circular micro-strip resonant patches have been extensively in a variety of array
configurations. It consists of a radiating patch on one side of a dielectric substrate which has a
ground plane on the other side. The patch is generally made up of conducting material such as
copper or gold and can take any possible shape. The radiating patch and feed lines are usually
photo etched on the dielectric substrate.

It radiates primarily because of the fringing fields between the patch edge and the ground
plane. For antenna good performance, a thick dielectric substrate having a low dielectric constant
is desirable since this provides better efficiency, larger bandwidth and better radiation. Hence such
a configuration leads to a larger antenna size. Inorder to design a compact micro-strip patch
antenna substrates with higher dielectric constants must be used which are less efficient and result
in narrower bandwidth. Hence tradeoff must be realized between the antenna dimensions and
antenna performance.
PROCEDURE:

i) Initialize the dielectric constant and resonant frequency.


ii) Initialize the resonant frequency.
iii) Initialize the substrate values.
iv) Find the effective dielectric constant.
v) The field pattern is calculated.
vi) The performance graph between impedance frequency were plotted.
vii) The field pattern graph is also plotted.

PROGRAM:

clc; clear all;


er=input('input the dielecric constant value:');
fr=input('input the resonant frequency value in GHZ:');
h=input('input the height of microstrip in cm:');
c=30;
%width of microstrip
w=((sqrt(2/(er+1))*c)/(2*fr));
display('width of the microstrip in cm:');
display(w);
%effective dielectric constant
wbyh=w/h;
ereff=((er+1)/2+((1+12*1/wbyh)^-0.5));
display('effective dielectric constant of the microstrip:');
display(ereff);
%incremental length
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 of the microstrip in cm:');
display(leff);
for(f=10^8:10^8:10^11)
C= 47*10^-12;
L= 1542*10^-9*((sqrt(f)^-1));
Rs= 4.8*sqrt(f)*10^-6;
Re= 33.9*10^12*(f^-1);
impedance1= abs((i*2*pi*f*C)^-1);
impedance=abs(i*2*pi*f*L+Rs+Re*((1+i*2*pi*f*C*Re)^-1));
axis on;
grid on;
hold on;
axis auto;
xmin= 10^5;
xmax= 10^11;
ymin= 0;
ymax= 3.5;
axis([xmin,xmax,ymin,ymax]);
xlabel('frequency');
ylabel('impedance');
plot(f,impedance,'red');
plot(f,impedance1,'blue');
end
r=1;
Vo=300000000;
fr=fr*1000000000;
Lo=Vo/fr;
Ko=(2*pi)/Lo;
W=((Vo/(2*fr))*(sqrt(2/(er+1))));
X=(er+1)/2;
Y=(er-1)/2;
Z=sqrt(1/(1+(12*(h/W))));
Eer=X+(Y*Z);
a=W/h;
b=Eer+.3;
c=Eer-.258;
d=a+.264;
e=a+.8;
DL=h*.412*(b/c)*(d/e);
L=(Vo/(2*fr*sqrt(Eer)))-(2*DL);
Le=L+(2*DL);
disp('Width=');
disp(W);
disp('Effective Dielectric Constant Er(eff)=');
disp(DL);
disp('Length=');
disp(L);
disp('Effective length=');
disp(Le);
T=0:0.01:2*pi;
f=(Ko*h*sin(T))/2;
g=(Ko*W*cos(T))/2;
i=(sqrt(-1)*(Ko*W*Vo*exp(-(sqrt(-1))*Ko*r)))/(pi*r);
Et=(i*sin(T)*((sin(f)/f)*((sin(g))/g)));
figure(2);
subplot(1,1,1);
polar(T,Et);
xlabel('Angle ---- >');
ylabel('Field Strength----->');
title('FIELD PATTERN OF MICROSTRIP ANTENNA');

OUTPUT:
input the dielecric constant value:2.2
input the resonant frequency value in GHZ:10
input the height of microstrip in cm:0.1588
width of the microstrip in cm:
w = 1.1859
effective dielectric constant of the microstrip:
ereff = 2.2193
increase in length of the microstrip in cm:
inclen = 0.0785
length of the microstrip in cm
len =0.8499
effective of the microstrip in cm:
leff =1.0069
Performance of microstrip antenna

3.5

2.5

impedance
2

1.5

0.5

0
1 2 3 4 5 6 7 8 9 10

10
frequency x 10

FIELD PATTERN OF MICROSTRIP ANTENNA


90 150000000
120 60

100000000

150 30
50000000
Field Strength----- >

180 0

210 330

240 300
270
Angle---- >

RESULT:
Thus the Microstrip patch antenna was simulated and the field pattern was obtained
successfully
EX NO:
DATE: ANALYSIS OF RADIATION PATTERN
AND MEASUREMENT.

AIM:
To obtain radiation pattern of given dipole antenna using Matlab and to find the directivity,
HPBW, Directive gain and also to compute the main lobe to side lobe width.

APPARATUS REQUIRED:

 PC with MATLAB 7.0.4 Software Package.

THEORY:

A dipole antenna or double is the simplest and most widely used class of antenna. It consists
of two identical conductive elements such as metal wires or rods, which are usually bilaterally
symmetrical. The driving current from the transmitter is applied, or for receiving antennas the
output signal to the receiver is taken, between the two halves of the antenna. Each side of the
feedline to the transmitter or receiver is connected to one of the conductors. This contrasts with a
monopole antenna, which consists of a single rod or conductor with one side of the feedline
connected to it, and the other side connected to some type of ground. A common example of a
dipole is the "rabbit ears" television antenna found on broadcast television sets.

The most common form of dipole is two straight rods or wires oriented end to end on the
same axis, with the feedline connected to the two adjacent ends. This is the simplest type of antenna
from a theoretical point of view. Dipoles are resonant antennas, meaning that the elements serve
as resonators, with standing waves of radio current flowing back and forth between their ends. So
the length of the dipole elements is determined by the wavelength of the radio waves used. The
most common form is the half-wave dipole, in which each of the two rod elements is approximately
1/4 wavelength long, so the whole antenna is a half-wavelength long.Several different variations
of the dipole are also used, such as the folded dipole, short dipole, cage dipole, bow-tie, and
batwing antenna.

PROCEDURE:

i) Initialize the values.


ii) Initialize the theta value.
iii) Calculate the mean value through the formula.
iv) Note down the various angles and corresponding gain in dB of the antenna.
v) Plot the antenna radiation pattern using polar chart.

PROGRAM:

clc;

clear all;

close all;

len= input('Enter the length of the dipole antenna');

k= 2*pi;

m= k*len/2;

theta= 0:0.01*pi:2*pi;

p1= cos(m*(cos(theta)));

p2= p1-cos(m);

f1= [p2./(sin(theta)+eps)].^2;

polar(theta,abs(f1)./max(f1));

grid on;
CALCULATION:

(i) Half Power Beam Width (HPBW)


Half Power Beam Width (HPBW) = 2 (θHP-θm)
Where
θHP – Angle obtained at Half Power Gain
θm – Angle obtained at Maximum Gain

Obtained Maximum Gain =


Angle obtained at Maximum Gain (θ m) =
Obtained Half Power Gain = Emax/√2=
Angle obtained at Half Power Gain (θHP) =
Half Power Beam Width (HPBW) =
(ii) Directive Gain
Directive Gain is the Maximum Gain obtained in the desired direction of the
antenna radiation pattern.

Directive Gain = (Max. Gain obtained in the desired direction of the antenna) = dB
Directive Gain = dB

(iii) Main lobe to Side lobe width

Width obtained in the Major lobe

Main lobe to Side lobe width =

Width obtained in the Minor lobe

Main lobe to Side lobe width =


OUTPUT:

Enter the length of the dipole antenna= .5

radiation pattern of dipole antenna


90
120 60
0.8

0.6
150 30
0.4

0.2

180 0

210 330

240 300
270
RESULT:
Thus the radiation pattern of the given dipole antenna was obtained .

HPBW =

Directive Gain =

Main lobe to Side lobe width


EX.NO:

DATE:

NOISE CANCELLATION

AIM
To design and analyze the noise cancellation with different filters (Median filter and Adaptive
filter) using MATLAB.

EQUIPMENTS REQUIRED
 Computer
 Windows 7
 MATLAB 7
ALGORITHM
 Clear the command window, workspace and close the figure windows.
 Provide the number of unique senders/bit streams.
 Encode and transmit at the transmitter.
 Decode and reconstruct at the receiver.
 Stop the program.

PROGRAM

%Preliminaries
clc;
clear all;
close all;
% Noise Removal by Median filter
I = imread('eight.tif');
imshow(I)
J = imnoise(I,'salt & pepper',0.02);
figure, imshow(J)
K = filter2(fspecial('average',3),J)/255;
figure, imshow(K)
L = medfilt2(J,[3 3]);
figure, imshow(L)
%Noise Removal by Adaptive filter
RGB = imread('saturn.png');
I = rgb2gray(RGB);
figure, imshow(I)
J = imnoise(I,'gaussian',0,0.025);
figure
imshow(J)
K = wiener2(J,[5 5]);
figure, imshow(K)
OUTPUT

Noise removal by Median filter

Noise Removal by Adaptive filter (Wiener filter)

RESULT

Thus the design and performance of Noise cancellation and its output are verified successfully
EXP.NO:
DATE:

ECHO CANCELLATION
AIM

To write and simulate a MATLAB program to Noise Cancellation.


EQUIPMENT REQUIRED
 Computer
 Windows 7
 MATLAB 7

ALGORITHM
 Provide the input audio signal.
 Add an echo to the input signal.
 Remove echo from audio signal.
 Label the figures.
 Stop the program.

PROGRAM

clc;
clear all;
close all;
%Reading the original audio signal
fs=44100;
y=audioread('nokia.mp3');
%Playing the original song
p=audioplayer(y,fs);
plot(y);
play(p);
% stop(p)
%%
% play(p);
% stop(p);
%Adding echo
num=[1,zeros(1,4800),0.8];
den=[1];
x=filter(num,den,y);
p1=audioplayer(x,fs);
figure
plot(x);
play(p1);
%%
% stop(p);
%Removing echo
den=[1,zeros(1,4800),0.8];
num=[1];
r=filter(num,den,x);
p2=audioplayer(r,fs);
figure
plot(r)
play(p2);
%%stop(p);
OUTPUT

Original Audio Signal

Echo added with original signal

Echo Removal Signal

RESULT
Thus the audio signal with adding and removal of echo signal is verified
successfully withMATLAB SOFTWARE.
MULTIRATE SIGNAL PROCESSING

EX.NO:
DATE :

AIM
To perform multirate signal processing by upsampling and downsampling using
MATLA
B.

EQUIPMENTS REQUIRED
 Computer
 Windows 7
 MATLAB 7
ALGORITHM
 Clear the command window, workspace and close the figure windows.
 Provide the input signal for sampling
 Convert the signal using upsampling process by factor I
 Convert the signal using upsampling process by factor D
 Plot the amplitude response and time response curves.
 Label the figure.
 Stop the program

PROGRAM

% Downsampling and Upsampling


%% Preliminaries
clc;
close
all; clear
all;

%% Inputs
x=input('Enter the input sequence x(n) : ');
D=input('Enter the Decimation factor D : ');
I=input('Enter the Interpolation factor I : ');

%% Downsampling
disp('Downsampled Signal');
xD=downsample(x,D)
%Upsampling
disp('Upsampled
Signal');
xI=upsample(x,I)

%% Plots
subplot(2,2,1);
stem(x);
xlabel('----> n');
ylabel('----->
x(nD)'); title('Input
x(n)'); grid on;

subplot(2,2,2);
stem(xD);
xlabel('---->
n');
ylabel('-----> x(n)');
title('Downsampled sequence
x(nD)'); grid on;

subplot(2,2,[3
4]); stem(xI);
xlabel('----> n');
ylabel('-----> x(n/I)');
title('Upsampled Sequence
x(n/I)'); grid on;

OUTPUT

Enter the input sequence x(n) : [1 2 3 4 5 ]

Enter the Decimation factor D : 2


Enter the Interpolation factor I : 2

Downsampled Signal

xD = 1 3 5

Upsampled Signal

xI = 1 0 2 0 3 0 4 0 5 0
RESULT :
The Multirate Signal Processing has been done by up sampling and down sampling and
verified by plotting the amplitude response and time response using MATLAB.

You might also like