You are on page 1of 2

EC302:DigitalSignalProcessing,201011

PreparedBy:Prof.M.C.Patel,
ElectronicsEngineeringDepartment,
S.V.NationalInstituteofTechnology,Surat.
Laboiatoiy u2
ueneiation of Biffeient
Bisciete time signal
(1)Implementthe(n)function,alsoimplementthefunction(nk)wherethekisuserdefined.
(2)Implementtheu(n)function.Alsoimplementthefunction(nk)wherethekisuserdefined.
Repeattheabovefunctionforfoldedsequences.
(3)Repeattheq2fortherampfunction.
(4)Thefunctionis(t) = 4 - c
]wn
,ifw=2*pi*500;n=1000sample.
Plotthefunctions.Plottherealpartoffunction.AlsoplottheImaginarypart,Magnitudeandphase
ofthefunction
(4)DesignthematlabprogramthataccepttheinputtemperatureindegreeFahrenheitfromthe
commandwindow(takehelpofinput),ConvertintoanabsolutetemperatureinKelvin,writesout
theresults(takehelponfprintf).
I(in kcl:in) = _
S
9
- I(in ) - S2] + 27S.1S

(5)Implementthefollowingexpressionandusingcommandplot.Displaytheentireresultingcurve
inthesamewindow.
X
1
(t) = S + 6 - cos(t),
1
(t) = -2 + 9 - sin(t),
X
2
(t) = 7 + 2 - cos(t - 4S),
1
(t) = 8 + 6 - sin(t + Su)

(6)ThemusicnoteSa,Re,Ga,Ma,Pa,Dha,Ni,Sacontainsthefrequency440Hz,
493.88Hz,554.37Hz,587.33Hz,659.26Hz,739.99Hzrespectively.Generatethesongifitcontainsthe
noteas[saregasaganiphdha].Plottheabovesignal.(Usewavplaytoplaysongonspeaker).
(7)Asequenceisgivenby
x(n) = (6 - n), or u n S,
writetheprogramtoplotthesequencesy|n] = x|4 - n].
(8)Writeaprogramtodeterminetoacceptamplitudeandphaseofsequencesgivenby
x|n] = A - cos (n -
n
S2
, + ),andplotthesameforonecompletecycle.
EC302:DigitalSignalProcessing,201011
PreparedBy:Prof.M.C.Patel,
ElectronicsEngineeringDepartment,
S.V.NationalInstituteofTechnology,Surat.
(9)Writetheprogramtodeterminetheaveragepowerofsequencegivenby
x|n] = cos [n -
n
4
- sin[n -
n
8
+ 2 - cos (n -
n
2
)
(10)Writeaprogramthatprovesthatthesquarewaveof100Hzcontainstheoddharmonicof100
Hzfrequency.Ifevenharmonicaretakenitissawtoothwaveof100Hz.

You might also like