Upload
muthu-saravanan
View
216
Download
0
Embed Size (px)
Citation preview
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 1/108
SRI ESHWAR COLLEGE OF ENGINEERING KONDAMPATTI, COIMBATORE – 641 202
Department of Electronics and Communication Engineering
DIGITAL SIGNAL PROCESSING
LABORATORY MANUAL
(2010 – 2011)
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 2/108
E!NO: GENERATION OF SINE, S"UARE AND
DATE# TRIANGULAR WA$E FORMS
AIM#
To generate sine wave, triangular wave, square wave.
ALGORITHM#
1! SINE WA$E#
STEP 1# Get the values of‘t’ for sine wave.
STEP 2# Generate the function with y (n) =sin (2*i*t).
STEP %# Ta!e ‘"’ as the ti#e erio$ an$ ‘y’ as the a#litu$e of the wavefor#.
2! TRIANGULAR WA$E#
STEP 1# Get the values of‘t’.
STEP 2# Give the a#litu$e for correson$ing osition.
STEP %# %lot the function with ‘"’ as the ti#e erio$ an$ ‘y’ as the a#litu$e.
%! S"UARE WA$E#
STEP 1# Get the values of‘t’ for square wave.
STEP 2# Give a#litu$e for correson$ing osition.
STEP %# %lot the function with ‘"’ as the ti#e erio$ an$ ‘y’ as a#litu$e.
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 3/108
FLOWCHART#
&T'T
T+- T- /'0-
G--'T- T- &-1-3- 45 -4-& 4-&
3466'7 89 T- %-7-5-7 7-5T4
+ael ";a"is: T6- 7-<
+ael y;a"is: '6%+T7-
&T4%
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 4/108
PROGRAM#
1! S"UARE SE"UENCE#
2! SINE SE"UENCE#
clc >=inut(?enter the length of the inut sequence?)<>=inut(?enter the n@. of cycles?)
n>=@:iA>:<>*i
9>=sin(2*n>)
sulot(B,2,>) lot(n>*>Ai,9>)
title(?sinusoi$al sequence?)
"lael(?sa#le...C?)ylael(?a#litu$e.....C?)
%! TRIANGULAR SE"UENCE#
clc
t=;2:D:2y=EFeros(D,D),ones(D,D),Feros(D,D),ones(D,D),Feros(D,D)
sulot(2,2,D)
lot(t,y)"lael(?sa#leHC?)
ylael(?a#litu$eH..C?)
title(?triangle sequence:?)
INPUT#1! S"UARE WA$E#
sa#ling frequency:>@@
no of sa#les:>@frequency of square wave:>@2! SINUSOIDAL SE"UENCE#
enter the length of the inut sequence:D@enter the n@. of cycles:D@
OUTPUT#
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 5/108
1! S"UARE WA$E#
2! SINUSOIDAL SE"UENCE#
%! TRIANGULAR SE"UENCE#
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 6/108
RESULT#
Thus the 6'T+'8 rogra#s for generation of sine, square an$ triangular wavefor# iswritten, e"ecute$ an$ the outut is verifie$.
EP! NO!# GENERATION OF SE"UENCE
DATE #
AIM#
To write an$ e"ecute the 6'T+'8 si#ulation rogra# for generating the followingsequence
(i) nit i#ulse sequence
(ii) nit ste sequence(iii) nit ra# sequence
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 7/108
ALGORITHM#
UNIT IMPULSE SE"UENCE#
STEP 1# &tart the rocessSTEP 2# 4tain the length of the sequence
STEP %# Generate the sequence
STEP 4# %lot the generate$ sequence
STEP &# &to the rocess
UNIT STEP SE"UENCE#
STEP 1# &tart the rocess
STEP 2# 4tain the length of the sequence
STEP %# Generate the sequence y(n)=D@, @InI;D
STEP 4# %lot the generate$ sequenceSTEP &# &to the rocess
UNIT RAMP SE"UENCE#
STEP 1# &tart the rocess
STEP 2# 4tain the length of the sequence
STEP %# Generate the sequence y(n)=n, @InI;D
STEP 4# %lot the generate$ sequence
STEP &# &to the rocess
FLOWCHART#
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 8/108
PROGRAM#
UNIT IMPULSE SE"UENCE#
clc
n=;2:D:2y=EFeros(D,2),ones(D,D),Feros(D,2)
T'+&- T- /'0-546 '&&6- '& ;2 T4 2
G--'T- T- &-1-3- 45 -4& '7 4-&
3466'7 89 T- %-7-5-7 7-5T4&
+'8-+ < '<&: T6- 7-<
+'8-+ 9 '<&: '6%+T7- 7-<
&T4%
&T'T
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 9/108
sulot(2,2,D)
ste#(n,y)
title(?unit i#ulse?)"lael(?ti#e in$e".....C?)
ylael(?a#litu$e.....C?)
$is(n)
UNIT STEP SE"UENCE#
clc
a=inut(?enter the length of the inut sequence?)
nD=@:D:a;Dy=Eones(D,a)
sulot(B,2,2)
ste#(nD,y)title(?unit ste?)
"lael(?ti#e in$e".....C?)
ylael(?a#litu$e.....C?)$is(nD)
UNIT RAMP SE"UENCE#
clc
aD=inut(?enter the length of the inut sequence?)n2=@:D:aD;D
sulot(2,2,B)
ste#(n2,n2)
title(?unit a#?)"lael(?ti#e in$e"....C?)
ylael(?a#litu$e.....C?)$is(n2)
GRAPH#
OUTPUT #
-nter the length of the ste sequence: J-nter the length of ra# sequence: J
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 10/108
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 11/108
RESULT#
Thus the 6'T+'8 si#ulation rogra# for generatingD. nit ste sequence
2. nit ra# sequence
B. nit i#ulse sequence
are e"ecute$ an$ outut is verifie$.
EP! NO!# LINEAR CON$OLUTION
DATE #
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 12/108
AIM#
To write an$ e"ecute 6'T+'8 rogra# to fin$ linear convolution
ALGORITHM#
STEP 1# &tart the rogra#
STEP 2# Get the two signals "(n) an$ h(n) in #atri" for#
STEP %# The convolution is $enote$ y y(n)
STEP 4# y(n)=K "(!) h(n;!). /here n=@ to nL;DSTEP &# &to the rogra#
FLOWCHART#
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 13/108
PROGRAM#
clc$is(?inut:?)
-T- "(n) '7 h(n)
y=conv(",h)
7&%+'9 %T '7 4T%T &-1-3-&
&T4%
&T'T
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 14/108
"=inut(?enter the Dst sequence:?)
h=inut(?enter the 2n$ sequence:?)
y=conv2(",h)$islay(?outut?)
figure
sulot(B,D,D)ste#(")
"lael(?sa#le;;C?)ylael(?#agnitu$e;;C?)title(?Dst sequence?)
sulot(B,D,2)
ste#(h)
"lael(?sa#le;;C?)ylael(?#agnitu$e;;C?)
title(?2n$ sequence?)
sulot(B,D,B)"lael(?sa#le;;C?)
ylael(?#agnitu$e;;C?)
ste#(y)title(?after convolution?)
$is(?the resultant signal is:?)
$is(?y?)
INPUT#
enter the Dst sequence:ED B >enter the 2n$ sequence:E2 B J M
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 15/108
OUTPUT#
The resultant signal is: y
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 16/108
RESULT#
Thus the 6'T+'8 si#ulation rogra# for linear convolution of two sa#les has een
written an$ e"ecute$.
EP! NO!# CIRCULAR CON$OLUTION
DATE #
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 17/108
AIM#
To write an$ e"ecute a 6'T+'8 si#ulation rogra# for generating a circular
convolution.
ALGORITHM#
STEP 1# Get the two signals "(n) an$ h(n) in #atri" for#
STEP 2# The convolution is $enote$ y y(n)
STEP %# y(n)=K "(!) h(n;!) when n=@ to #L7;D !=;N
STEP 4# &to the rogra#
FLOWCHART#
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 18/108
PROGRAM#
&T'T
G-T T/4
&-1-3-
5 -4%'77G
-1-
%-546 33+'
3404+T4
%4T -4
3'+3+'T-
3404+T4 896'T< 6+T%+3'T4
7&%+'9 T-
%+4T
&T4%
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 19/108
clc
"=inut(?enter the first sequence:?)
h=inut(?enter the secon$ sequence:?) D=length(")
2=length(h)
=O"=E" Feros(D,;D)
h=Eh Feros(D,;2)6=E@:D:;D$is(6)
h=h(6LD)
$is(h)
6=#o$(;6,)$is(6)
for n=D:D:
6=n;D =@:D:;D
q=#o$(;6,)
$is(q)h#=h(qLD)
(n,:)=h#
$is((n,:))
en$y="*
Plot
nD=@:D:n;Dsulot(B,D,D)
ste#(nD,")
title(? 5irst sequence?)
"lael(?sa#le.....C?)ylael(? #agnitu$e....C?)
sulot(B,D,2)ste#(nD,h)
title(?secon$ sequence?)
P"lael(?sa#el.....?)
ylael(?#agnitu$e....C?)sulot(B,D,B)
ste#(nD,y)
$is(y)title(? circular convolution ?)
"lael(?sa#le...C?)
ylael(?#agnitu$e....C?)
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 20/108
INPUT#
enter the first sequence:ED 2 B >enter the secon$ sequence:ED 2 B >
OUTPUT#
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 21/108
RESULT#
Thus the 6'T+'8 si#ulation rogra# for circular convolution of two sa#les has
een written an$ e"ecute$.
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 22/108
EP! NO!# SAMPLING OF SIGNALS
DATE #
AIM#
To write an$ e"ecute the 6'T+'8 rogra# for generating sa#ling for
the given signals.
ALGORITHM#
STEP 1# &tart the rogra#.
STEP 2# Get the an$ of signals to e sa#le$
STEP %# 7eter#ine the highest frequency co#onent
STEP 4# 3alculate twice the highest frequency co#onent
STEP &# &a#le the inut signal at three $ifferent rates of = 2f hC2f hI2f h
STEP 6# 4tain the sa#le$ signal outut
STEP '# &to the rocess.
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 23/108
FLOWCHART#
G-T T- %T &G'+&
3'+3+'T- 25
&T'
T
G-T 5
&'6%+- T- %T &G'+ 'T 25I25
C25
G-T T- 34-&%47G&'6%+-7 4T%T&
&T4%
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 24/108
PROGRAM#
fig siFe=E2B2 O> QQ> M2>TsD=@.@J
[email protected][email protected]=2*iATsD
ws2=2*iATs2
wsB=2*iATsB
wD=Qw2=2B
t=E@:@.@@J:2
"=cos(wD*t)Lcos(w2*t)$is(?"?)
$is(")
figure(D),clf,lot(t,"),gri$,"lael(?ti#e (s)?),ylael(?a#litu$e?),...title(?continuous;ti#e signal "(t)=cos(Qt)Lcos(2B)?),....
set(gcf,?osition?,figRsiFe)
tD=E@:TsD:2
"sD=cos(wD*tD)Lcos(w2*tD)$is(?"sD?)
$is("sD)
figure (2),clf,ste#(tD,"sD)gri$,hol$ on,lot(t,",?r:?),hol$ off,...
"lael(?ti#e (s)?),ylael(?a#litu$e?),....
title(?sa#le$ version of "(t) with TRs=@.@Js?),...
set(gcf,?osition?,figRsiFe)t2=E@:Ts2:2
"s2=cos(wD*t2)Lcos(w2*t2)figure (B),clf,ste#(t2,"s2)
gri$,hol$ on,lot(t,",?r:?),hol$ off,...
"lael(?ti#e (s)?),ylael(?a#litu$e?),....
title(?sa#le$ version of "(t) with [email protected]?),...set(gcf,?osition?,figRsiFe)
tB=E@:TsB:2
"sB=cos(wD*tB)Lcos(w2*tB)figure (>),clf,ste#(tB,"sB)
gri$,hol$ on,lot(t,",?r:?),hol$ off,...
"lael(?ti#e (s)?),ylael(?a#litu$e?),....title(?sa#le$ version of "(t) with [email protected]?),...
set(gcf,?osition?,figRsiFe)
w2sB=w2;wsB
"D=cos(wD*t)Lcos(w2sB*t)figure (J),clf,ste#(tB,"sB)
gri$,hol$ on,lot(t,",?!:?,t,"D,?r:?),hol$ off,...
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 25/108
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 26/108
"lael(?ti#e (s)?),ylael(?a#litu$e?),....title(?sa#ling "(t) an$ "D(t) with [email protected]?),...
set(gcf,?osition?,figRsiFe)
te"t(D.DB,D.2,?"(t)?),te"t(@.D,D.M,?"RD(t)?)n=E;D @ D
w"=E;w2 ;wD wD w2w"D=Ew"2=E
w"B=E
for i=D:length(n)
w"D=Ew"D (w"Ln(i)*wsD)w"2=Ew"2 (w"Ln(i)*ws2)
w"B=Ew"B (w"Ln(i)*wsB)
en$w"D=sort(w"D)
w"2=sort(w"2)
w"B=sort(w"B)clear i
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 27/108
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 28/108
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 29/108
RESULT#
Thus the 6'T+'8 si#ulation rogra# for generating sa#les of the given signal has
een written an$ e"ecute$.
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 30/108
EP NO# BUTTERWORTH FILTER
DATE #
AIM#
To write an$ e"ecute a 6'T+'8 rogra# to $esign a 8utterworth
a) +ow ass filter
) igh ass filterc) 8an$ ass filter
$) 8an$ sto filter
ALGORITHM#
STEP 1: &tart the rogra#.
STEP 2: Get the values of ass an$ an$ sto an$ rile, ass an$ an$ sto an$
frequency an$ sa#ling frequency.
STEP %: 3alculate the or$er of the filter.
STEP 4: 3o#ute the frequency resonse an$ lot the grah.
STEP &: &to the rogra#.
ft:[email protected] &tri!e D.M PJ8%ortalePJ7.e"e
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 31/108
FLOWCHART#
1! LOW PASS FILTER
-'7 r, rs, ws, fs
&- 8TT47 T4 7-&G +%5
&T' T
-'7 T- 47- 45 5+T-
G-T T- ''+4G 546
%+4T T- -&+T
&T4%
48T' 6'GT7- '7 %'&-
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 32/108
PROGRAM#
1! LOW PASS FILTER
clc$is(?nut:?)
r=inut(?-nter the assan$ rile?)
rs=inut(?-nter the sto an$ rile?)
w=inut(?-nter the assan$ frequency?)ws=inut(?-nter the stoan$ frequency?)
fs=inut(?-nter the sa#ling frequency?)
wD=2*(wAfs)w2=2*(wsAfs)
$is(?4utut:?)
$is(?4r$er of sequence?)En,wn=uttor$(wD,w2,r,rs,?s?)n
$is(?B $ cutoff frequency?)
$is(?wn?)
E,a=utter(n,wn,?low?,?s?)nw=@:.D:i
E,o#=freqs(,a,w)
#=2@*logD@(as())#an=angle()an
sulot(2,D,D)
lot(o#Ai,#)
"lael(?or#alise$ frequency?)ylael(?gain in $.....C?)
sulot(2,D,2) lot(o#Ai,an)
"lael(?or#alise$ frequency?)
ylael(?%hase in ra$ians.....C?)
title(?hase lot?)
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 33/108
FLOWCHART#
2! HIGH PASS FILTER#
-'7 r, rs, ws, fs
&- 8TT47 T4 7-&G %5
&T' T
-'7 T- 47- 45 5+T-
G-T T- ''+4G 546
%+4T T- -&+T
&T4%
48T' 6'GT7- '7 %'&-
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 34/108
PROGRAM#
2! HIGH PASS FILTER#
close all
clear all$is(?nut:?)r=inut(?-nter the assan$ rile?)
rs=inut(?-nter the sto an$ rile?)
w=inut(?-nter the assan$ frequency?)
ws=inut(?-nter the stoan$ frequency?)fs=inut(?-nter the sa#ling frequency?)
wD=2*(wAfs)
w2=2*(wsAfs)$is(?4utut:?)
$is(?4r$er of sequence?)
En,wn=uttor$(wD,w2,r,rs,?s?)n$is(?B $ cutoff frequency?)
$is(?wn?)
E,a=utter(n,wn,?high?,?s?)nw=@:.@D:i
E,o#=freqs(,a,w)
#=2@*logD@(as())#
an=angle()ansulot(2,D,D)
lot(o#Ai,#)
"lael(?or#alise$ frequency?)
ylael(?gain in $.....C?)sulot(2,D,2)
lot(o#Ai,an)"lael(?or#alise$ frequency?)
ylael(?%hase in ra$ians.....C?)
title(?hase lot?)
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 35/108
FLOWCHART#
%! BAND PASS FILTER#
-'7 r, rs, ws, fs
&- 8TT47 T4 7-&G 8%5
&T' T
-'7 T- 47- 45 5+T-
G-T T- ''+4G 546
%+4T T- -&+T
&T4%
48T' 6'GT7- '7 %'&-
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 36/108
PROGRAM#
%! BAND PASS FILTER#
clc
$is(?inut?)r=inut(?enter the assan$ rile:?)rs=inut(?enter the stoan$ rile:?)
w=inut(?enter the assan$ frequency:?)
ws=inut(?enter the stoan$ frequency:?)
fs=inut(?enter the sa#ling frequency:?)wD=2*wAfs
w2=2*wsAfs
$is(?outut?)$is(?or$er of sequence?)
En,wn=uttor$(wD,w2,r,rs,?s?)
$is(wn)wn=EwD w2
E,a=utter(n,wn,?an$ass?,?s?)
w=@:@.@D:i
Eh,o#=freqF(,a,w)#=2@*logD@(as(h))
an=angle(h)
sulot(2,D,D) lot(o#Ai,#)
ylael(?gain in $?)
"lael(?nor#alise$ frequency?)
title (?#agnitu$e resonse?)sulot(2,D,2)
lot(o#Ai,an)"lael(?nor#alise$ frequency?)
ylael(?hase in ra$ians?)
title(?hase resonse?)
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 37/108
FLOWCHART#
4! BAND STOP FILTER#
-'7 r, rs, ws, fs
&- 8TT47 T4 7-&G 8&5
&T'
T
-'7 T- 47- 45 5+T-
G-T T- ''+4G 546
%+4T T- -&+T
&T4%
48T' 6'GT7- '7 %'&-
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 38/108
PROGRAM#
4! BAND STOP FILTER#
clc
$is(?inut?)r=inut(?enter the assan$ rile:?)rs=inut(?enter the stoan$ rile:?)
w=inut(?enter the assan$ frequency:?)
ws=inut(?enter the stoan$ frequency:?)
fs=inut(?enter the sa#ling frequency:?)wD=2*wAfs
w2=2*wsAfs
En,wn=uttor$(wD,w2,r,rs,?s?)wn=EwD w2
E,a=utter(n,wn,?sto?,?s?)
w=@:@.@D:iEh,o#=freqF(,a,w)
#=2@*logD@(as(h))
an=angle(h)
sulot(2,D,D) lot(o#Ai,#)
ylael(?gain in $?)
"lael(?(a)nor#alise$ frequency?)title (?#agnitu$e resonse?)
sulot(2,D,2)
lot(o#Ai,an)
"lael(?()nor#alise$ frequency?)ylael(?hase in ra$ians?)
title(?hase resonse?)
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 39/108
GRAPH#
1! LOWPASS FILTER#
2! HIGH PASS FILTER#
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 40/108
INPUT#
1! LOWPASS FILTER#
-nter the assan$ rile@>-nter the sto an$ rileO@-nter the assan$ frequencyD>@@
-nter the stoan$ frequency>@@@
-nter the sa#ling frequencyQ@@@
2! HIGHPASS FILTER#
-nter the assan$ rile@
-nter the sto an$ rileJ@-nter the assan$ frequencyDQO@
-nter the stoan$ frequencyB>@@
-nter the sa#ling frequencyM@@@
%! BANDPASS FILTER#
enter the assan$ rile:@
enter the stoan$ rile:QO
enter the assan$ frequency:D@@@
enter the stoan$ frequency:2@@@enter the sa#ling frequency:O@@@
4! BANDSTOP FILTER#
enter the assan$ rile:@Oenter the stoan$ rile:D@
enter the assan$ frequency:D@@@
enter the stoan$ frequency:M@@@enter the sa#ling frequency: J>@@
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 41/108
GRAPH#
%! BANDPASS FILTER#
4! BANDSTOP FILTER#
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 42/108
RESULT#
Thus the 8utterworth filters are e"ecute$ an$ the outut is otaine$.
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 43/108
EP! NO# CHEBYCHE$ FILTER
DATE #
AIM#
To write an$ e"ecute a 6'T+'8 si#ulation rogra# to $esign the
following analog filters using 3heychev filters
D) +ow ass filters2) igh ass filters
B) 8an$ ass filters
>) &to an$ filters
ALGORITHM#
STEP 1: &tart the rogra#.
STEP 2: Get the values of ass an$ an$ sto an$ rile, ass an$ an$ sto an$
frequency an$ sa#ling frequency.
STEP %: 3alculate the or$er of the filter.
STEP 4: se cheychev function to $esign various filter
STEP &: 3o#ute the frequency resonse an$ lot the grah.
STEP 6: &to the rogra#.
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 44/108
FLOW CHART#
1) LOW PASS FILTER#
STOP
READ , *, +*, *
READ ORDER OF THE
FILTER
USE CHEBYCHE$ IIR TO DESIGN LPF
GET THE ANALOG FORM
OBTAIN MAGNITUDE AND PHASE
PLOT THE RESULT
START
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 45/108
PROGRAM#
1) LOW PASS FILTER:
clc
$is(?inut?)r=inut(?enter the ass an$ rile:?)rs=inut(?enter the sto an$ rile:?)
w=inut(?enter the ass an$ frequency:?)
ws=inut(?enter the sto an$ frequency:?)
fs=inut(?enter the sa#ling frequency:?)wD=2*wAfs
w2=2*wsAfs
$is(?outut?)En,wn=cheDor$(wD,w2,r,rs,?s?)n
$is(?B$ cut off frequency?)
$is(?wn?)E,a=cheyD(n,r,wn,?low?)n
w=@:@.@D:i
Eh,o#=freqF(,a,w)
#=2@*logD@(as(h))#an=angle(h)an
sulot(2,D,D)
lot(o#Ai,#)"lael(?nor#alise$ frequency.....C?)
ylael(?gain in $...C?)
title(?#agnitu$e lot?)
sulot(2,D,2) lot(o#Ai,an)
"lael(?nor#alise$ frequency....C?)ylael(?hase in ra$ians....C?)
title(?hase lot?)
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 46/108
FLOW CHART#
2) HIGH PASS FILTER#
STOP
READ , *, +*, *
READ ORDER OF THE
FILTER
USE CHEBYCHE$ IIR TO DESIGN HPF
GET THE ANALOG FORM
OBTAIN MAGNITUDE AND PHASE
PLOT THE RESULT
START
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 47/108
PROGRAM#
2) HIGH PASS FILTER#
clc
$is(?inut?)r=inut(?enter the assan$ rile:?)rs=inut(?enter the stoan$ rile:?)
w=inut(?enter the assan$ frequency:?)
ws=inut(?enter the stoan$ frequency:?)
fs=inut(?enter the sa#ling frequency:?)wD=2*wAfs
w2=2*wsAfs
Pwn=EwD,w2$is(?outut?)
$is(?or$er of sequence?)
En,wn=cheDor$(wD,w2,r,rs,?s?)n$is(?B$ cutoff frequency?)
$is(wn)
E,a=cheyD(n,r,wn,?high?)
w=@:@.@D:iEh,o#=freqF(,a,w)
#=2@*logD@(as(h))#
an=angle(h)ansulot(2,D,D)
lot(o#Ai,#)
"lael(?nor#alise$ frequency;;C?)
ylael(?gain in $;;C?)title(?#agnitu$e lot?)
sulot(2,D,2) lot(o#Ai,an)
"lael(?nor#alise$ frequency;;C?)
ylael(?hase in ra$ians;;C?)
title(?hase lot?)Psulot(2,D,2)
Plot(o#Ui,an,?!?)
P"lael(?nor#alise$ frequency;C?)Pylael(?hase in ra$ians;;;;;C?)
Ptitle(?hase lot?)
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 48/108
FLOW CHART#
%) BAND PASS FILTER#
STOP
READ , *, +*, *
READ ORDER OF THE
FILTER
USE CHEBYCHE$ IIR TO DESIGN BPF
GET THE ANALOG FORM
OBTAIN MAGNITUDE AND PHASE
PLOT THE RESULT
START
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 49/108
PROGRAM#
%) BAND PASS FILTER#
clc$is(?inut?)r=inut(?enter the ass an$ rile:?)
rs=inut(?enter the sto an$ rile:?)
w=inut(?enter the ass an$ frequency:?)
ws=inut(?enter the sto an$ frequency:?)fs=inut(?enter the sa#ling frequency:?)
wD=2*wAfs
w2=2*wsAfs$is(?outut?)
$is(?or$er of sequence?)
En,wn=cheDor$(wD,w2,r,rs,?s?)nwn=EwD w2
$is(?B$ cut off frequency?)
$is(?wn?)
E,a=cheyD(n,r,wn,?an$ass?)nw=@:@.@D:i
Eh,o#=freqF(,a,w)
#=2@*logD@(as(h))#an=angle(h)an
sulot(2,D,D)
lot(o#Ai,#)
"lael(?nor#alise$ frequency.....C?)ylael(?gain in $...C?)
title(?#agnitu$e lot?)sulot(2,D,2)
lot(o#Ai,an)
"lael(?nor#alise$ frequency....C?)
ylael(?hase in ra$ians....C?)title(?hase lot?)
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 50/108
FLOW CHART#
4) BAND STOP FILTER#
STOP
READ , *, +*, *
READ ORDER OF THEFILTER
USE CHEBYCHE$ IIR TO DESIGN BSF
GET THE ANALOG FORM
OBTAIN MAGNITUDE AND PHASE
PLOT THE RESULT
START
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 51/108
PROGRAM#
4) BAND STOP FILTER#
clc$is(?inut?)r=inut(?enter the ass an$ rile:?)
rs=inut(?enter the sto an$ rile:?)
w=inut(?enter the ass an$ frequency:?)
ws=inut(?enter the sto an$ frequency:?)fs=inut(?enter the sa#ling frequency:?)
wD=2*wAfs
w2=2*wsAfs$is(?outut?)
En,wn=cheDor$(wD,w2,r,rs)n
$is(?B$ cut off frequency?)$is(?wn?)
wn=EwD w2
E,a=cheyD(n,r,wn,?sto?)
w=@:@.@D:iEh,o#=freqF(,a,w)
#=2@*logD@(as(h))#
an=angle(h)ansulot(2,D,D)
lot(o#Ai,#,?!?)
"lael(?nor#alise$ frequency.....C?)
ylael(?gain in $...C?)title(?#agnitu$e lot?)
sulot(2,D,2) lot(o#Ai,an,?!?)
"lael(?nor#alise$ frequency....C?)
ylael(?hase in ra$ians....C?)
title(?hase lot?)
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 52/108
OUTPUT#
1) LOW PASS FILTER#
2) HIGH PASS FILTER#
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 53/108
INPUT#
1) LOW PASS FILTER#
enter the ass an$ rile:@.@
enter the sto an$ rile:J@enter the ass an$ frequency:B@@@enter the sto an$ frequency:J@@@
enter the sa#ling frequency:@@@
2) HIGH PASS FILTER#
enter the assan$ rile:@.@Jenter the stoan$ rile:BJ
enter the assan$ frequency:D@@@
enter the stoan$ frequency:D>@@enter the sa#ling frequency: >>@@@
%) BAND PASS FILTER#
enter the ass an$ rile:@.@@B
enter the sto an$ rile:BJ
enter the ass an$ frequency:2J@@enter the sto an$ frequency:J@@@
enter the sa#ling frequency:D2@@@
4) BAND STOP FILTER#
enter the ass an$ rile:@.@Denter the sto an$ rile:2@
enter the ass an$ frequency:B@@@
enter the sto an$ frequency:BJ@@enter the sa#ling frequency:D2@@@
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 54/108
OUTPUT#
%) BAND PASS FILTER#
4) BAND STOP FILTER#
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 55/108
RESULT#
Thus the cheychev filters are e"ecute$ an$ the outut is otaine$.
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 56/108
EP NO#
WINDOWING TECHNI"UES
DATE#
AIM#To write an$ e"ecute the 6'T+'8 si#ulation rogra# for the following win$owing
techniquesD.8lac!#ann
2.a##ing an$
B.anning.
ALGORITHM#
1! BLACKMANN#
STEP 1# &tart the rogra#.
STEP 2# Get the nu#er of oints ().
STEP %# sing the function 8lac!#ann () $esign the win$ow for
frequency (@ : @.@D : i).
STEP 4# /in$ow outut.
STEP &# &to the rogra#.
2!HAMMING#
STEP 1# &tart the rogra#.
STEP 2# Get the nu#er of oints ().3alculate the alha value.
STEP %# sing the function a##ing () $esign the win$ow for frequency
(@ : @.@D : i).
STEP 4# /in$ow outut.
STEP &# &to the rogra#.
%!HANNING#
STEP 1# &tart the rogra#.
STEP 2# Get the nu#er of oints ().
3alculate alha value.STEP %# sing the function anning () $esign the win$ow for frequency
(@ : @.@D : i).
STEP 4# /in$ow outut.
STEP &# &to the rogra#.
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 57/108
FLOWCHART#
1! BLACKMANN WINDOW#
G-T T- 0'+- 45
3'+3+'T- &G T- /74/ 53T4
8+'3V6' 54 0'+-&
3'+3+'T- T- 5-1-39 &'6%+- &G T-53T4 5-1-39
%+4T T- 4T%T
&T'
T
&T4%
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 58/108
PROGRAM#
1!BLACKMANN WINDOW#
clcwi=B*i =2J
alha=(;D)A23%&=@.@@D
n=@:D:;D
h$=sin(wi*(n;alha;3%&)A(i*(n;alha)))/r=o"car()
hn=h$*/r
w=@:@.@D:ih=freqF(hn,D,w)
lot(wAi,as(h))
hol$ onwn=lac!#an()
hn=h$*wn
w=@:@.@D:i
h=freqF(hn,D,w) lot(wAi,as(h),?...?)gri$
title(?lac!#ann win$ow?)
"lael(?nor#alise$ frequency....C?)ylael(?#agnitu$e...C?)
hol$ off
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 59/108
FLOWCHART#
2! HAMMING WINDOW#
G-T T- 0'+- 45
3'+3+'T- &G T- /74/ 53T4'66G 54 0'+-&
3'+3+'T- T- 5-1-39 &'6%+- &G T-53T4 5-1-39
%+4T T- 4T%T
&T'
T
&T4%
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 60/108
PROGRAM#
2!HAMMING WINDOW#
clc
[email protected]*i =2Jalha=(;D)A23%&=@.@@D
n=@:D:;D
h$=sin(wi*(n;alhaL3%&)A(i*(n;alhaL3%&)))
/r=o"car()hn=h$*/r
w=@:@.@D:i
h=freqF(hn,D,w) lot(wAi,as(h))
hol$ on
wn=ha##ing()hn=h$*wn
w=@:@.@D:i
h=freqF(hn,D,w)
lot(wAi,as(h),?...?)gri$title(?ha##ing win$ow?)
"lael(?nor#alise$ frequency....C?)
ylael(?#agnitu$e...C?)hol$ off
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 61/108
FLOWCHART#
%! HANNING WINDOW#
PROGRAM#
G-T T- 0'+- 45
3'+3+'T- &G T- /74/ 53T4
'G 54 0'+-&
3'+3+'T- T- 5-1-39 &'6%+- &G T-53T4 5-1-39
%+4T T- 4T%T
&T'
T
&T4%
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 62/108
%! HANNING WINDOW:
clcwi=J*i
=2Jalha=(;D)A23%&=@.@@Dn=@:D:;D
h$=sin(wi*(n;alhaL3%&)A(i*(n;alhaL3%&)))
/r=o"car()
hn=h$*/rw=@:@.@D:i
h=freqF(hn,D,w)
lot(wAi,as(h))hol$ on
wn=hanning()
hn=h$*wnw=@:@.@D:i
h=freqF(hn,D,w)
lot(wAi,as(h),?...?)gri$
title(?hanning win$ow?)"lael(?nor#alise$ frequency....C?)
ylael(?#agnitu$e...C?)
hol$ off
OUTPUT#
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 63/108
1! BLACKMANN WINDOW#
2! HAMMING WINDOW#
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 64/108
%! HANNING WINDOW#
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 65/108
RESULT#
Thus the rogra# for the $ifferent win$owing technique is written, e"ecute$ an$
verifie$.
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 66/108
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 67/108
EP NO#
STUDY OF TMS%20C&0 ARCHITECTURE
DATE#
AIM#
To stu$y the architecture of T6&B2@3J@.
DSP CHIP TMS%20C&0#
The T6&B2@3J@ is a DM;it fi"e$ oint $igital signal rocessor that co#ines the
fle"iility of a high see$ controller with the nu#erical caaility of an array rocessor,therey offering an ine"ensive alternative to #ultichi it;slice rocessor. The highly arelle$
architecture an$ efficient instruction set, rovi$e see$ an$ fle"iility caale of e"ecuting D@
6%&. The T6&B2@3J@ oti#iFes see$ y i#le#enting function in har$ware that other rocessors i#le#ent through #icroco$e or software. This har$ware;intensive aroach rovi$es the $esign engineer with rocessing ower reviously unavailale on a single chi.
The T6&B2@3J@ is the thir$ generation $igital signal rocessor in the T6&B2@ fa#ily.ts owerful instruction set, inherent fle"iility, high see$ nu#er;crunching caailities an$
innovative architecture have #a$e this high erfor#ance, cost effective rocessor the i$eal
solution to #any teleco##unication, co#uter, co##ercial, in$ustrial an$ #ilitaryalications.
KEY FEATURES OF TMS%20C&0#
The !ey features of $igital signal rocessor T6&B2@3J@ are:
• BJ;A;J@;ns single;cycle fi"e$;oint instruction e"ecution ti#e (2O.MA2@ 6%&)
• war$ source;co$e co#atile with all 3D< an$ 32< $evices.
• '6; ase$ #e#ory oeration(3J@)
• V " DM;it single; cycle on;chi rogra#A$ata '6 (3J@)
• 2V " DM;it single; cycle on; chi oot 46 (3J@)
• D@JM " DM;it $ual;access on;chi $ata '6.
• 22>V " DM;it #a"i#u# a$$ressale e"ternal #e#ory sace (M>V rogra#,
M>V $ata,M>V A4 an$ B2V gloal).
•
B2;it arith#etic logic unit ('+3), B2;it accu#ulator ('33) an$ B2;itaccu#ulator uffer ('338).
• DM;it arallel logic unit (%+)
• DM " DM;it arallel #ultilier with a B2;it ro$uct caaility.
• &ingle; cycle #ultilyAaccu#ulate instructions.
• O au"iliary registers with a $e$icate$ au"iliary register arith#etic unit for
in$irect a$$ressing.
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 68/108
• DD conte"t; switch register (sha$ow register) for storing strategic 3%;
controlle$ registers $uring an interrut service routine.
• O;level har$ware stac!
@;to DM;it left an$ right $ata arrel shifters an$ a M>;it incre#ental $ata
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 69/108
shifter.
• Two in$irectly a$$resse$ circular uffer for circular a$$ressing.
• &ingle; instruction reeat an$ loc! reeat oerations for rogra# co$e.
• 8loc! #e#ory #ove instructions for etter rogra#A$ata #anage#ent.
• 5ull;$ule" synchronous serial ort for $irect co##unication etween 3J< an$
another serial $evice.
• Ti#e;$ivision #ultile;access (T76) serial ort
• nterval ti#er with erio$, control an$ counter registers for software sto, start
an$ reset.
• M>V arallel A4 ort, DM of which are #e#ory #ae$.
• DM software rogra##ale wait;state generator for rogra#, $ata an$ A4
#e#ory saces.
ARCHITECTURE#
The T6&B2@3J@ is utiliFes a #o$ifie$ arvar$ architecture for see$ an$ fle"iility.n a strict arvar$ architecture, rogra# an$ $ata #e#ory are in two searate saces,
er#itting a full overla of instruction fetch an$ e"ecution. The T6&B2@ fa#ily’s #o$ificationof the arvar$ architecture allows transfer etween rogra# an$ $ata saces, therey
increasing the fle"iility of the $evice. This #o$ification er#its coefficients store$ rogra#
#e#ory to e rea$ into the $ata '6, eli#inating the nee$ for a searate coefficient 46. talso #a!es availale i##e$iate instructions an$ suroutines ase$ on co#ute$ values.
%2-BIT ACCUMULATOR#
The T6&B2@3J@ contains a B2;it '+ an$ accu#ulator for suort of $oule;
recision two’s co#le#ent arith#etic. The '+ is a general urose arith#etic unit that
oerates on DM;it wor$s ta!en fro# the $ata '6 or $erive$ fro# i##e$iate instruction. na$$ition to the usual arith#etic instructions '+ can erfor#s 8oolean oerations, rovi$ing
the it #aniulation aility require$ of a high see$ controller. The accu#ulator stores the
outut fro# '+ an$ is often an inut to '+. t is B2;it long. The accu#ulator is $ivi$e$
into high or$er wor$(its BD;DM) an$ low or$er(itsDJ;@). nstructions are rovi$e$ for storingan$ loa$ing the high an$ lower or$er accu#ulator wor$s to #e#ory.
16 . 16-BIT PARALLEL MULTIPLIER#
The #ultilier erfor#s a DM " DM;it 2’s co#le#ent #ultilication with a B2;it
resulting in a single instruction cycle. The #ultilier consists of three units: T;registers, %;
registers an$ #ultilier array. The DM;it T;register te#orarily stores the #ultilican$ an$ the
%;register stores the B2;it ro$uct. 6ultilier values either co#e fro# the $ata #e#ory or are$erive$ i##e$iately fro# the 6%9 (#ultily i##e$iate) instruction wor$. The fast on;chi
#ultilier allows the $evice to erfor# fun$a#ental oerations such as convolution,
correlation an$ filtering. Two #ultilyAaccu#ulate instructions in the instruction set fullyutiliFes the co#utational an$wi$th of the #ultilier, allowing oth oeran$s to e rocesse$
si#ultaneously.
SHIFTERS#
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 70/108
' DM;it scaling shifter is availale at the accu#ulator inut, this shifter ro$uces a left
shift of @ to DM;it on the inut $ata to accu#ulator.
T6&B2@3J@ also contains a shifter at the accu#ulator outut. This shifter rovi$es a
left shift of @ to Q, on the $ata fro# either the '33 or '33+ register.
n a$$ition one shifter at the outut of %;register , can shift the ro$uct y D or >;its
left or M;its right, efore transferring the ro$uct to accu#ulator.
DATA AND PROGRAM MEMORY#
&ince the T6&B2@3J@ uses arvar$ architecture, $ata an$ rogra# #e#ory resi$e in
two searate saces. '$$itionally T6&B2@3J@ has one #ore #e#ory sace calle$ A4
#e#ory sace. The total #e#ory caacity of T6&B2@3J@ is M>V/ each of %rogra#, 7ataan$ A4 #e#ory. The M>V/ of $ata #e#ory is $ivi$e$ into JD2 ages with each age
containing D2O wor$s. 4nly one age can e active at a ti#e. 4ne $ata age selection is $one
y setting $ata age ointer. T6&B2@3J@ has D@JM wor$s of $ual access on chi $ata #e#oryis $ivi$e$ as three loc!s 8@, 8D W 82, of which 8@ can e configure$ as rogra# or $ata
'6.
4ut of the M>V/ of total rogra# #e#ory, T6&B2@3J@ has 2V wor$s of on;chi
rogra# 46.
The T6&B2@3J@ offers two #o$es of oeration $efine$ y the state of the 63A6% in: the #icrorocessor #o$e (63A6%=D) or the #icrorocessor #o$e (63A6%=@). n the
#icrorocessor #o$e, on chi 46 is #ae$ into the #e#ory into the #e#ory sace with
u to 2V wor$s of #e#ory are e"ternal.
INTERRUPTS AND SUBROUTINES#
The T6&B2@3J@ has three e"ternal #as!ale user interruts availale for e"ternal
$evices that interrut the rocessor.
The T6&B2@3J@ contains a eight;level har$ware stac! for saving the contents of the rogra# counter $uring interruts an$ suroutine calls. nstructions are availale for saving the
$evice’s co#lete conte"t. %& an$ %4% instructions er#it a level of nesting restricte$ only
y the a#ount of availale '6.
SERIAL PORT#
' full;$ule" on chi serial ort co##unication with serial $evices such as co$ecs,
serial 'A7 converters an$ other serial syste#s. The interface signals are co#atile withco$ecs an$ #any other serial $evices with a #ini#u# of e"ternal har$ware.
INPUT AND OUTPUT#
The DM;it arallel $ata us can e utiliFe$ to erfor# A4 function in two cycles. The
A4 orts are a$$resse$ y the four +&8s on the a$$ress lines, allowing DM inut an$ DM outut
orts. n a$$ition, a olling inut for it test an$ Xu# oerations (84) an$ three interrut
ins(T@;T2) have een incororate$ for #ultitas!ing.
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 71/108
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 72/108
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 73/108
RESULT# Thus the architecture of T6&B2@3J@ is stu$ie$.
SINE WA$E GENERATION
/
/ PROGRAM DESCRIPTION#
/ The sine tale values are store$ in the rogra# #e#ory. 'ccu#ulator ' is initially loa$e$ with the starting a$$ress of the sine tale. The
rea$ an instruction, rea$s the content of the a$$ress which is store$ in acc.
That $ata is sent to the $ac an$ the acc. content is incre#ente$ to oint
to the ne"t value in the sin tale.
7'T' .&-T @
'77 .&-T DT'8+- .&-T 2@@
.##regs
.te"t&T'T:
&T6 YD>@,&T@ initialiFe the $ata age ointer
&8< 3%+ #a!e the rocessor to wor! using 7%
4% 4%
4%
4%-%:
+7 YT'8+-,' +oa$ the a$$ress first value of the sine
tale to the accu#ulator
&T6 YBQ2,'D no. of sine tale values+44%:
-'7' 7'T' rea$ the sine tale value %4T/ 7'T',@> sen$ it to the $ac
'77 YD,' incre#ent the sine tale a$$ress which
is in the accu#ulator
8' +44%,*'D; reeat the loo until all BQ2 values has een sent
8 -% reeat the aove
ote:
ZZZZ
D. 7ownloa$ the rogra# sin.asc in the rog. #e#ory a$$ress @h2. 7ownloa$ the sine tale values which is in the file $atsine.asc in the
rogra# #e#ory a$$ress 2@@h using % 2@@h co##an$ in the <T'+V.e"e
B. -"ecute the rogra# using G4 @ co##an$.
/47 @BDJ
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 74/108
./47 @BQBe
./47 @BJBJ
./47 @B2fa
./47 @B@D
./47 @2$f
./47 @2Ba
./47 @2OJ2
./47 @2J>>./47 @22D>
./47 @DecJ
./47 @DJa
./47 @DQ$J
./47 @D>Ba
./47 @D@O$
./47 @c$@
./47 @@O
./47 @JBQ
./47 @DMD
./47 @f$O./47 @fQ
./47 @fJeO
./47 @f22B
./47 @eeMa
./47 @eacD
./47 @eQ2c
./47 @eBae
./47 @e@>a
./47 @$$@>
./47 @$$$
./47 @$M$a./47 @$Bfc
./47 @$D>Q
./47 @cee
./47 @ccMD
./47 @caB>
./47 @cOB
./47 @cMQD
./47 @c>$e
./47 @cBO2
./47 @c2J$
./47 @cDQD
./47 @c@f
./47 @c@>Q
./47 @c@@
./47 @c@@Q
./47 @c@>@
./47 @c@B
./47 @cDMD
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 75/108
./47 @c2>O
./47 @cBMO
./47 @c>c@
./47 @cM>f
./47 @cODB
./47 @ca@a
./47 @ccBB
./47 @ceOc./47 @$DD2
./47 @$Bc>
./47 @$Me
./47 @$e
./47 @$cc2
./47 @e@@M
./47 @eBMO
./47 @eMe>
./47 @eaQO
./47 @eeDf
./47 @fD$M./47 @fJ
./47 @fM
./47 @f$B$
./47 @DDB
./47 @>e
./47 @Oa
./47 @cOB
./47 @D@>D
./47 @DBf@
./47 @DQOc
./47 @DDB./47 @DeO@
./47 @2D$2
./47 @2J@J
./47 @2ODJ
./47 @2@@
./47 @2$c>
./47 @B@Je
./47 @B2c
./47 @BJ@
./47 @BQDM
./47 @BOfD
./47 @BaQ
./47 @Bc@Q
./47 @B$>@
./47 @Be>D
./47 @Bf@O
./47 @BfJ
./47 @BfeQ
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 76/108
./47 @Bfff
./47 @Bf$c
./47 @BfQ$
./47 @BeeJ
./47 @BeD2
./47 @B$@M
./47 @Bc2
./47 @Ba>Q./47 @BOM
./47 @BMD
./47 @B>a
./47 @B2J2
./47 @2f$c
./47 @2$B
./47 @2aM$
./47 @2QQa
./47 @2>MB
./47 @2D2a
./47 @D$$B./47 @DaM@
./47 @DM$>
./47 @DBB>
./47 @fO2
./47 @c2
./47 @QfQ
./47 @>2>
./47 @>e
./47 @fcQO
./47 @fOaJ
./47 @f>$O./47 @fDDM
./47 @e$M2
./47 @ee
./47 @eM2f
./47 @e2O
./47 @$fJc
./47 @$cDe
./47 @$@D
./47 @$M@O
./47 @$BBM
./47 @$@O$
./47 @ce@f
./47 @cc@
./47 @caD
./47 @cQ>
./47 @cJf
./47 @c>QQ
./47 @cB2a
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 77/108
./47 @c2DJ
./47 @cDB
./47 @c@Q
./47 @c@B@
./47 @c@@B
./47 @c@DD
./47 @c@Ja
./47 @c@$e./47 @cDc
./47 @c2B
./47 @cBcB
./47 @cJ2a
./47 @cMcO
./47 @cO
./47 @caa@
./47 @cc$Q
./47 @cfBc
./47 @$Dcf
./47 @$>Oc./47 @$QQ2
./47 @$aQc
./47 @$$a
./47 @e@fM
./47 @e>M@
./47 @eQeB
./47 @eQc
./47 @ef2O
./47 @f2eB
./47 @fMa
./47 @faQ./47 @feJD
./47 @22M
./47 @Jf
./47 @c
./47 @$D
./47 @DD>
./47 @D>fJ
./47 @DOO
./47 @Dc@
./47 @DfQ2
./47 @22
./47 @2Je>
./47 @2Oea
./47 @2c
./47 @2eOB
./47 @BDD@
./47 @BBQD
./47 @BJaD
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 78/108
./47 @BQaD
./47 @BM$
./47 @B@>
./47 @BcMJ
./47 @B$Oe
./47 @BeQe
./47 @BfBJ
./47 @Bf2./47 @Bff>
./47 @Bff
./47 @BfcQ
./47 @BfJO
./47 @Beaf
./47 @B$c$
./47 @BcD
./47 @BJ$
./47 @B$B
./47 @BODB
./47 @BM2@./47 @BBf
./47 @BDaM
./47 @2f2B
./47 @2cQJ
./47 @2e
./47 @2Ma@
./47 @2BQf
./47 @2@B$
./47 @Dc$e
./47 @DM>
./47 @DJ$2./47 @D22c
./47 @eQM
./47 @a2
./47 @MeJ
./47 @BDD
./47 @ffB
./47 @fMJ
./47 @fQ>
./47 @fBca
./47 @f@@
./47 @ecJ
./47 @eO$
./47 @eJB>
./47 @eDc>
./47 @$eQ@
./47 @$B
./47 @$O2O
./47 @$JBa
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 79/108
./47 @$2QB
./47 @cf$M
./47 @c$MJ
./47 @c2B
./47 @cD2
./47 @cQBB
./47 @cJOO
./47 @c>D>./47 @c2$Q
./47 @cD$2
./47 @cD@M
./47 @c@Q>
./47 @c@D$
./47 @c@@D
./47 @c@Df
./47 @c@Q
./47 @cD@$
./47 @cD$
./47 @c2eB./47 @c>22
./47 @cJ
./47 @cQ>M
./47 @c2M
./47 @cBa
./47 @c$Qe
./47 @cffD
./47 @$2Of
./47 @$JJO
./47 @$O>O
./47 @$J$./47 @$eB
./47 @eDeO
./47 @eJJ
./47 @eOeB
./47 @ecOD
./47 @f@B2
./47 @fBfD
./47 @fQc
./47 @fOe
./47 @ffM>
./47 @BBa
./47 @Q@$
./47 @a$
./47 @ee
./47 @D2JB
./47 @DJfO
./47 @DO
./47 @D$@2
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 80/108
./47 @2@M@
./47 @2BaD
./47 @2McD
./47 @2c
./47 @2c2
./47 @2fBe
./47 @BDf
./47 @B>DB./47 @BMBM
./47 @BO2Q
./47 @Be>
./47 @BMc
./47 @Bce
./47 @B$$Q
./47 @BeO
./47 @BfJe
./47 @Bfca
./47 @Bffc
./47 @Bff2./47 @Bfae
./47 @Bf2f
./47 @BeQM
./47 @B$OB
./47 @BcJQ
./47 @Baf>
./47 @BJ
./47 @BQOc
./47 @BJO
./47 @BBJO
./47 @B@fM./47 @2eMQ
./47 @2a$
./47 @2Oc
./47 @2JcB
./47 @22
./47 @Df>e
./47 @DeQ
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 81/108
/ S"UARE WA$E GENERATION
/
7'T' .&-T @ .##regs .te"t
&T'T:
&T6 YD>@,&T@ initialiFe the $ata age ointer
&8< 3%+ #a!e the rocessor to wor! using 7% 4%
4%
4% 4%
-%:
&T Y@,7'T' sen$ @h to the $ac 3'++ 7-+'9 $elay for so#e ti#e
&T Y@555,7'T' sen$ @fffh to the $ac
3'++ 7-+'9 $elay for so#e ti#e
8 -% reeat the sa#e7-+'9:
&T6 Y@555,'D
7-+D: %4T/ 7'T',@>
8' 7-+D,*'D;
-T
TRIANGULAR WA$E GENERATION
/
7'T' .&-T @
.##regs
.te"t&T'T:
&T6 YD>@,&T@ initialiFe the $ata age ointer
&8< 3%+ #a!e the rocessor to wor! using 7% 4%
4%
4%
4%-%:
&T Y@,7'T' initialiFe the value as @h
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 82/108
3:
+7 7'T',' incre#ent the value
'77 YD,' &T+ ',7'T'
%4T/ 7'T',@> sen$ the value to the $ac
36%6 7'T',Y@555 reeat the loo until the value eco#es @fffh 83 3,T3
7-3: +7 7'T',' $ecre#ent the value &8 YD,'
&T+ ',7'T'
%4T/ 7'T',@> sen$ the value to the $ac
36%6 7'T',Y@ 83 7-3,T3 reeat the loo until the value eco#es @h
8 -% reeat the aove
/ SAWTOOTH WA$E GENERATION
/
7'T' .&-T @
.##regs
.te"t&T'T:
&T6 YD>@,&T@ initialiFe the $ata age ointer
&8< 3%+ #a!e the rocessor to wor! using 7%
4% 4%
4% 4%
-%:
&T Y@,7'T' initialiFe the value as @h
3: +7 7'T','
'77 YD,' incre#ent the value
&T+ ',7'T'%4T/ 7'T',@> sen$ the value to the $ac
36%6 7'T',Y@555 reeat the loo until the value eco#es @fffh
83 3,T3 8 -% reeat the aove
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 83/108
CON$OLUTION FOR FOUR INPUTS
/
.##regs
.te"t
&T'T:&T6 Y>@,&T@&8< 3%+
&8< 53T
4%
4% 4%
4%
&T6 Y@'@@@,'@ '@ for <(n)&T6 Y@@D@@,'D 'D for (n)
&T6 Y@'@2@,'2 '2 for te#orary location
te#orary storage locations are initially Fero+7 Y@,'
%T Y>
&T+ ',*'2L
&T6 Y@'@@>,'@ a$$ing of Feros after "(n)+7 Y@,'
%T YJ
&T+ ',*'@L&T6 Y@'@@@,'@
&T6 Y@'@2@,'2
&T6 Y@'@B@,'B location for storing outut 9(n)
&T6 YM,83 counter for nu#er of 9(n)%T8 340 start of the rogra#
+7 *'@L,'&T6 Y@'@2@,'2
&T+ ',*'2
&T6 Y@'@2B,'2
+7 Y@,'
%T YB
6'37 *'2;,@D@@,'340&T+ ',*'BL
+T: 8 +T
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 84/108
****************************************************************************%T: <(n) 7'T' 6-649
@'@@@ @@@D
@'@@D @@@B @'@@2 @@@D @'@@B @@@B
%T: (n) %4G'6 6-649
@@D@@ @@@@ h(n)
@@D@D @@@D
@@D@2 @@@2 @@D@B @@@D
4T%T 9(n) 7'T' 6-649 @'@B@ @@@D
@'@BD @@@J
@'@B2 @@@O
@'@B> @@@O @'@BJ @@@Q
@'@BM @@@B
****************************************************************************
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 85/108
IMPLEMENTATION OF FIR FILTERS
/
/ LOW-PASS FILTER
/
5ilter tye : 5;+%5
/in$ow tye : ectangular win$ow
&a#ling frequency : >D!hF
3ut;off frequency : >!hFo. of tas : J2
.##regs .te"t
&T'T:
&T6 Y@Dh,&T@ &8< 3%+
&8< 53T
4%
4% &T6 YDJ@,'D
+7 Y@,'
%T YB> &T+ ',*'DL
+44%:
%4T @M,@
3VR8&9: %4T @Q,@
8T5 @,Y2@ 83 3VR8&9,T3
%4T @>,@
+7 @,'
'7 Y@555,' <4 Y@O@@,'
&8 YO@@,'
&T6 YDJ@,'D &T+ ',*'D
&T6 YDOB,'2
+7 Y@,' %T YBB
6'37 *'2;,T'8+-,'
&T ',D,@
+7 @,' '77 YO@@,'
&T+ ',D
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 86/108
%4T/ D,@>
8 +44%
fs = >D!hF fc = >!hF = J2T'8+-:
.wor$ @D5
.wor$ @D@- .wor$ @D'8
.wor$ @D8> .wor$ @DDQ .wor$ @
.wor$ @5-37
.wor$ @57--
.wor$ @5732 .wor$ @5-M-
.wor$ @5537
.wor$ @DM5 .wor$ @23@
.wor$ @BBB
.wor$ @2Q> .wor$ @Q
.wor$ @5-D
.wor$ @5838
.wor$ @5'8 .wor$ @58JB
.wor$ @5-J@
.wor$ @BM2 .wor$ @3J
.wor$ @D@>O
.wor$ @DJ
.wor$ @DOJ .wor$ @DOJ
.wor$ @DJ .wor$ @D@>O
.wor$ @3J
.wor$ @BM2
.wor$ @5-J@ .wor$ @58JB
.wor$ @5'8
.wor$ @5838 .wor$ @5-D
.wor$ @Q
.wor$ @2Q> .wor$ @BBB
.wor$ @23@
.wor$ @DM5
.wor$ @5537 .wor$ @5-M-
.wor$ @5732
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 87/108
.wor$ @57--
.wor$ @5-37
.wor$ @ .wor$ @DDQ
.wor$ @D8>
.wor$ @D'8 .wor$ @D@-
.wor$ @D5
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 88/108
/
/ HIGH PASS FIR FILTER
/
&a#ling freq : >B!hF3ut;off freq : 2!hF
: J25ilter tye : igh ass filter /in$ow tye : ectangular
%rogra# 7escrition:
D. 6a!e all the "(n) Fero initially2. ea$ the $ata fro# the a$c.
B. &tore the a$c $ata in "(@)
>. 6a!e the ointer to oint the "(nRen$)J. %erfor# the convolution of "(n) an$ the coefficients h(n) using
6'37 instruction.
M. &en$ the convolution outut to the $acQ. eeat fro# ste 2.
.##regs
.te"t&T'T:
&T6 Y@Dh,&T@ intialiFe the $ata age ointer
&8< 3%+ 6a!e the rocessor to wor! using 7% &8< 53T reset the fractional #o$e it
4%
4%
*****loo to #a!e all "(n) Fero initially***** &T6 YDJ@,'D initialiFe arD to oint to "(n)
+7 Y@,' #a!e acc Fero %T YB>
&T+ ',*'DL #a!e all "(n) Fero
*****to rea$ the a$c $ata an$ store it in "(@)*****
+44%: %4T @M,@ start of conversion
3VR8&9:
%4T @Q,@ chec! for usy 8T5 @,Y2@
83 3VR8&9,T3
%4T @>,@ rea$ the a$c $ata +7 @,'
'7 Y@555,' '7 a$c $ata with @fffh for D2 it a$c
<4 Y@O@@,' recorrect the 2?s co#le#ent a$c $ata
&8 YO@@,' re#ove the $c shift &T6 YDJ@,'D initialiFe arD with "(@)
&T+ ',*'D store a$c $ata in "(@)
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 89/108
&T6 YDOB,'2 initialiFe ar2 with "(nRen$)
*****start of convolution*****
+7 Y@,' su# is @ initially %T YBB
6'37 *'2;,T'8+-,' convolution rocess
&T ',D,@ +7 @,'
'77 YO@@,' a$$ the $c shift to the convolution outut &T+ ',D %4T/ D,@> sen$ the outut to the $ac
8 +44%
T'8+-:.wor$ @53-5
.wor$ M2
.wor$ @57J@ .wor$ D>'
.wor$ @5-D8
.wor$ 2O5 .wor$ @55DD
.wor$ B-J
.wor$ @557D
.wor$ >-3 .wor$ @555J
.wor$ J>5
.wor$ @552O .wor$ >7'
.wor$ @57BO
.wor$ BO
.wor$ @5'2- .wor$ D77
.wor$ @5M2Q .wor$ JJ
.wor$ @5DBD
.wor$ >8
.wor$ @-'M7 .wor$ JMO
.wor$ @7J@
.wor$ >J- .wor$ >J-
.wor$ @7J@
.wor$ JMO .wor$ @-'M7
.wor$ >8
.wor$ @5DBD
.wor$ JJ .wor$ @5M2Q
.wor$ D77
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 90/108
.wor$ @5'2-
.wor$ BO
.wor$ @57BO .wor$ >7'
.wor$ @552O
.wor$ J>5 .wor$ @555J
.wor$ >-3 .wor$ @557D .wor$ B-J
.wor$ @55DD
.wor$ 2O5
.wor$ @5-D8 .wor$ D>'
.wor$ @57J@
.wor$ M2 .wor$ @53-5
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 91/108
/
/ BAND PASS FIR FILTER
/
&a#ling freq : >B!hF
3ut;off freqD : 2!hF3ut;off freq2 : >!hF
: J25ilter tye : 8an$ ass filter /in$ow tye : ectangular
%rogra# 7escrition:
D. 6a!e all the "(n) Fero initially2. ea$ the $ata fro# the a$c.
B. &tore the a$c $ata in "(@)
>. 6a!e the ointer to oint the "(nRen$)J. %erfor# the convolution of "(n) an$ the coefficients h(n) using
6'37 instruction.
M. &en$ the convolution outut to the $acQ. eeat fro# ste 2.
.##regs
.te"t&T'T:
&T6 Y@Dh,&T@ intialiFe the $ata age ointer
&8< 3%+ 6a!e the rocessor to wor! using 7% &8< 53T reset the fractional #o$e it
4%
4%
*****loo to #a!e all "(n) Fero initially***** &T6 YDJ@,'D initialiFe arD to oint to "(n)
+7 Y@,' #a!e acc Fero %T YB>
&T+ ',*'DL #a!e all "(n) Fero
*****to rea$ the a$c $ata an$ store it in "(@)*****
+44%: %4T @M,@ start of conversion
3VR8&9:
%4T @Q,@ chec! for usy 8T5 @,Y2@
83 3VR8&9,T3
%4T @>,@ rea$ the a$c $ata +7 @,'
'7 Y@555,' '7 a$c $ata with @fffh for D2 it a$c
<4 Y@O@@,' recorrect the 2?s co#le#ent a$c $ata
&8 YO@@,' re#ove the $c shift &T6 YDJ@,'D initialiFe arD with "(@)
&T+ ',*'D store a$c $ata in "(@)
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 92/108
&T6 YDOB,'2 initialiFe ar2 with "(nRen$)
*****start of convolution*****
+7 Y@,' su# is @ initially %T YBB
6'37 *'2;,T'8+-,' convolution rocess
&T ',D,@ +7 @,'
'77 YO@@,' a$$ the $c shift to the convolution outut &T+ ',D %4T/ D,@> sen$ the outut to the $ac
8 +44%
T'8+-: .wor$ 2@O
.wor$ 2JQ
.wor$ 2DO .wor$ D>B
.wor$ @
.wor$ @5-- .wor$ @57Q'
.wor$ @53-Q
.wor$ @57@O
.wor$ @577D .wor$ @5--3
.wor$ @55->
.wor$ B7 .wor$ @55'D
.wor$ @5753
.wor$ @58O5
.wor$ @5O-3 .wor$ @5M7>
.wor$ @5M@O .wor$ @5QDB
.wor$ @5'2D
.wor$ @5--M
.wor$ >'Q .wor$ @'M@
.wor$ @-5O
.wor$ DDOQ .wor$ DDOQ
.wor$ @-5O
.wor$ @'M@ .wor$ >'Q
.wor$ @5--M
.wor$ @5'2D
.wor$ @5QDB .wor$ @5M@O
.wor$ @5M7>
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 93/108
.wor$ @5O-3
.wor$ @58O5
.wor$ @5753 .wor$ @55'D
.wor$ B7
.wor$ @55-> .wor$ @5--3
.wor$ @577D .wor$ @57@O .wor$ @53-Q
.wor$ @57Q'
.wor$ @5--
.wor$ @ .wor$ D>B
.wor$ 2DO
.wor$ 2JQ .wor$ 2@O
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 94/108
IMPLEMENTATION OF IIR FILTERS
5ilter tye : L+ 3** 57
5ilter or$er : 25ilter $esign tye : 8utterworth
%ass an$ attenuation : B$5irst corner freq : @.2&econ$ corner freq : @.2>
&a#ling freq : J@VhF
3ut;off freq : D@VhF
546 %37&% 34-553-T&
< .&-T @
<6D .&-T D
<62 .&-T 29 .&-T B
96D .&-T >
962 .&-T J
<D .&-T M<D6D .&-T Q
<D62 .&-T O
9D .&-T 9D6D .&-T @'
9D62 .&-T @8
T-6% .&-T @3
'D@ .&-T @D@@'DD .&-T @55'2
'D2 .&-T @@B28D@ .&-T @D@@
8DD .&-T @2@@
8D2 .&-T @D@@
.##regs .te"t
&T'T:
&T6 Y>@,%6&T &8< 3%+
&T6 Y@D,&T@
&8< 53T 4%
4%
4%
initialiFe "n,"(n;D),"(n;2),yn,y(n;D),y(n;2) &T Y@,<
&T Y@,<6D
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 95/108
&T Y@,<62
&T Y@,9
&T Y@,96D &T Y@,962
&T Y@,<D
&T Y@,<D6D &T Y@,<D62
&T Y@,9D &T Y@,9D6D &T Y@,9D62
-%-'T:
to rea$ $ata fro# '73
%4T @M,2@ start of conversion3VR8&9: chec! status
%4T @Q,2@
8T5 2@,Y2@ 83 3VR8&9,T3
%4T @>,2@ rea$ '73 $ata
+7 2@,' '7 Y@555,'
<4 Y@O@@,' to correct 2?s co#le#ent
&8 YO@@,'
&T+ ',< "n &T+ ',T-6%
+7 Y@,8 su# = 8 = @ +7 Y8D@,' @ = T
&T+6 ',T
6%9 <,' @*"n = '
&5T+ ',;O '77 ',8 @*"n =8
+7 Y8DD,' @ = T
&T+6 ',T
6%9 <6D,' @*"n = '
&5T+ ',;O '77 ',8 @*"n =8
+7 Y8D2,' @ = T&T+6 ',T
6%9 <62,' @*"n = '
&5T+ ',;O '77 ',8 @*"n =8
+7 Y'DD,' @ = T
&T+6 ',T 6%9 96D,' @*"n = '
&5T+ ',;O
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 96/108
&8 ',8 @*"n =8
+7 Y'D2,' @ = T&T+6 ',T
6%9 962,' @*"n = '
&5T+ ',;O &8 ',8 @*"n =8
&T+ 8,9 &T+ 8,<D
+7 96D,'
&T+ ',962
+7 9,' &T+ ',96D
+7 <6D,'
&T+ ',<62 +7 <,'
&T+ ',<6D
+7 9,'
'77 YO@@,'
&T+ ',9
%4T/ 9,@> 8 -%-'T
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 97/108
5ilter tye : H89 3** 57
5ilter or$er : 25ilter $esign tye : 8utterworth
%ass an$ attenuation : B$
5irst corner freq : @.2&econ$ corner freq : @.2>
&a#ling freq : J@VhF3ut;off freq : D@VhF
546 %37&% 34-553-T&
< .&-T @<6D .&-T D
<62 .&-T 2
9 .&-T B96D .&-T >
962 .&-T J
<D .&-T M<D6D .&-T Q
<D62 .&-T O
9D .&-T
9D6D .&-T @'9D62 .&-T @8
T-6% .&-T @3
'D@ .&-T @D@@'DD .&-T @55-7
'D2 .&-T @@23
8D@ .&-T @D@@
8DD .&-T @5-@@8D2 .&-T @D@@
.##regs .te"t
&T'T:
&T6 Y>@,%6&T
&8< 3%+ &T6 Y@D,&T@
&8< 53T
4% 4%
4%
initialiFe "n,"(n;D),"(n;2),yn,y(n;D),y(n;2) &T Y@,<
&T Y@,<6D
&T Y@,<62
&T Y@,9 &T Y@,96D
&T Y@,962
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 98/108
&T Y@,<D
&T Y@,<D6D
&T Y@,<D62 &T Y@,9D
&T Y@,9D6D
&T Y@,9D62-%-'T:
to rea$ $ata fro# '73 %4T @M,2@ start of conversion3VR8&9: chec! status
%4T @Q,2@
8T5 2@,Y2@
83 3VR8&9,T3 %4T @>,2@ rea$ '73 $ata
+7 2@,'
'7 Y@555,' <4 Y@O@@,' to correct 2?s co#le#ent
&8 YO@@,'
&T+ ',< "n &T+ ',T-6%
+7 Y@,8 su# = 8 = @
+7 Y8D@,' @ = T&T+6 ',T
6%9 <,' @*"n = '
&5T+ ',;O '77 ',8 @*"n =8
+7 Y8DD,' @ = T
&T+6 ',T 6%9 <6D,' @*"n = '
&5T+ ',;O '77 ',8 @*"n =8
+7 Y8D2,' @ = T
&T+6 ',T 6%9 <62,' @*"n = '
&5T+ ',;O
'77 ',8 @*"n =8
+7 Y'DD,' @ = T
&T+6 ',T 6%9 96D,' @*"n = '
&5T+ ',;O
&8 ',8 @*"n =8
+7 Y'D2,' @ = T
&T+6 ',T
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 99/108
6%9 962,' @*"n = '
&5T+ ',;O
&8 ',8 @*"n =8 &T+ 8,9
&T+ 8,<D
+7 96D,'
&T+ ',962 +7 9,' &T+ ',96D
+7 <6D,'
&T+ ',<62
+7 <,' &T+ ',<6D
+7 9,' '77 YO@@,'
&T+ ',9
%4T/ 9,@> 8 -%-'T
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 100/108
5ilter tye : B3:; 3** 57
5ilter or$er : 25ilter $esign tye : 3heyshev;
%ass an$ attenuation : B$
-$ge frequencies:fD : @.D
f2 : @.D2JfB : @.DJf> : @.DQJ
&a#ling freq : J@VhF
3ut;off freqD : JVhF
3ut;off freq2 : Q.JVhF
546 %37&% 34-553-T&
< .&-T @
<6D .&-T D
<62 .&-T 29 .&-T B
96D .&-T >
962 .&-T J
<D .&-T M<D6D .&-T Q
<D62 .&-T O
9D .&-T 9D6D .&-T @'
9D62 .&-T @8
T-6% .&-T @3
'D@ .&-T @D@@'DD .&-T @5-38
'D2 .&-T @@7'8D@ .&-T @D@@
8DD .&-T @@@@
8D2 .&-T @55@@
.##regs .te"t
&T'T:
&T6 Y>@,%6&T &8< 3%+
&T6 Y@D,&T@
&8< 53T 4%
4%
4%
initialiFe "n,"(n;D),"(n;2),yn,y(n;D),y(n;2) &T Y@,<
&T Y@,<6D
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 101/108
&T Y@,<62
&T Y@,9
&T Y@,96D &T Y@,962
&T Y@,<D
&T Y@,<D6D &T Y@,<D62
&T Y@,9D &T Y@,9D6D &T Y@,9D62
-%-'T:
to rea$ $ata fro# '73
%4T @M,2@ start of conversion3VR8&9: chec! status
%4T @Q,2@
8T5 2@,Y2@ 83 3VR8&9,T3
%4T @>,2@ rea$ '73 $ata
+7 2@,' '7 Y@555,'
<4 Y@O@@,' to correct 2?s co#le#ent
&8 YO@@,'
&T+ ',< "n &T+ ',T-6%
+7 Y@,8 su# = 8 = @ +7 Y8D@,' @ = T
&T+6 ',T
6%9 <,' @*"n = '
&5T+ ',;O '77 ',8 @*"n =8
+7 Y8DD,' @ = T
&T+6 ',T
6%9 <6D,' @*"n = '
&5T+ ',;O '77 ',8 @*"n =8
+7 Y8D2,' @ = T&T+6 ',T
6%9 <62,' @*"n = '
&5T+ ',;O '77 ',8 @*"n =8
+7 Y'DD,' @ = T
&T+6 ',T 6%9 96D,' @*"n = '
&5T+ ',;O
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 102/108
&8 ',8 @*"n =8
+7 Y'D2,' @ = T&T+6 ',T
6%9 962,' @*"n = '
&5T+ ',;O &8 ',8 @*"n =8
&T+ 8,9 &T+ 8,<D
+7 96D,'
&T+ ',962
+7 9,' &T+ ',96D
+7 <6D,'
&T+ ',<62 +7 <,'
&T+ ',<6D
+7 9,'
'77 YO@@,'
&T+ ',9
%4T/ 9,@> 8 -%-'T
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 103/108
/ <-POINT FFT
/
%T .&-T @'2@@
-0 .&-T @'B@@3 .&-T @'>@@
T/73 .&-T @'J@@T/7& .&-T @'JJ@859 .&-T @
8593 .&-T D
7& .&-T 2
7&3 .&-T BG% .&-T >
G%3 .&-T J
&TG .&-T M&TG3 .&-T Q
V .&-T O
3T5 .&-T '< .&-T @'
8< .&-T @8
3< .&-T @3
7< .&-T @7'3687 .&-T @-
'7%83 .&-T @5
'D@ .&-T D@'DD .&-T DD
'D2 .&-T D2
'DB .&-T DB
'D> .&-T D>'T-6% .&-T DJ
8T-6% .&-T DM8B .&-T @5@@@ 82 .&-T @5@@ 8D .&-T
@@5@ 8@ .&-T @@@5 7'T' .&-T B@ T<7 .&-T
BD
.##regs .te"t
&T'T:
&T6 Y>@,%6&T &8< 3%+
&T6 YD>@,&T@
&8< 53T 4%
4%
4%
4% 3'++ 8TR-0
3'++ 3+7-
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 104/108
&T YD,859
&T Y>,G%
&T Y2,7& &T YB,&TG
+7 &TG,'
&8 YD,' &T+ ',&TG3
&T6 YT/73,'@ %T YB
60%7 T'834&,*'@L
&T6 YT/7&,'@ %T YB
60%7 T'8&,*'@L
&T6 Y2,'J 'J = &T'G- +44%&TG+4%:
&T Y@,V
+7 859,' &8 YD,'
&T+ ',8593
+7 G%,'
&8 YD,' &T+ ',G%3
+7 7&,'
&T+6 ','@ &8 YD,'
&T+ ',7&3
+7 7&3,'
+7 G%,' 36%6 G%,Y> A2=OA2=>
83 4R3G,T3 +7 Y@,'
4R3G:
&T+ ',3T5
+7 G%3,' &T+6 ','B 'B = G4% +44%
&T6 Y3,'D
G%+4%: &T Y@,V ! is initially @ in all grous
+7 8593,'
&T+6 ','> '> = 85+9 +44%859+4%:
+7 *'DL@,'
3'++ 6+
+7 7&,' &T+6 ','@
+7 *'D;@,'
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 105/108
3'++ '77&8
+7 V,'
'77 3T5,' &T+ ',V
8' 859+4%,*'>;
+7 7&,' &T+6 ','@
+7 *'DL@,' 8' G%+4%,*'B; 6%9 859,Y2,' 859 * 2 = 859
&T+ ',859
6%9 7&,Y2,' 7& * 2 = 7&
&T+ ',7& &T+6 ','@
+7 G%,'
&T+ ',;D,G% G% A 2 = G% 8' &TG+4%,*'J;
hlt: 8 hlt
6+: &T6 YT/73,'2
+7 V,'
&T+6 ','@
4% 4%
+7 *'2L@,'
+7 *'2,' &T+ ',3<
&T6 YT/7&,'2
+7 V,'
&T+6 ','@ +7 *'2L@,'
+7 *'2,' &T+ ',7<
+7 *'DL,'
&T+ ','<
+7 *'D;,' &T+ ',8<
+7 '<,'
&T+6 ',T 6%9 3<,' '*3
+7 8<,8
&T+6 8,T 6%9 7<,8 8*7
&8 8,' '3;87 ;C '
&T+ ',;O,'3687
+7 '<,' &T+6 ',T
6%9 7<,' '*7
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 106/108
+7 8<,8
&T+6 8,T
6%9 3<,8 8*3 '77 ',8 '7L83 ;C 8
&T+ 8,;O,'7%83
+7 '3687,' &T+ ',*'DL
+7 '7%83,' &T+ ',*'D; +7 7&,'
&T+6 ','@
-T
'77&8:
+7 *'DL@,'
&T+ ','T-6% +7 *'D;@,8
&T+ 8,8T-6%
'77 ',8 &T+ 8,*'D
+7 'T-6%,'
&8 8T-6%,'
+7 *'DL@,8 &T+ ',*'D;@
+7 *'DL,'
+7 *'DL@,' &T+ ','T-6%
+7 *'D;@,8
&T+ 8,8T-6%
'77 ',8 &T+ 8,*'D
+7 'T-6%,' &8 8T-6%,'
+7 *'DL@,8
&T+ ',*'D;@
+7 *'D;,' +7 *L'D(2),'
+76 'D,'
&T+ ','D@ -T
8TR-0:
&T6 Y%T,'> &T6 Y-0,'J
&T6 Y>,'@ A2
&T6 YQ,83 ;D
%T8 -%-0 +7 *'>L@8,'
-%-0: &T+ ',*'JL
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 107/108
-T
3+7-:
&T6 Y-0,'D &T6 Y3,'2
&T6 YQ,83
%T8 -%3 +7 *'DL,'
&T+ ',*'2L +7 Y@,'-%3: &T+ ',*'2L
-T
T'834&: .wor$ @@D@@
.wor$ @@@8J
.wor$ @@@@@ .wor$ @55>8
T'8&:
.wor$ @@@@@ .wor$ @55>8
.wor$ @55@@
.wor$ @55>8
***************************************************************************
%T: 7'T' 6-649
@'2@@ @Q@@
@'2@D @8@@ @'2@2 @5@@
@'2@B @8@@ @'2@> @Q@@
@'2@J @B@@
@'2@M @@@@
@'2@Q @B@@
4T%T: 7'T' 6-649
@'>@@ B@@ @'>@D @@@@
@'>@2 @@@@
@'>@B -J8@ @'>@> 55@@
@'>@J @@@@
@'>@M @@@@
@'>@Q @B8@ @'>@O @D@@
@'>@ @@@@
8/13/2019 DSP LM15_0611
http://slidepdf.com/reader/full/dsp-lm150611 108/108
@'>@' @@@@
@'>@8 53J@
@'>@3 55@@ @'>@7 @@@@
@'>@- @@@@
@'>@5 D'J@***************************************************************************