Professional Documents
Culture Documents
1
S. Name of the Experiments Sr no
No
MATLAB
BREAD BOARD
MTE
MICROPROCESSOR
EQUIPMENTS:
Constructor – MATLAB Software
THEORY:
A Finite Impulse Response (FIR) filter is a discrete linear time-invariant system whose
output is based on the weighted summation of a finite number of past inputs. An FIR transversal
filter structure can be obtained directly from the equation for discrete-time convolution.
In this equation, x(k) and y(n) represent the input to and output from the filter at time n.
h(n-k) is the transversal filter coefficients at time n. These coefficients are generated by using
FDS (Filter Design Software or Digital filter design package).
FIR – filter is a finite impulse response filter. Order of the filter should be specified.
Infinite response is truncated to get finite impulse response. placing a window of finite length
does this. Types of windows available are Rectangular, Barlett, Hamming, Hanning, Blackmann
window etc. This FIR filter is an all zero filter.
PROGRAM:
RESULTS:
4
5
6
IIR filters
EQUIPMENTS:
Software - MATLAB
THEORY:
The IIR filter can realize both the poles and zeroes of a system because it has a rational
transfer function, described by polynomials in z in both the numerator and the denominator:
PROGRAM:
RESULTS:
8
9
LINEAR CONVOLUTION AND CORRELATION
EQUIPMENTS:
Software -- MATLAB 7.5
THEORY:
Convolution is a formal mathematical operation, just as multiplication, addition, and
integration. Addition takes two numbers and produces a third number, while convolution takes
two signals and produces a third signal. Convolution is used in the mathematics of many fields,
such as probability and statistics. In linear systems, convolution is used to describe the
relationship between three signals of interest: the input signal, the impulse response, and the
output signal.
In this equation, x1(k), x2(n-k) and y(n) represent the input to and output from the system
at time n. Here we could see that one of the input is shifted in time by a value every time it is
multiplied with the other input signal. Linear Convolution is quite often used as a method of
implementing filters of various types.
ALGORITHM:
PROGRAM:
RESULT:
11
%program for discrete Correlation
x=[1 2 3 4];
y=[2 3 4 5];
z=xcorr(x,y);
stem(z);
subplot(2,2,1),stem(x)
title(‘input sequence 1’)
subplot(2,2,2),stem(y)
title(‘input sequence 2’)
subplot(2,2,3),stem(z)
title(‘output sequence’)
ALGORITHM:
RESULT:
input sequence 1 input sequence 2
4 6
3
4
2
2
1
0 0
1 2 3 4 1 2 3 4
output sequence
40
30
20
10
0
0 2 4 6 8
12
CIRCULAR CONVOLUTION
EQUIPMENTS:
Software - MATLAB 7.5
THEORY:
Circular convolution is another way of finding the convolution sum of two input signals.
It resembles the linear convolution, except that the sample values of one of the input signals is
folded and right shifted before the convolution sum is found. Also note that circular convolution
could also be found by taking the DFT of the two input signals and finding the product of the
two frequency domain signals. The Inverse DFT of the product would give the output of the
signal in the time domain which is the circular convolution output. The two input signals could
have been of varying sample lengths. But we take the DFT of higher point, which ever signals
levels to. For eg. If one of the signal is of length 256 and the other spans 51 samples, then we
could only take 256 point DFT. So the output of IDFT would be containing 256 samples instead
of 306 samples, which follows N1+N2 – 1 where N1 & N2 are the lengths 256 and 51
respectively of the two inputs. Thus the output which should have been 306 samples long is
fitted into 256 samples. The 256 points end up being a distorted version of the correct signal.
This process is called circular convolution.
PROGRAM:
y(1)=0;
13
a(1)=h(1);
for j=2:n
a(j)=h(n-j+2);
end
%ciruclar conv
for i=1:n
y(1)=y(1)+x(i)*a(i);
end
for k=2:n
y(k)=0;
% circular shift
for j=2:n
x2(j)=a(j-1);
end
x2(1)=a(n);
for i=1:n
if(i<n+1)
a(i)=x2(i);
y(k)=y(k)+x(i)*a(i);
end
end
end
y
subplot(2,2,[3,4]),stem(y);
title('convolution of x(n) & h(n) is:');
xlabel('---->n');
ylabel('---->y(n)');grid;
RESULT:
14
DFT AND IDFT
AIM: To develop a program for Computing DFT and IDFT in MATLAB
THEORY:
The discrete Fourier transform (DFT) X[k] of a finite-length sequence x[n] can be easily
computed in MATLAB using the function fft. There are two versions of this function. fft(x)
computes the DFT X[k] of the sequence x[n] where the length of X[k] is the same as that of x[n].
fft(x,L) computes the L-point DFT of a sequence x[n] of lengthN where L ≥ N. IfL > N, x[n] is
zero-padded with L−N trailing zero-valued samples before the DFT is computed. The inverse
discrete Fourier transform (IDFT) x[n] of a DFT sequence X[k] can likewise be computed using
the function ifft, which also has two versions.
PROGRAM CODE:
Input Sequence:-
ALGORITHM:
15
2 Set the range of k according to the length of x.
3 Computing DFT, store the value in X(k).
4 Plotting the DFT of given Sequence,store in X(k).
RESULT:
20
18
16
14
12
10
0
0 0.5 1 1.5 2 2.5 3
Input Sequence:
ALGORITHM:
RESULT:
10
0
0 0.5 1 1.5 2 2.5 3
17
INVERSE Z TRANSFORM
THEORY:
Description: In mathematics and signal processing, the Z-transform converts a discrete
time-domain signal, which is a sequence of real or complex numbers, into a complex frequency-
domain representation. The Z-transform, like many other integral transforms, can be defined as
either a one-sided or two-sided transform.
The bilateral or two-sided Z-transform of a discrete-time signal x[n] is the function X(z)
defined as
.
Alternatively, in cases where x[n] is defined only for n ≥ 0, the single-sided or unilateral
Z-transform is defined as
PROGRAM CODE:
ALGORITHM:
Input Sequence:
19
20
m a g n itu d e A n g le
2 0 .2 5
10
M agnitude (dB )
0 .2
0
1 .5 0 .1 5
-1 0
0 .1
-2 0
0 0 .1 0 .2 0 .3 0 .4 0 .5 0 .6 0 .7 0 .8 0 .9 1 1 0 .0 5
N o r m a l i z e d F r e q× uπ er an dc / ys a (m p l e )
0
150
0 .5 -0 .0 5
100 -0 .1
P has e (degrees )
0 -0 .1 5
50
-0 .2
0 -0 .5 -0 .2 5
0 0 .1 0 .2 0 .3 0 .4 0 .5 0 .6 0 .7 0 .8 0 .9 1 1 1 .5 2 1 1 .5 2
N o r m a l i z e d F r e q× uπ er an dc / ys a (m p l e )
Experiment no 6
AIM : To design and implement on a breadboard a circuit to perform Amplitude modulation.
APPARATUS: Two IC BC 107BP,33k, 100k,two 4.7k,270ohm resistor, two 4.7μF capacitor,
CRO(20 Mhz),Function generator(1Mhz),connecting wires and probes.
20
PROCEDURE:-
1. Connect the circuit as per the given circuit diagram.
2. Apply fixed frequency carrier signal to carrier input terminals.
3. Apply modulating signal from function generator of 1VP-P of 500Hz.
4. Note down and trace the modulated signal envelop on the CRO screen. 5. Find the modulation
index by measuring Vmax and Vmin from the modulated (detected/ traced) envelope.
M=(Vmax –Vmin)/(Vmax+Vmin)
6. Repeat the steps 3,4 & 5 by changing the frequency or/& amplitude of the modulating signal
so as to observe over modulation, under modulating and perfect modulation.
7. For demodulation, apply the modulated signal (A.M) as an input to the demodulator and verify
the demodulated output with respect to the applied modulating signals and their respective
outputs.
21
Observed m= (Vmax + V min) / (V max – V min )
22
ERROR ANALYSIS: Calculate Modulation index using mathematical formula mc = Vm/Vc.
%AGE ERROR = ((m –mc)/ mc)x100% RESULT:
23
Experiment no 7
AIM : To design and implement on a breadboard a circuit to perform Frequency modulation.
APPARATUS: IC LM 2206,10k, two 100k,three 4.7k,220ohm resistor,22μF,1μF,10μF,0.01μF,
CRO(20 Mhz),Function generator(1Mhz),connecting wires and probes. CIRCUIT DIAGRAM:
EXPECTED WAVEFORMS
24
OBSERVATION TABLE
Formula used: m f = δ / f m
where δ = k Vm fc
K is the proportionality constant
25
Find the average m f. Calculated mf = kVm fc /fm mf min = mf max = mf avg cal = %age error =
((Calculated mf - observed mf ) / Calculated mf )x100%
26
Result
Experiment -8
AIM Interfacing 8x8 keyboard using 8085 microprocessor.
Apparatus required Push Switches (64)
SAMPLE PROGRAM:
Block Diagram
Source program
MVI A, 90H : Initialize Port A as input and
OUT CR : Port B as Output
START: MVI A, 00 : Make all scan lines zero
OUT PB
BACK: IN PA
CPI FF : Check for key release
JNZ BACK : If not, wait for key release
CALL DELAY : Wait for key debounce
BACK 1: IN PA
27
CPI FF : Check for key press
JZ BACK 1 : If not, wait for key press
CALL DELAY : Wait for key debounce
MVI L, 00H : Initialize key counter
MVI C, 08H
MVI B, FEH : Make one column low
NEXTCOL: MOV A, B
OUT PB
MVI D, 08H : Initialize row counter
IN PA : Read return line status
NEXTROW: RRC : Check for one row
JNC DISPLAY : If zero, goto display else continue
INR L : Increment key counter
DCR D : Decrement row counter
JNZ NEXTROW : Check for next row
MOV A, B
RLC : Select the next column
MOV B, A
DCR C : Decrement column count
JNZ NEXTCOL : Check for last column if not repeat
JMP START : Go to start
INTERFACING SCHEME
Delay subroutine:
Delay: LXI D, Count
Back: DCX D
MOV A, D
ORA E
JNZ Back
RET
FLOWCHART
28
Conclusion A stepper motor is a digital motor. It can be driven by digital signal. Fig. shows the
typical 2 phase motor rated 12V /0.67 A/ph interfaced with the 8085 microprocessor system
using 8255. Motor shown in the circuit has two phases, with center-tap winding. The center taps
of these windings are connected to the 12V supply. Due to this, motor can be excited by
grounding four terminals of the two windings. Motor can be rotated in steps by giving proper
excitation sequence to these windings. The lower nibble of port A of the 8255 is used to generate
excitation signals in the proper sequence. These excitation signals are buffered using driver
transistors. The transistors are selected such that they can source rated current for the
windings.Motor is rotated by 1.80 per excitation.
____________________________________________________________________________
29
Experiment 9
AIM Generation of delay in binary counting using 8085 microprocessor .
SAMPLE PROGRAM Write a program for displaying binary up counter. Counter should count
numbers from 00 to FFH and it should increment after every 0.5 sec.
Source Program:
LXI SP, 27FFH : Initialize stack pointer
MVI C, OOH : Initialize counter
BACK: CALL Display : Call display subroutine
CALL Delay : Call delay subroutine
INR C : Increment counter
MOV A, C CPI OOH : Check counter is > FFH
JNZ BACK : If not, repeat
HLT : Stop
Delay Subroutine:
Delay: LXI B, count : Initialize count
BACK: DCX D : Decrement count
MOV A, E
ORA D : Logically OR D and E
JNZ BACK : If result is not 0 repeat RET : Return to main program
30
Experiment 10
AIM: TO implement a moving 7-segment display with suitable delay using 8085
microprocessor.
31
CONCLUSION
Fig. shows the multiplexed eight 7-segment display connected in the 8085 system using 8255. In
this circuit port A and port B are used as simple latched output ports. Port A provides the
segment data inputs to the display and port B provides a means of selecting a display position at
32
a time for multiplexing the displays. A0-A7 lines are used to decode the addresses for 8255. For
this circuit different addresses are:
PA = 00H PB = 01H
PC = 02H CR = 03H.
The register values are chosen in Fig. such that the segment current is 80 mA. This current is
required to produce an average of 10 mA per segment as the displays are multiplexed. In this
type of display system, only one of the eight display position is 'ON' at any given instant. Only
one digit is selected at a time by giving low signal on the corresponding control line. Maximum
anode current is 560 mA (7-segments x 80 mA = 560 mA), but the average anode current is 70
mA.
33
Experiment 11
Aim: Write a program to interface two digit numbers using seven Segment LEDs, use 8086
microprocessor and 8255 PPI
Flow Chart
34
35
Circuit Diagram
Conclusion
Fig. shows the interfacing of eight 7-segment digits to 8085 through 8279. As
shown in the figure eight display lines (Bo-B3 and Ao-A3) are buffered with
the help of transistor and used to drive display digits. These buffered lines
are connected in parallel to all display digits. So, Sl and S2 lines are decoded
and decoded lines are used for selection of one of the eight digits
Source program:
LXI B, 6200B : Initialize lookup table pointer
MVI C, 08H : Initialize counter
MVI A, 00H : Initialize keyboard/display
OUT 8IH : Mode
36
MVI A, 3EH : Initialize prescaler count
OUT 8IH
MVI A, 90H : Initial size 8279 in write Display
OUT 8IH : RAM-mode
BACK : MOV A, M : Get the 7-segment code
OUT 80H : Write 7-segment code in display RAM
INX H : Increment lookup table pointer
DCR C : Decrement counter
JNZ BACK : if count = 0 stop, otherwise go to back
HLT : Stop program execution
37