DSP Cycle I & Ii
DSP Cycle I & Ii
DSP Cycle I & Ii
Ex No: 1
Date :
AIM:
ALGORITHM:
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
Step 6:
PROGRAM:
FLOWCHART
START
INPUT LENGTH OF
THE SEQUENCE
STOP
INPUTS:
For Unit Step Sequence:
Enter the N value = 7
For Exponential Sequence:
Enter the length of exponential sequence = 5
Enter the a value = 1
For Ramp Sequence:
Enter the length of Ramp = 7
% Ramp signal
clc;
clear all;
close all;
n1=input('enter the length of ramp sequence');
t=0:n1;
subplot(2,2,3);
stem(t,t);
xlabel('Time');
ylabel('Amplitude');
title('RAMP SIGNAL');
% Exponential signal
clc;
clear all;
close all;
n=input('Enter the length of exponential sequence');
t=0:n;
a=input('Enter the a value');
y=exp(a*t);
subplot(2,2,4);
stem(t,y);
ylabel('Amplitude');
xlabel('Time');
title('EXPONENTIAL SIGNALS');
% Sine sequence
clc;
clear all;
close all;
t=0:0.01:pi;
y=sin(2*pi*t)
plot(t,y);
xlabel('Time');
ylabel('Amplitude');
title('SINE SEQUENCE');
% Cosine sequence
clc;
clear all;
close all;
t=0:0.01:pi;
y=cos(2*pi*t)
plot(t,y);
xlabel('Time');
ylabel('Amplitude');
title('COSINE SEQUENCE');
OUTPUTS:
MATLAB FUNCTIONS:
Zeros(m,n)
zeros array
It creates an M-by-N matrix of zeros
Ones(m,n)
ones array
It creates an M-by-N matrix of ones
Plot(x,y)
linear plot
It plots vector y versus vector x
Stem(x,y)
RESULT:
Thus the representation of signals unit impulse, unit step, ramp,
exponential, sine & cosine sequence was generated using MATLAB.
Ex No: 2
Date :
CONVOLUTION
AIM:
To write a MATLAB program for convolution of two sequences.
LINEAR CONVOLUTION
ALGORITHM:
Step 1:
Step 2:
Step 3:
Y(n)=
x(k) h(n-k) where k=0 to N-1
k=-
PROGRAM:
FLOWCHART:
START
PERFORM CONVOLUTION
USING MATLAB
FUNCTIONS
STOP
INPUTS:
Linear convolution
Enter the first sequence
=[1
Enter the second sequence = [ 1
2
2]
4]
2
2
4
0
Circular convolution
Enter the first sequence
=[1
Enter the second sequence = [ 1
0]
0]
Circular convolution
ALGORITHM:
step 1: Start the program
step 2: The convolved signals is y(n)
step 3: The y(n) is given by formula
y(n)=y(n)+g(i)*h(j);
PROGRAM:
OUTPUTS:
Linear convolution
Circular convolution
MATLAB FUNCTIONS:
1) subplot(m,n,p) --- creates axes in tiled positions
It breaks the figure window into an m by n matrix of small axes,
select the p-th axes for the current plot. The axes are counted along the top
row of the figure window, then second row, etc.,
RESULT:
Thus the convolution of two sequences was convolved using Linear
and Circular convolution methods.
FLOWCHART:
START
STOP
INPUT:
FFT
Enter the sequence = [ 1 0
1
Enter the length of sequence = 8
0]
0]
IFFT
Enter the sequence = [ 4 0
0
Enter the length of sequence = 8
Ex No: 3
Date :
AIM:
To write a MATLAB program for the calculation of FFT signals
ALGORITHM:
Step 1:
Step 2:
Step 3:
PROGRAM:
OUTPUT:
FFT
IFFT
MATLAB FUNCTIONS:
1) subplot(m,n,p) It breaks the figure window into an m-by-n
matrix of small axes,selects the pth axes of rthe current plkot
the axes are counted along the top row figure window ,then
the second row,etc.,
2) disp(x) displays the array,without print\ing the name
If X is a string,the text is displayed
RESULT:
Thus the calculation of FFT signals using MATLAB program was
generated.
Ex No: 4
Date :
AIM:
To write the MATLAB program for designing FIR filters using
windows
ALGORITHM:
Step 1: Enter the order of the filter
Step 2: Enter the cutoff frequency
Step 3: Enter the beta value for Kaiser Window
Step 4: Generate window for length N+1
Step 5: Generate filter co-efficients
Step 6: Plot the magnitude response
PROGRAM:
FLOWCHART
START
STOP
INPUTS:
Enter the Stopband ripple = 0.04
Enter the Passband ripple = 0.05
Enter the Passband frequency = 1500
Enter the Stopband frequency = 2000
Enter the Sampling frequency = 9000
Enter the Beta value = 5.8
OUTPUTS:
RECTANGULAR WINDOW
HAMMING WINDOW
HANNING WINDOW
KAISER WINDOW
MATLAB FUNCTIONS:
RESULT:
FLOWCHART
START
STOP
Ex No: 5
Date :
AIM:
To write a MATLAB program for IIR filter design using
1)
Butterworth filter
a) Bilinear transformation
b) Impulse invariant
2)
Chebyshev type-I
ALGORITHM:
Step 1 : Get the passband and stopband ripple
Step 2 : Get the sampling freq
Step 3 : Calculate the order of filter
Step 4 : Find the window co-efficient
Step 5 : To draw the magnitude response.
PROGRAM:
BUTTERWORTH FILTER
clc;
clear all;
close all;
rp=input('Enter the Passband ripple');
rs=input('Enter the Stopband ripple');
wp=input('Enter the Passband edge frequency');
ws=input('Enter the Stopband edge frequency');
fs=input('Enter the Sampling frequency');
w1=2*wp/fs;
w2=2*ws/fs;
% filter order
[N,wn]=buttord(w1,w2,rp,rs);
% Low pass filter
[B,A]=butter(N,wn);
[h,w]=freqz(B,A,100);
T=0.001;
hertz=w/(2*pi*T);
subplot(2,2,1);
plot(hertz,abs(h));
xlabel('Hertz');
ylabel('ABS(h)');
INPUTS
BUTTERWORTH /CHEBYSHEV
Enter the Passband ripple = 5
Enter the Stopband ripple = 10
Enter the Passband edge frequency = 1200
Enter the Stopband edge frequency = 2000
Enter the Sampling frequency = 7800
BILINEAR
Enter the Passband ripple = 3
Enter the Stopband ripple = 15
Enter the Passband edge frequency = 1256.63
Enter the Stopband edge frequency = 2513.17
Enter the Sampling frequency = 2000
IMPULSE INVARIANT
Enter the Passband ripple = 5
Enter the Stopband ripple = 10
Enter the Passband edge frequency = 1200
Enter the Stopband edge frequency = 2000
Enter the Sampling frequency = 7800
title('LPF');
% High pass filter
[B,A]=butter(N,wn,'high');
[h,w]=freqz(B,A,100);
T=0.001;
hertz=w/(2*pi*T);
subplot(2,2,2);
plot(hertz,abs(h));
xlabel('Hertz');
ylabel('ABS(h)');
title('HPF');
% Band pass filter
[B,A]=butter(N,[w1,w2]);
[h,w]=freqz(B,A,100);
T=0.001;
hertz=w/(2*pi*T);
subplot(2,2,3);
plot(hertz,abs(h));
xlabel('Hertz');
ylabel('ABS(h)');
title('BPF');
% Band stop filter
[B,A]=butter(N,[w1,w2],'stop');
[h,w]=freqz(B,A,100);
T=0.001;
hertz=w/(2*pi*T);
subplot(2,2,4);
plot(hertz,abs(h));
xlabel('Hertz');
ylabel('ABS(h)');
title('BSF');
OUTPUTS
BUTTERWORTH
BILINEAR
IMPULSE INVARIANT
BILINEAR TRANSFORMATION
clc;
clear all;
close all;
rp=input('Enter the Passband ripple');
rs=input('Enter the Stopband ripple');
wp=input('Enter the Passband edge frequency');
ws=input('Enter the Stopband edge frequency');
fs=input('Enter the Sampling frequency');
% Filter order
[N,wn]=buttord(wp,ws,rp,rs,'s');
disp(N);
[num,den]=butter(N,wn,'s');
[b,a]=bilinear(num,den,fs);
freqz(b,a,512,fs);
xlabel('Frequency in Hertz');
ylabel('Gain in dB');
title('Bilinear');
IMPULSE INVARIANT
clc;
clear all;
close all;
rp=input('Enter the Passband ripple');
rs=input('Enter the Stopband ripple');
wp=input('Enter the Passband edge frequency');
ws=input('Enter the Stopband edge frequency');
fs=input('Enter the Sampling frequency');
% Filter order
[N,wn]=buttord(wp,ws,rp,rs,'s');
[b,a]=butter(N,wn,'s');
[bz,az]=impinvar(b,a,fs);
freqz(bz,az,512,fs);
xlabel('Frequency in Hertz');
ylabel('Gain in dB');
title('Impulse Invariant');
CHEBYSHEV
PROGRAM:
CHEBYSHEV FILTER
clc;
clear all;
close all;
rp=input('Enter the Passband ripple');
rs=input('Enter the Stopband ripple');
wp=input('Enter the Passband edge frequency');
ws=input('Enter the Stopband edge frequency');
fs=input('Enter the Sampling frequency');
w1=2*wp/fs;
w2=2*ws/fs;
% filter order
[N,wn]=buttord(w1,w2,rp,rs);
% Low pass filter
[B,A]=butter(N,wn);
[h,w]=freqz(B,A,100);
T=0.001;
hertz=w/(2*pi*T);
subplot(2,2,1);
plot(hertz,abs(h));
xlabel('Hertz');
ylabel('ABS(h)');
title('LPF');
% High pass filter
[B,A]=butter(N,wn,'high');
[h,w]=freqz(B,A,100);
T=0.001;
hertz=w/(2*pi*T);
subplot(2,2,2);
plot(hertz,abs(h));
xlabel('Hertz');
ylabel('ABS(h)');
title('HPF');
% Band pass filter
[B,A]=butter(N,[w1,w2]);
[h,w]=freqz(B,A,100);
T=0.001;
hertz=w/(2*pi*T);
subplot(2,2,3);
plot(hertz,abs(h));
xlabel('Hertz');
ylabel('ABS(h)');
title('BPF');
% Band stop filter
[B,A]=butter(N,[w1,w2],'stop');
[h,w]=freqz(B,A,100);
T=0.001;
hertz=w/(2*pi*T);
subplot(2,2,4);
plot(hertz,abs(h));
xlabel('Hertz');
ylabel('ABS(h)');
title('BSF');
MATLAB FUNCTIONS:
RESULT:
Thus the MATLAB program for IIR filter using butterworth
filter was designed and executed.
INPUT
Enter the sampling frequency: 1200
OUTPUT
Ex No: 6
Date :
POLYPHASE DECOMPOSITION
AIM:
To write a program to compute Convolution and m-fold decimation by
Polyphase decomposition.
ALGORITHM:
Step 1: Get the input sequence.
Step 2: Get the filter coefficients and also the decimation factor. Find the
response by using convolution.
Step 3: Plot the graph.
PROGRAM:
%Analog signal
t=-0.005:0.00005:0.005; xa=exp(-1000*abs(t));
%Discrete time signal
Fs=input('Enter the sampling frequency(Fs)= '); Ts=1/Fs;
n=-25:1:25;
xn=exp(-1000*abs(n*Ts));
%Discrete time Fourier transform
N=500;
k=0:1: N;
w=(2*pi*k/N);
X=xn*exp(-j*n'*w); X=abs(X);
%omega range from -Wmax to Wmax
W=[-fliplr(w),w(2:N+1)];
%X over -Wmax to Wmax interval
X=[fliplr(X),X(2:N+1)]; subplot(2,1,1);
plot(t*1000,xa,'k'); grid;
hold on;
stem(n*Ts*1000,xn,'k');
xlabel('time in sec');ylabel('x(n)');
title('discrete time signal');
gtext('Ts=1msec');
hold off;
RESULT:
Thus
the
MATLAB
program
for
DECOMPOSITION was designed and executed.
POLYPHASE
INPUT:
Enter the frequency f1=2.5
Enter the frequency f2=0.32
Enter the cut-off frequency =2.51
OUTPUTS:
Ex No: 7
Date :
SAMPLING THEOREM
AIM:
To verify the sampling theorem using MATLAB.
ALGORITHM:
Step 1: Get the input frequency f1 and f2. Assign the value for n.
Step 2: Get the cutoff frequency f c. Calculate the value of x.
Step 3: Calculate the value of x a and x amp.
Step 4: Plot the graph for input sequence X (n),X
a(n),
and X
PROGRAM:
f1=input('Enter the frequency:');
f2=input('Enter the frequency:');
n=0:255;
fc=input('Enter the cut-off frequency');
x=cos(2*pi*f1*n)+cos(2*pi*f2*n);
xa=cos(2*pi*fc*n);
xamp=x.*xa;
subplot(2,2,1);
plot(n,x);
title('x(n)');
xlabel('n');
ylabel('amp');
subplot(2,2,2);
plot(n,xa);
title('xa(n)');
xlabel('n');
ylabel('amp');
subplot(2,2,3);
plot(n,xamp);
title('xamp(n)');
xlabel('n');
ylabel('amp');
RESULT:
Thus sampling theorem was verified by using MATLAB.
amp(n).
Ex No: 7a
Date :
SAMPLING THEOREM
AIM:
To verify the sampling theorem using MATLAB.
ALGORITHM:
Step 1: Sampling frequency and time period is mentioned.
Step 2: Message signal is given as addition of two signals..
Step 3: Calculate FFT of x .
Step 4: Plot the graph for output sequence.
PROGRAM:
Under Sampling
clc;
clear all;
close all;
fs =1000;
t=0:1/fs: 10/fs;
x=cos(2*pi*400*t)+cos(2*pi*100*t);
xm=abs (fft(x));
disp (xm);
k=0: length (xm)-1;
figure (1);
stem (100*k, xm);
xlabel (HZ);
ylabel (Magnitude);
title (NR Sampling);
OUTPUTS:
NYQUIST SAMPLING
UNDER SAMPLING
OVER SAMPLING
Over Sampling
clc;
clear all;
close all;
fs =2000;
t=0:1/fs: 20/fs;
x=cos(2*pi*400*t)+cos(2*pi*100*t);
xm=abs (fft(x));
disp (xm);
k=0: length (xm)-1;
figure (1);
stem (100*k, xm);
xlabel (HZ);
ylabel (Magnitude);
title (NR Sampling);
RESULT:
Thus nyquist ,under & over sampling was verified by using
MATLAB.
INPUT:
Enter the input sequence=[0 1 2 3 4 5 6 7 8]
OUTPUT:
Ex No: 8
Date:
RESULT:
Thus the DFT of the given sequence was generated using MATLAB.
INPUT:
Enter the input sequence=[0 1 2 3 4]
OUTPUT:
Ex No: 8a
Date :
AIM:
To find the IDFT of the given sequence using MATLAB.
ALGORITHM:
Step 1: Get the sequence.
Step 2: Get the length of the sequence.
Step 3: Initialise the scale for k and n.
Step 4: Use the appropriate function to generate the required transform.
add title to the transform.
PROGRAM
x=input ('Enter the input sequence');
N=length(x);
for n=1:N
Sum=0;
for k=1:N
sum=sum+(x(k)*exp(j*2*pi*(n-1)*(k-1)/N));
end
y(n)=sum/N;
end
subplot(2,2,1);
stem(x);
xlabel('n');
ylabel('x(n)');
title('inputsequence');
subplot(2,2,2);
stem(real(y));
xlabel('n');
ylabel('y(n)');
title('real(y)');
subplot(2, 2, 3);
stem(imag(y));
xlabel('n');
ylabel('y(n)');
title('imag(y)');
disp(x);
disp(real(y));
disp(imag(y));
RESULT:
Thus the IDFT of the given sequence was generated using MATLAB.
Ex No: 9
Date :
AIM:
To write MATLAB programs for image processing using
input tool box.
ALGORITHM:
STEP 1: Input the image
STEP 2: Process the image
STEP 3: Display the processed image
PROGRAM:
% Reading an image
clc;
clear all;
close all;
x=imread('cameraman.tif');
imshow(x);
% Reading an Indexed image
clc;
clear all;
close all;
[x,map]=imread('flowers.tif');
imshow(x,map);
% Resizing an image
clc;
clear all;
close all;
x=imread('rice.tif');
y=imresize(x,0.5,'bilinear');
imshow(x)
figure,imshow(y)
% Rotating an image
clc;
clear all;
close all;
x=imread('rice.tif');
y=imrotate(x,20,'bilinear');
imshow(x);
figure,imshow(y)
OUTPUTS:
Reading an image
Resized Image
RESULT:
Thus the MATLAB program image processing using image
processing tool box was executed.
Rotating Image
Ex No: 10
Date :
AIM:
To study about addressing modes in TMS320C5X debugger.
APPARATUS REQUIRED:
1. System with TMS 320C50 debugger software
2. TMS 320C50 Kit.
3. RS232 cable.
ADDITION
PROGRAM:
INP1
.SET 0H
INP2
.SET 1H
OUT
.SET 2H
.mmregs
.text
START:
LD #140H, DP
RSBX CPL
NOP
NOP
NOP
NOP
LD
INP1, A
ADD INP2, A
STL A, OUT
HLT: B
HLT
SUBTRACTION
PROGRAM:
INP1
.SET 0H
INP2
.SET 1H
OUT
.SET 2H
.mmregs
.text
START:
LD #140H, DP
RSBX CPL
NOP
NOP
NOP
ADDITION
INPUT:
Data Memory:
A000h
A001h
0004h
0004h
OUTPUT:
Data Memory:
A002h
0008h
SUBTRACTION
INPUT:
Data Memory:
A000h
A001h
0004h
0002h
OUTPUT:
Data Memory:
A002h
0002h
MULTIPLICATION
OUTPUT:
A002H 2H
DIVISION
INPUT:
DATA MEMORY
A000H
000AH
A001H
0002H
OUTPUT:
A002H
0005H
NOP
LD
INP1, A
SUB INP2, A
STL A, OUT
HLT: B
HLT
MULTIPLICATION
PROGRAM:
.mmregs
.text
START:
STM #0140H, ST0
STM #40H, PMST
STM #0A000H, AR0
ST
#1H,*AR0
LD *AR0+, T
ST
#2H,*AR0
MPY *AR0+, A
STL A,*AR0
HLT: B
HLT
DIVISION
PROGRAM:
DIVID
DIVIS
OUT
.SET 0H
.SET 1H
.SET 2H
.mmregs
.text
START:
STM #140H, ST0
RSBX CPL
RSBX FRCT
NOP
NOP
NOP
NOP
LD
DIVID, A
RPT #0FH
SUBC DIVIS, A
STL A, OUT
HLT: B
HLT
RESULT:
Thus, the arithmetic operations using TMS320C5x was performed
successfully.
Ex No: 11
Date :
AIM:
To implement circular and linear convolution in TMS320C5x debugger.
APPARATUS REQUIRED:
1. System with TMS 320C5x debugger software
2. TMS 320C5x Kit.
3. RS232 cable.
CIRCULAR CONVOLUTION FOR FOUR INPUTS
PROGRAM:
.mmregs
.text
START:
STM #0140H,ST0
RSBX CPL
RSBX FRCT
NOP
NOP
NOP
NOP
STM #0A020H,AR2
RPT #4H
ST #0H,*AR2+
STM #0A000H,AR0
STM #0A010H,AR1
STM #0A020H,AR2
STM #0A030H,AR3
STM #3H,AR4
CALL ROT1
CALL CONV
NEXTY: CALL ROT2
CALL CONV
BANZ NEXTY,*AR4HLT: B HLT
ROT1:
STM #0A011H,AR0
STM #0A013H,AR1
LD *AR0,A
LD *AR1,B
STL A,*AR1
STL B,*AR0
RET
ROT2:
STM #0A013H,AR0
STM #0A012H,AR1
LD *AR0,A
STM #2H,BRC
RPTB ROT
LD *AR1-,B
ROT:
STL B,*AR0STM #0A010H,AR0
STL A,*AR0
STM #0H,BRC
RET
CONV:
STM #0A000H,AR0
STM #0A010H,AR1
LD #0H,A
STM #3H,BRC
RPTB CON
LD *AR0+,T
CON:
MAC *AR1+,A
STL A,*AR3+
RET
PROGRAM:
.mmregs
.text
START:
STM #40H,ST0
RSBX CPL
RSBX FRCT
NOP
NOP
NOP
NOP
STM #0A000H,AR0
STM #00100H,AR1
STM #0A020H,AR2
LD #0H,A
RPT #4H
STL A,*AR2+
STM #0A004H,AR0
INPUT:
0A000
0A001
0A002
0A003
INPUT:
0A010
0A011
0A012
0A013
OUTPUT
0002
0001
0002
0001
X2(n) DATA MEMORY
0001
0002
0003
0004
: Y(n) DATA MEMORY
0A030
0A031
0A032
0A033
000E
0010
000E
0010
CONVOLUTION FOR FOUR INPUTS
INPUT:
0A000
0A001
0A002
0A003
INPUT:
00100
00101
00102
00103
OUTPUT:
0A030
0A031
0A032
0A034
0A035
X(n)
DATA MEMORY
0001H
0003H
0001H
0003H
H(n)
PROGRAM MEMORY
0000H
0001H
0002H
0001H
Y(n)
0001
0005
0008
0008
0007
;h(n)
DATA MEMORY
LD #0H,A
RPT #5H
STL A,*AR0+
STM #0A000H,AR0
STM #0A020H,AR2
STM #0A030H,AR3
STM #6H,BRC
RPTB CONV
LD *AR0+,A
STM #0A020H,AR2
STL A,*AR2
STM #0A023H,AR2
LD #0H,A
RPT #3H
MACD *AR2-,0100H,A
CONV STL A,*AR3+
HLT:
B HLT
RESULT:
Thus the linear and circular convolution of two sequences is done
successfully by using TMS320C5x.
Ex No: 12
Date :
AIM:
To implement sampling of analog signal in TMS320C5xdebugger.
APPARATUS REQUIRED:
1. System with TMS 320C5x debugger software
2. TMS 320C5x Kit.
3. RS232 cable.
SAMPLING
PROGRAM:
.mmregs
.text
START:
STM # 01h, ST0
RSBX CPL
RSBX FRCT
NOP
NOP
NOP
NOP
*****loop to make x(n) zero initially*****
STM # 150H,AR1
LD
# 0H,A
RPT # 34H
STL A,*AR1+
STM # 3H,AR3
LOOP:
LD
# 0H,A
BANZ DEL0,*AR3PORTR 04,0
LD
0,A
AND # 0FFFH,A
XOR # 0800H,A
SUB # 800H,A
PORTR 06,0
STM # 3H,AR3
B
STORE
DEL0:
RPT # 10
NOP
*****filtering operation*****
STORE:
STM # 150H,AR1
STL A,*AR1
STM # 183H,AR2
LD
# 0H,A
*****loop for convolution process*****
RPT # 33H
MACD *AR2-,TABLE,A
STH A,1,0H
MPY 0H,# 4H,A
LD
0H,A
ADD # 800H,A
STL A,1H
PORTW 1H,04H
B
LOOP
TABLE:
.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
65H
0FF97H
0FED1H
0FE48H
0FE24H
0FE78H
0FF3CH
46H
15EH
23BH
29FH
25FH
174H
0H
0FE4CH
0FCBAH
0FBB9H
0FBAAH
0FCCFH
0FF37H
2BAH
6F9H
0B6FH
0F7FH
1297H
1443H
.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
1443H
1297H
0F7FH
0B6FH
6F9H
2BAH
0FF37H
0FCCFH
0FBAAH
0FBB9H
0FCBAH
0FE4CH
0H
174H
25FH
29FH
23BH
15EH
46H
0FF3CH
0FE78H
0FE24H
0FE48H
0FED1H
0FF97H
65H
RESULT:
Thus the sampling process is verified and executed using TMS320C5X.
WAVEFORM GENERATION
Ex No: 13
Date :
AIM:
To implement different waveforms in TMS320C5X debugger.
APPARATUS REQUIRED:
1. System with TMS 320C5X debugger software
2. TMS 320C5X Kit.
3. RS232 cable.
4. Function generator.
REP:
ST
#0H,DATA
CALL DELAY
ST
#0FFFH,DATA
CALL DELAY
B
REP
DELAY:
STM #0FFFH,AR1
DEL1:
PORTW DATA,04H
BANZ DEL1,*AR1RET
TRIANGULAR WAVE GENERATION
PROGRAM:
DATA
.SET 0H
.mmregs
.text
START:
STM #140H,ST0
RSBX CPL
NOP
NOP
NOP
NOP
REP:
ST
#0H,DATA
INC:
LD
DATA,A
ADD #1H,A
STL A,DATA
PORTW DATA,04H
CMPM DATA,#0FFFH
BC
INC,NTC
DEC:
LD
DATA,A
SUB #1H,A
STL A,DATA
PORTW DATA,04H
CMPM DATA,#0H
BC
DEC,NTC
B
REP
RESULT:
Thus the waveforms were generated and executed using TMS320C5X.
Ex No: 14
Date :
FIR FILTER
AIM:
To implement FIR band pass filter in TMS320C5x debugger.
APPARATUS REQUIRED:
1. System with TMS 320C5x debugger software
2. TMS 320C5x Kit.
3. RS232 cable.
4. Function generator.
ADD #800H,A
STL A,1H
PORTW 1H,04H
B
LOOP
TABLE:
.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
208H
257H
218H
143H
0H
0FE9EH
0FD7AH
0FCE7H
0FD08H
0FDD1H
0FEECH
0FFE4H
3DH
0FFA1H
0FDFCH
0FB8FH
0F8ECH
0F6D4H
0F608H
0F713H
0FA21H
0FEE6H
4A7H
0A60H
0EF8H
1187H
1187H
0EF8H
0A60H
4A7H
0FEE6H
0FA21H
0F713H
0F608H
0F6D4H
0F8ECH
0FB8FH
0FDFCH
0FFA1H
3DH
0FFE4H
0FEECH
0FDD1H
0FD08H
.word
.word
.word
.word
.word
.word
.word
.word
0FCE7H
0FD7AH
0FE9EH
0H
143H
218H
257H
208H
RESULT:
Thus the FIR band pass filter was executed successfully.