Professional Documents
Culture Documents
EC2306 DSP Lab Manual PDF
EC2306 DSP Lab Manual PDF
COLLEGE OF ENGINEERING
Sir.C.V.Raman Nagar, Tirunelveli-12
Name
Reg No
Branch
INDEX
S.No
Date
Page no
Marks
USING MATLAB
1.
Generation of signals
2.
Convolution of signals
3.
11
4.
Calculation of FFT
13
15
5(a).
window
5(b).
18
Rectangular window
5(c)
21
Hamming window
5(d)
24
Hanning window
5(e)
27
Blackmann window
6(a)
30
6(b)
33
Decimation by Polyphase
36
7.
Decomposition
8.
38
Estimation
Signature
S.No
Date
Page no
Marks
USING TMS320C5X
9.
40
10.
42
Circular Convolution
11.
Sampling of signals
47
12.
Waveform Generation
49
59
13(a)
Filter.
13(b)
63
Filter
13(c)
67
Filter
13(d)
71
Filter
Signature
EX. NO. 1
Date:
GENERATION OF SIGNALS
AIM:
To generate the following signals using MATLAB 7.0
1. Unit impulse signal
2. Unit step signal
3. Unit ramp signal
4. Exponential growing signal
5. Exponential decaying signal
6. Sine signal
7. Cosine signal
APPARATUS REQUIRED:
System with MATLAB 7.0.
ALGORITHM:
1. Get the number of samples.
2. Generate the unit impulse, unit step using ones, zeros matrix
command.
3. Generate ramp, sine, cosine and exponential signals using corresponding
general formula.
4. Plot the graph.
PROGRAM:
% 1. UNIT IMPULSE SIGNAL
clc;
clear all;
close all;
N=input('Number of Samples');
n=-N:1:N
x=[zeros(1,N) 1 zeros(1,N)]
stem(n,x);
xlabel('Time');
ylabel('Amplitude');
title('Impulse Response');
RESULT:
EX.NO. 2
Date:
CONVOLUTION OF SIGNALS
AIM:
To write the program for finding the linear and circular convolution of two
signals using MATLAB 7.0.
APPARATUS REQUIRED:
System with MATLAB 7.0.
LINEAR CONVOLUTION:
ALGORITHM:
1. Get the number of samples.
2. Generate the output sequence of the given two input signals using
conv command.
3. Plot the graph.
PROGRAM:
CIRCULAR CONVOLUTION:
ALGORITHM:
1. Get the number of samples.
2. Generate the sequence for the given two input signals using zeros and
ones matrix command.
3. Generate the convoluted output sequence of the given two input signals
using conv command.
4. Plot the graph.
PROGRAM:
% PROGRAM FOR CIRCULAR CONVOLUTION
clc;
clear all;
close all;
x=input('Enter the first sequence');
N1=length(x);
h=input('Enter the second sequence');
N2=length(h);
n=0:1:N1-1;
subplot(2,2,1);
stem(n,x);
xlabel('Time');
ylabel('Amplitude');
title('X Sequence Response');
n=0:1:N2-1;
subplot(2,2,2);
stem(n,h);
xlabel('Time');
ylabel('Amplitude');
title('H Sequence Response');
N=max(N1,N2);
x=[x,zeros(1,N-N1)];
h=[h,zeros(1,N-N2)];
for n=1:N
y(n)=0;
Einstein College of Engineering
Page 9 of 81
OUTPUT:
RESULT:
EX.NO. 3
Date
AIM:
To sample the signal and observe the aliasing effect of that signal using
MATLAB 7.0.
APPARATUS REQUIRED:
System with MATLAB 7.0.
ALGORITHM:
1. Get the input frequency and number of samples.
2. The input signal is sampled at the frequencies fs1=2fm, fs2>2fm and
fs3<2fm.
3. Plot the input and sampled signal at various frequencies.
PROGRAM:
% PROGRAM FOR SAMPLING AND EFFECT OF ALIASING
clc;
clear all;
close all;
N=input('Enter the number of samples N= ');
fm=input('Enter the frequency');
t=0:0.01:N;
x=cos(2*pi*fm*t);
subplot(3,2,1);
plot(t,x);
% xlabel('Time');
ylabel('Amplitude');
title('Input Signal');
fs1=fm;
fs2=2*fm;
fs3=5*fm;
n=0:0.08:N;
y=cos(2*pi*fm*n);
subplot(3,2,2);
stem(n,y);
% xlabel('Time');
ylabel('Amplitude');
title('Sampling Signal');
y1=cos(2*pi*n*fm/fs1);
subplot(3,2,3);
stem(n,y1);
Einstein College of Engineering
Page 11 of 81
RESULT:
EX.NO. 4
Date:
CALCULATION OF FFT
AIM:
To write the program for calculating the N-point FFT and IFFT of given input
sequence using MATLAB 7.0.
APPARATUS REQUIRED:
System with MATLAB 7.0.
ALGORITHM:
1. Get the input sequence and its length.
2. Calculate the Fast Fourier Transform and Inverse Fast Fourier Transform
of given sequence using user defined function.
3. Plot the magnitude and phase response of FFT sequence.
4. Plot the IFFT response.
PROGRAM:
% CALCULATION OF FFT AND IFFT
clc;
clear all;
close all;
x=input('x(n)');
N=length(x);
n=input('n');
y=fft(x,n);
v=0:1:N-1;
t=0:1:n-1;
subplot(2,2,1);
stem(v,x);
xlabel('Time');
ylabel('Amplitude');
title('Input Signal');
subplot(2,2,2);
stem(t,abs(y));
xlabel('Time');
ylabel('Amplitude');
title('Magnitude Response');
subplot(2,2,3);
stem(t,angle(y));
xlabel('Time');
ylabel('Amplitude');
Einstein College of Engineering
Page 13 of 81
OUTPUT:
RESULT:
EX.NO. 5 (a)
Date:
AIM:
To design the FIR filter using Kaiser Window with MATLAB 7.0.
APPARATUS REQUIRED:
System with MATLAB 7.0.
ALGORITHM:
1.
2.
3.
4.
5.
Get the pass band and stop band attenuation and frequency.
Get the sampling frequency.
Find transition width and center frequency (cut-off frequency).
Design the low pass, high pass, band pass and band stop filter.
Plot the magnitude response of all filters.
PROGRAM:
clc;
clear all;
close all;
ap=input('Pass band attenuation=');
as=input('Stop band attenuation=');
fs=input('Stop band frequency in rad/sec=');
fp=input('Pass band frequency in rad/sec=');
wsf=input('Sampling frequency in rad/sec=');
dw=fs-fp;
wc=(fs+fp)/2;
wp1=2*fp/wsf;
ws1=2*fs/wsf;
s1=10^(-0.05*as);
e=10^(0.05*ap);
s2=(e-1)/(e+1);
S=min(s1,s2);
A=-20*log10(S);
if(A<=21)
B=0
elseif(A>21&A<=50)
B=0.5842*((A-21)^0.4)+(0.07886*(A-21));
elseif(A>50)
B=0.1102*(A-8.7);
end
N=((wsf*(A-8))/(dw*14.36))+1;
Einstein College of Engineering
Page 15 of 81
OUTPUT:
RESULT:
EX.NO. 5 (b)
Date:
AIM:
To design a FIR filter using Rectangular window with MATLAB 7.0.
APPARATUS REQUIRED:
System with MATLAB 7.0.
ALGORITHM:
1.
2.
3.
4.
5.
Get the pass band and stop band ripple and frequency.
Get the sampling frequency.
Find the order of filter N.
Design the low pass, high pass, band pass and band stop filter.
Plot the magnitude response of all filters.
PROGRAM:
clc;
clear all;
close all;
rp=input('Pass band ripple=');
rs=input('Stop band ripple=');
fs=input('Stop band frequency in rad/sec=');
fp=input('Pass band frequency in rad/sec=');
f=input('Sampling frequency in rad/sec=');
wp=2*fp/f;
ws=2*fs/f;
num=-20*log10(sqrt(rp*rs))-13;
dem=14.6*(fs-fp)/f;
n=ceil(num/dem)
n1=n+1;
if(rem(n,2)~=0);
n1=n;
n=n-1;
end
y=boxcar(n1);
%LOW PASS FILTER
b=fir1(n,wp,y);
[h,o]=freqz(b,1,256);
Einstein College of Engineering
Page 18 of 81
OUTPUT:
RESULT:
EX.NO. 5 (c)
Date:
AIM:
To design a FIR filter using Hamming window with MATLAB 7.0.
APPARATUS REQUIRED:
System with MATLAB 7.0
ALGORITHM:
1.
2.
3.
4.
5.
Get the pass band and stop band ripple and frequency.
Get the sampling frequency.
Find the order of filter N.
Design the lowpass,High pass,Band pass and Band stop filter.
Plot the magnitude response of all the filters.
PROGRAM:
clc;
clear all;
close all;
rp=input('Pass band ripple=');
rs=input('Stop band ripple=');
fs=input('Stop band frequency in rad/sec=');
fp=input('Pass band frequency in rad/sec=');
f=input('Sampling frequency in rad/sec=');
wp=2*fp/f;
ws=2*fs/f;
num=-20*log10(sqrt(rp*rs))-13;
dem=14.6*(fs-fp)/f;
n=ceil(num/dem)
n1=n+1;
if(rem(n,2)~=0);
n1=n;
n=n-1;
end
y=hamming(n1);
%LOW PASS FILTER
b=fir1(n,wp,y);
[h,o]=freqz(b,1,256);
Einstein College of Engineering
Page 21 of 81
OUTPUT:
RESULT:
EX.NO. 5 (d)
Date:
AIM:
To design a FIR filter using Hanning window with MATLAB 7.0.
APPARATUS REQUIRED:
System with MATLAB 7.0
ALGORITHM:
1.
2.
3.
4.
5.
Get the pass band and stop band ripple and frequency.
Get the sampling frequency.
Find the order of filter N.
Design the lowpass,High pass,Band pass and Band stop filter.
Plot the magnitude response of all the filters.
PROGRAM:
clc;
clear all;
close all;
rp=input('Pass band ripple=');
rs=input('Stop band ripple=');
fs=input('Stop band frequency in rad/sec=');
fp=input('Pass band frequency in rad/sec=');
f=input('Sampling frequency in rad/sec=');
wp=2*fp/f;
ws=2*fs/f;
num=-20*log10(sqrt(rp*rs))-13;
dem=14.6*(fs-fp)/f;
n=ceil(num/dem)
n1=n+1;
if(rem(n,2)~=0);
n1=n;
n=n-1;
end
y=hanning(n1);
OUTPUT:
RESULT:
EX.NO. 5 (e)
Date:
AIM:
To design a FIR filter using Blackmann window with MATLAB 7.0.
APPARATUS REQUIRED:
System with MATLAB 7.0
ALGORITHM:
6. Get the pass band and stop band ripple and frequency.
7. Get the sampling frequency.
8. Find the order of filter N.
9. Design the lowpass,High pass,Band pass and Band stop filter.
10. Plot the magnitude response of all the filters.
PROGRAM:
clc;
clear all;
close all;
rp=input('Pass band ripple=');
rs=input('Stop band ripple=');
fs=input('Stop band frequency in rad/sec=');
fp=input('Pass band frequency in rad/sec=');
f=input('Sampling frequency in rad/sec=');
wp=2*fp/f;
ws=2*fs/f;
num=-20*log10(sqrt(rp*rs))-13;
dem=14.6*(fs-fp)/f;
n=ceil(num/dem)
n1=n+1;
if(rem(n,2)~=0);
n1=n;
n=n-1;
end
y=blackman(n1);
OUTPUT:
RESULT:
EX.NO. 6 (a)
Date:
AIM:
To design a Butterworth digital IIR filter using MATLAB 7.0.
APPARATUS REQUIRED:
System with MATLAB 7.0.
ALGORITHM:
1.
2.
3.
4.
RESULT:
EX.NO. 6 (b)
Date:
AIM:
To design a digital IIR filter using Chebyshev filter with MATLAB 7.0.
APPARATUS REQUIRED:
System with MATLAB 7.0.
ALGORITHM:
1.
2.
3.
4.
OUTPUT:
RESULT:
EX.NO. 7
Date:
AIM:
To write a program to compute Convolution and m-fold decimation by
polyphase decomposition.
APPARATUS REQUIRED:
System with MATLAB 7.0.
ALGORITHM:
1. Get the input sequence.
2. Get the filter coefficients and also the decimation factor.
3. Find the response by using convolution.
4. Plot the graph.
PROGRAM:
%Program for computing convolution and m-fold decimation by polyphase
decomposition.
clear all;
clc;
close all;
x=input(enter the input sequence);
h=input(enter the FIR filter coefficients);
M=input(enter the decimation factor);
N1=length(x);
N=0:1:N1-1;
Subplot(2,1,1);
Stem(n,x);
Xlabel(time);
Ylabel(amplitude);
Title(X sequence response);
N2=length(h);
n=0:1:N2-1;
Subplot(2,1,2);
Stem(n,h);
Xlabel(time);
Ylabel(amplitude);
Title(H sequence response);
H=length(h);
P=floor((H-1)/M)+1;
Einstein College of Engineering
Page 36 of 81
EX.NO. 8
Date:
AIM:
APPARATUS REQUIRED:
System with MATLAB 7.0.
ALGORITHM:
PROGRAM:
OUTPUT:
RESULT:
EX.NO. 9
Date:
AIM:
To study about direct, indirect and immediate addressing modes in
TMS320C50 debugger.
APPARATUS REQUIRED:
1.System with TMS 320C50 debugger software
2.TMS 320C50 Kit.
ALGORITHM:
IMMEDIATE ADDRESSING MODE:
1.
2.
3.
4.
H:
LACC #1241H
ADD #1200H
SACL 2H
BH
H:
LDP #100H
LACC 0H
ADD 1H
SACL 2H
BH
OUTPUT:
RESULT:
LINEAR CONVOLUTION
ALGORITHM:
1. Start the program.
2. LPD will load the 9LSBs of address data memory.
Location or immediate value into the data pointer (DP) register.
3. Load auxiliary register (LAR) loads the content of the address data
memory location into the designated auxilary register.
4. Then ZC clears the content of accumulator too.
5. MAR modify current AR and ARP as specified.
6. The RPT load the 8 bit LSBs of the addressed value of the RPT.
7. The SACL store the 16 LSBs of the accumulator into the addressed data
memory.
8. MUL is used to multiply the content of T register.
9. The LTP would load the contents of the addressed data memory location
into T register.
10. ADD will add the content of the memory.
11. LACC is used to load the content of the addressed data memory into
accumulator.
PROGRAM:
;Program for Linear Convolution
.MMREGS
.TEXT
START:
LDP #100H
LAR AR1,#(8100H+4H)
ZAC
MAR *,AR1
Einstein College of Engineering
Page 42 of 81
LAR AR1,#(8200H+4H)
ZAC
MAR *,AR1
RPT#2H
SACL*+
LAR AR3,#(8300H+6H)
LAR AR4,#06H
;Multiply & Accumulate:
Next_YN:
LAR AR1,#8100H
LAR AR2,#(8200H+6H)
LAR AR0,#06H
ZAC
SACL 0H
MAR *,AR1
LT *+,AR2
Loop_MAC:
MPY *-,AR1
LTP *+,AR0
ADD 0H
SACL 0H
BANZ Loop_MAC,*-,AR2
LACC 0H
MAR *,AR3
SACL *;Shiftx(n) Values:
LAR AR1,#(8100H+6H)
LAR AR2,#5H
LAR AR0,#2H
MAR *,AR1
LACC *SACL 1H
Shift_XN:
LACC *+
SACL *0-,AR2
BANZ Shift_XN,*-,AR1
MAR *+
LACC 1H
SACL *,AR4
BANZ Next_YN,*NOP
Einstein College of Engineering
Page 43 of 81
B H1
OUTPUT:
CIRCULAR CONVOLUTION
ALGORITHM:
1. Start the Program.
2. Load the LSBs of the address data memory location.
3. Load the contents of the address data memory location into auxiliary
register.
4. Modify the current AR as specified.
5. Load the content of addressed data memory location.
6. Store the 16 LSBs of the accumulator into the address data memory
location.
7. Load the content in ARL Z.0
8. Branch the contents of entire auxiliary register.
9. Load the content AR.1,AR.2,AR.0
10. Store the content of the accumulator
11. Modify the current AR as specified.
12. Stop the program.
PROGRAM:
;Program for Circular Convolution
.MMREGS
.TEXT
LDP #100H
LACC 0H
SUB #1H
SACL 1H
LAR AR0,1H
LAR AR2,#8010H
LOOP3: LAR AR1,#8060H
LAR AR3,#8050H
LAR AR4,1H
ZAP
LOOP:MAR *,AR3
Einstein College of Engineering
Page 44 of 81
RESULT:
EX.NO. 11
Date:
SAMPLING OF SIGNALS
AIM:
To write a program to convert analog signals into digital signals using
TMS320C50 debugger.
APPARATUS REQUIRED:
1.System with TMS 320C50 debugger software
2.TMS 320C50 Kit.
3.CR0
4.Function Generator.
ALGORITHM:
1.
2.
3.
4.
5.
PROGRAM:
.mmregs
.text
LDP #100H
START:
IN 0,06H
NOP
IN 0,04H
RPT #4FFH
NOP
OUT 0,04H
RPT #4FFH
NOP
B START
MODEL GRAPH:
OUTPUT:
WAVEFORM
AMPLITUDE (V)
INPUT
OUTPUT
RESULT:
AIM:
To write a program to generate Triangle Wave,Sine Wave,Square Wave and
SawTooth Wave using TMS320C50 debugger.
APPARATUS REQUIRED:
1.System with TMS 320C50 debugger software
2.TMS 320C50 Kit.
3.CR0
4.Function Generator.
ALGORITHM:
TRIANGLE WAVE GENERATION:
1. Start the program.
2. Load the LSBs of the address data memory location.
3. Write full 16 bit pattern into address data memory location.
4. Load the content of address data memory location.
5. Add the content of address data memory location.
6. Store the data of accumulator into address data memory location.
7. Modify the current AR as specified.
8. Repeat the step 2,3.
9. Subtract the contents of address data memory location.
10. Repeat the steps 5,6,7.
11. Stop the program.
AR2,#FREQ
CONTx:OUT TEMP,4
LACC TEMP
SUB
#AMPLITUDE
SACL TEMP
MAR *,AR2
BANZ CONTx
B
CONT1
100
101
103
105
106
108
110
112
113
115
117
119
120
122
124
125
127
129
130
132
134
135
137
139
140
142
143
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
145
146
148
150
151
152
154
155
157
158
160
161
162
164
165
166
168
169
170
171
173
174
175
176
177
178
179
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
180
181
182
183
184
185
186
187
188
189
189
190
191
192
192
193
193
194
195
195
196
196
197
197
197
198
198
198
199
199
199
199
199
199
199
199
200
199
199
199
199
199
199
199
199
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
198
198
198
197
197
197
196
196
195
195
194
193
193
192
192
191
190
189
189
188
187
186
185
184
183
182
181
180
179
176
175
174
173
172
171
170
169
168
166
165
164
162
161
160
158
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
157
155
154
152
151
149
148
146
145
143
142
140
139
137
135
134
132
130
129
127
125
124
122
120
119
117
115
113
112
110
108
106
105
103
101
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
99
98
96
94
93
91
89
87
86
84
82
80
79
77
75
74
72
70
69
67
65
64
62
60
59
57
56
54
53
51
49
48
47
45
44
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
42
41
39
38
37
35
34
33
31
30
29
28
26
25
24
23
22
21
20
19
18
17
16
15
14
13
12
11
10
10
9
8
7
7
6
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
6
5
4
4
3
3
2
2
2
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
2
2
2
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
3
3
4
4
5
6
6
7
7
8
9
10
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
28
29
30
31
33
34
35
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.word
.end
37
38
39
41
42
44
45
47
48
50
53
54
56
57
59
60
62
64
65
67
69
70
72
74
75
77
79
80
82
84
86
87
89
91
93
94
96
98
100
OUTPUT:
WAVEFORM
AMPLITUDE (V)
RESULT:
EX.NO. 13 (a)
Date:
AIM:
To design a FIR low pass filter in serial mode.
APPARATUS REQUIRED:
1.System with VI debugger software
2.TMS 320C50 Kit.
3.CR0
ALGORITHM:
1. Start the program.
2. Initialize the C table value.
3. Load the auxillary register with 0200H.
4. Modify the auxillary register zero.
5. Block the C table to the program.
6. Set configuration control bit.
7. Load the data pointer with 0AH.
8. Initialize the analog to digital conversion.
9. Load the auxillary register 1 with 0300 content.
10. Load the accumulator in 8000H.
11. AND the accumulator with 0FFFH.
12. Subtract the accumulator content with data 800H.
13. Modify the auxillary register 1.
14. Store the accumulator data in 8000H.
15. Load the auxillary register 1 with content 0333H.
16. Zero the accumulator register.
17. Multiply the accumulator with data.
18. Load the program register, with PM bits to accumulator.
19. Load the auxillary register 1 with content 0300H.
20. Add accumulator content with 800H.
21. Shift the accumulator right 1 bit.
22. Store the accumulator content in 8200 location.
23. Branch the program to step 7.
PROGRAM:
*Approximation type:Window design- Blackmann Window
*Filter type:Low Pass Filter
*Filter Order:52
*Cutoff frequency in KHZ=3.000000
.mmregs
.text
Einstein College of Engineering
Page 59 of 81
*
*
.word 0FFC4H
.word 0FFC6H
.word 0FFD3H
.word 0FFE7H
Move the Filter coefficients
from program memory to data memory
START:
LAR
MAR
RPT
BLKP
SETC
AR0,#0200H
*,AR0
#33H
CTABLE,*+
CNF
MODEL GRAPH:
TABULATION:
S.No.
Frequency(Hz)
Vout(v)
Vout/Vin
Gain in db=
20log Vout/Vin
RESULT:
Thus the program for designing a FIR low pass filter in serial mode was
performed
EX.NO. 13 (b)
Date:
AIM:
To design a FIR high pass filter in serial mode.
APPARATUS REQUIRED:
1.System with VI debugger software
2.TMS 320C50 Kit.
3.CR0
ALGORITHM:
1. Start the program.
2. Initialize the C table value.
3. Load the auxillary register with 0200H.
4. Modify the auxillary register zero.
5. Block the C table to the program.
6. Set configuration control bit.
7. Load the data pointer with 0AH.
8. Initialize the analog to digital conversion.
9. Load the auxillary register 1 with 0300 content.
10. Load the accumulator in 8000H.
11. AND the accumulator with 0FFFH.
12. Subtract the accumulator content with data 800H.
13. Modify the auxillary register 1.
14. Store the accumulator data in 8000H.
15. Load the auxillary register 1 with content 0333H.
16. Zero the accumulator register.
17. Multiply the accumulator with data.
18. Load the program register, with PM bits to accumulator.
19. Load the auxillary register 1 with content 0300H.
20. Add accumulator content with 800H.
21. Shift the accumulator right 1 bit.
22. Store the accumulator content in 8200 location.
23. Branch the program to step 7.
PROGRAM:
*Approximation type:Window design- Blackmann Window
*Filter type:high Pass Filter
*Filter Order:52
*Cutoff frequency in KHZ=3.000000
Einstein College of Engineering
Page 63 of 81
.word 0FD3FH
.word 087H
.word 0FCB9H
.word 05H
.word 0FCD3H
*
Move the Filter coefficients
from program memory to data memory
START:
LAR
MAR
RPT
BLKP
SETC
AR0,#0200H
*,AR0
#33H
CTABLE,*+
CNF
MODEL GRAPH:
TABULATION:
S.No.
Frequency(Hz)
Vout(v)
Vout/Vin
Gain in db=
20log Vout/Vin
RESULT:
Thus the program for designing a FIR high pass filter in serial mode was
performed.
EX.NO. 13 (c)
Date:
AIM:
To design a FIR band pass filter in serial mode.
APPARATUS REQUIRED:
1.System with VI debugger software
2.TMS 320C50 Kit.
3.CR0
ALGORITHM:
1. Start the program.
2. Initialize the C table value.
3. Load the auxillary register with 0200H.
4. Modify the auxillary register zero.
5. Block the C table to the program.
6. Set configuration control bit.
7. Load the data pointer with 0AH.
8. Initialize the analog to digital conversion.
9. Load the auxillary register 1 with 0300 content.
10. Load the accumulator in 8000H.
11. AND the accumulator with 0FFFH.
12. Subtract the accumulator content with data 800H.
13. Modify the auxillary register 1.
14. Store the accumulator data in 8000H.
15. Load the auxillary register 1 with content 0333H.
16. Zero the accumulator register.
17. Multiply the accumulator with data.
18. Load the program register, with PM bits to accumulator.
19. Load the auxillary register 1 with content 0300H.
20. Add accumulator content with 800H.
21. Shift the accumulator right 1 bit.
22. Store the accumulator content in 8200 location.
23. Branch the program to step
PROGRAM:
*Approximation type:Window design- Blackmann Window
*Filter type:band Pass Filter
*Filter Order:52
*lower Cutoff frequency in KHZ=3.000000
*upper Cutoff frequency in KHZ=3.000000
Einstein College of Engineering
Page 67 of 81
.mmregs
.text
B START
CTABLE:
.word 024AH
.word 010FH
.word 0FH
.word 0FFECH
.word 0C6H
.word 0220H
.word 0312H
.word 02D3H
.word 012FH
.word 0FEBDH
.word 0FC97H
.word 0FBCBH
.word 0FCB0H
.word 0FE9EH
.word 029H
.word 0FFDCH
.word 0FD11H
.word 0F884H
.word 0F436H
.word 0F2A0H
.word 0F58AH
.word 0FD12H
.word 075FH
.word 01135H
.word 01732H
.word 01732H
.word 01135H
.word 075FH
.word 0FD12H
.word 0F58AH
.word 0F2A0H
.word 0F436H
.word 0F884H
.word 0FD11H
.word 0FFDCH
.word 029H
.word 0FE9EH
.word 0FCB0H
.word 0FBCBH
.word 0FC97H
.word 0FEBDH
.word 012FH
.word 02D3H
.word 0312H
.word 0220H
Einstein College of Engineering
Page 68 of 81
0C6H
0FFECH
0FH
010FH
024AH
*
Move the Filter coefficients
from program memory to data memory
START:
LAR
MAR
RPT
BLKP
SETC
AR0,#0200H
*,AR0
#33H
CTABLE,*+
CNF
MODEL GRAPH:
TABULATION:
S.No.
Frequency(Hz)
Vout(v)
Vout/Vin
Gain in db=
20log Vout/Vin
RESULT:
Thus the program for designing a FIR band pass filter in serial mode was
performed.
EX.NO. 13 (d)
Date:
AIM:
To design a FIR band reject filter in serial mode.
APPARATUS REQUIRED:
1.System with VI debugger software
2.TMS 320C50 Kit.
3.CR0
ALGORITHM:
1. Start the program.
2. Initialize the C table value.
3. Load the auxillary register with 0200H.
4. Modify the auxillary register zero.
5. Block the C table to the program.
6. Set configuration control bit.
7. Load the data pointer with 0AH.
8. Initialize the analog to digital conversion.
9. Load the auxillary register 1 with 0300 content.
10. Load the accumulator in 8000H.
11. AND the accumulator with 0FFFH.
12. Subtract the accumulator content with data 800H.
13. Modify the auxillary register 1.
14. Store the accumulator data in 8000H.
15. Load the auxillary register 1 with content 0333H.
16. Zero the accumulator register.
17. Multiply the accumulator with data.
18. Load the program register, with PM bits to accumulator.
19. Load the auxillary register 1 with content 0300H.
20. Add accumulator content with 800H.
21. Shift the accumulator right 1 bit.
22. Store the accumulator content in 8200 location.
23. Branch the program to step 7.
PROGRAM:
*Approximation type:Window design- Blackmann Window
*Filter type:band Pass Filter
*Filter Order:52
*lower Cutoff frequency in KHZ=3.000000
*upper Cutoff frequency in KHZ=5.000000
282H
0FE1BH
155H
0FDA1H
14EH
0FEB9H
*
Move the Filter coefficients
from program memory to data memory
START:
LAR
MAR
RPT
BLKP
SETC
AR0,#0200H
*,AR0
#33H
CTABLE,*+
CNF
TABULATION:
S.No.
Frequency(Hz)
Vout(v)
Vout/Vin
Gain in db=
20log Vout/Vin
RESULT:
Thus the program for designing a FIR band reject filter in serial mode was
performed using TMS320C50 debugger.
Viva questions:
1.What is a continous and discrete time signal?
14. How many multiplication terms are required for doing DFT by
expressionalmethod and FFT method
16.Write the expression for order State the steps to design digital IIR filter using
bilinear method of Butterworth filter?
23. How can you design a digital filter from analog filter?
25.What is filter?
26. What are the types of digital filter according to their impulse response?
29.List the well known design technique for linear phase FIR filter design?
33.What is the principle of designing FIR filter using frequency sampling method?