Вы находитесь на странице: 1из 30

M.Tech I Sem Lab Manual EXPERIMENT NO.1 1.1.

To generate Various fundamental discrete time signals Aim: - To write a MATLAB program to generate various fundamental Signals. Software used: - MATLAB 7.5 Program:%% Clearing and closing commands clc clear all close all %% Plotting n"#5$%$5& '%"()eros*%+5, % ones*%+5,-& su.plot*/+0+%, stem*n+'%, 1la.el*2no of samples2,& 'la.el*2amplitude2,& title*2unit step se!uence2,& % program for impulse se!uence n"#5$%$5& '0"()eros*%+5, % )eros*%+5,-& su.plot*/+0+0, stem*n+'0, 1la.el*2no of samples2,& 'la.el*2amplitude2,& title*2impulse se!uence2, % program for ramp se!uence m"3$%$5& '4"m& su.plot*/+0+4, stem*m+'4, 1la.el*2no of samples2, 'la.el*2amplitude2, title*2ramp se!uence2, % program for e1ponentiall' increasing arious Signals % program for unit step se!uence

M.Tech I Sem Lab Manual t"3$%$5& a%".5& '/"e1p*a%5t,& su.plot*/+0+/, stem*t+'/, 1la.el*2no of samples2, 'la.el*2amplitude2, title*2e1ponential increasing se!uence2, % program for e1ponentiall' decreasing t"3$%$5& a0".0& '5"e1p*#a05t,& su.plot*/+0+5, stem*t+'5, 1la.el*2no of samples2, 'la.el*2amplitude2, title*2e1ponential decreasing se!uence2, % program for sine wave generation t"3$3.%$0& '6"sin*05pi5t,& su.plot*/+0+6, stem*t+'6, 1la.el*2no of samples2, 'la.el*2amplitude2, title*2sine wave2, % program for cosine wave generation t"3$3.%$0& '7"cos*05pi5t,& su.plot*/+0+7, stem*t+'7, 1la.el*2no of samples2, 'la.el*2amplitude2, title*2cosine wave2,

esult: - 7ence different .asic signals 8ave .een generated and plotted using MATLAB

M.Tech I Sem Lab Manual !ut"ut: -

M.Tech I Sem Lab Manual 1.#. $ASI% !P& ATI!'S !' SI('ALS )A**ITI!'+ M,LTIPLI%ATI!'+ -!L*I'(+ S%ALI'(. Aim: - To write a MATLAB program for various .asic operations on given se!uences. Software used: - MATLAB 7.5 Program: %% Clearing and closing commands clc clear all close all %% 9eclaring :nput se!uences 1"(%$%$;-& '"(;$#%$%-& %% Plotting t8e results of different operations % :nput se!uence % su.plot*4+0+%, stem*1, 1la.el*2no of samples2, 'la.el*2amplitude2, title*2input se!uence %2, % :nput se!uence 0 su.plot*4+0+0, stem*', 1la.el*2no of samples2, 'la.el*2amplitude2, title*2input se!uence 02, % Addition of se!uences m"1<'& su.plot*4+0+4, stem*m, 1la.el*2no of samples2, 'la.el*2amplitude2, title*2addition of signals2, % Multiplication of se!uences m"1.5'& su.plot*4+0+/, stem*m,

M.Tech I Sem Lab Manual 1la.el*2no of samples2, 'la.el*2amplitude2, title*2multipilcation of signals2, % =olding of se!uences su.plot*4+0+5, stem*#1+1, 1la.el*2no of samples2, 'la.el*2amplitude2, title*2folded se!uence2, % Amplitude scaling su.plot*4+0+6, stem*1+150, 1la.el*2no of samples2, 'la.el*2amplitude2, title*2amplitude Scaling2, esult: -7ence .asic operations signals 8ave .een generated and plotted using MATLAB !ut"ut: -

M.Tech I Sem Lab Manual 1./. T! -I'* !,T T0& *-T 1 I*-T !- A (IV&' S&2,&'%& Aim: - To write a MATLAB program to find out t8e 9=T > :9=T of a given se!uence. Software used: -MATLAB 7.5 Program: %% Clearing and closing commands clc clear all close all %% Program for 9=T ?";& 1"(% 0 4 / / 4 0 %-& for @"3$%$?#%& for n"3$%$?#%& p"e1p*#A505pi5n5@B?,& 10*@<%+n<%,"p& end& end& '"1510& disp*',& stem*1+',& 1la.el*2time period2, 'la.el*2amplitude2,& title*29=T of t8e se!uence2,& %% Program for :9=T ?";& 1"(% 0 4 / / 4 0 %-& for @"3$%$?#%& for n"3$%$?#%& p"e1p*A505pi5n5@B?,& 1%*@<%+n<%,"p& end& end& '"*151%,B?& disp*',&

M.Tech I Sem Lab Manual stem*1+',& 1la.el*2time period2,& 'la.el*2amplitude2,& title*2:9=T of t8e se!uence2,& %% Program for ==T using @e'word ?";& 1"(% 0 4 / / 4 0 %-& )"fft*1+?,& stem*1+),& 1la.el*2time period2,& 'la.el*2amplitude2,& title*29=T of t8e se!uence using @e'word2,& %% Program for :==T using @e'word ?";& 1"(% 0 4 / / 4 0 %-& )"ifft*1+?,& stem*1+),& 1la.el*2time period2,& 'la.el*2amplitude2,& title*2:9=T of t8e se!uence using @e'word2,& esult: - 7ence t8e 9=T > :9=T of t8e given se!uence 8as .een found and plotted using MATLAB

M.Tech I Sem Lab Manual !ut"uts: --T Columns % t8roug8 / 03.3333 #5.;0;/ # 0./%/0i 3.3333 # 3.3333i #3.%7%6 # 3./%/0i

Columns 5 t8roug8 ; 3 # 3.3333i #3.%7%6 < 3./%/0i #3.3333 # 3.3333i #5.;0;/ < 0./%/0i

M.Tech I Sem Lab Manual I--T Columns % t8roug8 / 0.5333 #3.70;6 < 3.43%;i 3.3333 < 3.3333i #3.30%/ < 3.35%;i

Columns 5 t8roug8 ; 3 < 3.3333i #3.30%/ # 3.35%;i #3.3333 < 3.3333i #3.70;6 # 3.43%;i

M.Tech I Sem Lab Manual EXPERIMENT NO.2 P !( AM T! V& I-3 I'T& P!LATI!' 1 *&%IMATI!' !- A (IV&' S&2,&'%& Aim: -To write a MATLAB program to verif' :?TCDPELAT:E? and 9CC:MAT:E? of a given se!uence. Software used: -MATLAB 7.5 Program: %% Clearing and Closing commands clc clear all close all %% Program for :nterpolation t"3$3.35$0& 1"cos*05pi5t,& '"interp*1+0,& t0"interp*t+0,& su.plot*0+%+%, stem*t+1, 1la.el*2?um.er of ?amples2,& 'la.el*2Amplitude2, title*2:nput Se!uence2, su.plot*0+%+0, stem*t0+', 1la.el*2?um.er of Samples2,& 'la.el*2Amplitude2, title*2:nterpolated Se!uence2, %% Program for 9ecimation t"3$3.35$0& 1"cos*05pi5t,& '"decimate*1+0,& t%"decimate*t+0,& su.plot*0+%+%, stem*t+1, 1la.el*2?um.er of Samples2,& 'la.el*2Amplitude2, title*2:nput Se!uence2, su.plot*0+%+0,

10

M.Tech I Sem Lab Manual stem*t%+', 1la.el*2?um.er of Samples2,& 'la.el*2Amplitude2, title*29ecimated Se!uence2, esult: - 7ence t8e :?TCDPELAT:E? and 9CC:MAT:E? of a given se!uence 8as .een verified using MATLAB

11

M.Tech I Sem Lab Manual !ut"uts: -

12

M.Tech I Sem Lab Manual EXPERIMENT NO.3 P !( AM T! %!'V& T %* *ATA T! *V* *ATA Aim: -To write a MATLAB program to convert C9 data to 9 9 data . Software used: -MATLAB 7.5 Program: %% Clearing and closing commands clc clear all close all %% Program ('+ =s+ n.its- " wavread*2t'pe.wav2,& disp*2T8e sampling fre!uenc' is$2,& =s disp*2?um.er of .its per sample$2,& n.its disp*2T8e lengt8 of t8e C9 data is$2,& lengt8*', %% p"interp*'+0,& =s%"=s50& disp*2T8e sampling fre!uenc' is$2,& =s% disp*2?um.er of .its per sample$2,& n.its disp*2T8e lengt8 of t8e 9 9 data is$2,& lengt8*p, wavpla'*'+=s,& pause*0,& wavpla'*p+=s%,& esult:-7ence t8e data sampled at C9 sampling rate is converted into 9 9 sampling rate 8as .een verified using MATLAB

13

M.Tech I Sem Lab Manual !ut"uts: T8e sampling fre!uenc' is$ =s " %%305 ?um.er of .its per sample$ n.its " ; T8e lengt8 of t8e C9 data is$ ans " //3F T8e sampling fre!uenc' is$ =s% " 00353 ?um.er of .its per sample$ n.its " ; T8e lengt8 of t8e 9 9 data is$ ans " ;;%;

14

M.Tech I Sem Lab Manual EXPERIMENT NO.4 (&'& ATI!' !- *TM- )*,AL T!'& M,LTIPL& - &2,&'%3. SI('ALS Aim: -To write a MATLAB program for generation of 9TM= signals. Software used: -MATLAB 7.5 Program: %% Clearing and closing commands clc clear all close all %% Program num.er"(2F%77;570632+2s2-& fs";%F0& T"3.5& 1"05pi5(6F7+773+;50+F/%-& '"05pi5(%03F+%446+%/77-& t"(3$%Bfs$T-2& t1"(sin*1*%,5t,+sin*1*0,5t,+sin*1*4,5t,+sin*1*/,5t,-B0& t'"(sin*'*%,5t,+sin*'*0,5t,+sin*'*4,5t,-B0& for @"%$lengt8*num.er, switc8 num.er*@, case2%2 tone"t1*$+%,<t'*$+%,& % sound*tone,& stem*tone,& 1la.el*2?o of Samples2,& 'la.el*2Amplitude2,& title*29ual Tone Multiple =re!uenc'2,& case202 tone"t1*$+%,<t'*$+0,& % sound*tone,& stem*tone,& 1la.el*2?o of Samples2,& 'la.el*2Amplitude2,&

15

M.Tech I Sem Lab Manual title*29ual Tone Multiple =re!uenc'2,& case242 tone"t1*$+%,<t'*$+4,& % sound*tone,& stem*tone,& 1la.el*2?o of Samples2,& 'la.el*2Amplitude2,& title*29ual Tone Multiple =re!uenc'2,& case2/2 tone"t1*$+0,<t'*$+%,& % sound*tone,& stem*tone,& 1la.el*2?o of Samples2,& 'la.el*2Amplitude2,& title*29ual Tone Multiple =re!uenc'2,& case252 tone"t1*$+0,<t'*$+0,& % sound*tone,& stem*tone,& 1la.el*2?o of Samples2,& 'la.el*2Amplitude2,& title*29ual Tone Multiple =re!uenc'2,& case262 tone"t1*$+0,<t'*$+4,& % sound*tone,& stem*tone,& 1la.el*2?o of Samples2,& 'la.el*2Amplitude2,& title*29ual Tone Multiple =re!uenc'2,& case272 tone"t1*$+4,<t'*$+%,&

16

M.Tech I Sem Lab Manual % sound*tone,& stem*tone,& 1la.el*2?o of Samples2,& 'la.el*2Amplitude2,& title*29ual Tone Multiple =re!uenc'2,& case2;2 tone"t1*$+4,<t'*$+0,& % sound*tone,& stem*tone,& 1la.el*2?o of Samples2,& 'la.el*2Amplitude2,& title*29ual Tone Multiple =re!uenc'2,& case2F2 tone"t1*$+4,<t'*$+4,& % sound*tone,& stem*tone,& 1la.el*2?o of Samples2,& 'la.el*2Amplitude2,& title*29ual Tone Multiple =re!uenc'2,& case252 tone"t1*$+/,<t'*$+%,& % sound*tone,& stem*tone,& 1la.el*2?o of Samples2,& 'la.el*2Amplitude2,& title*29ual Tone Multiple =re!uenc'2,& case232 tone"t1*$+/,<t'*$+0,& % sound*tone,& stem*tone,& 1la.el*2?o of Samples2,& 'la.el*2Amplitude2,&

17

M.Tech I Sem Lab Manual title*29ual Tone Multiple =re!uenc'2,& case2G2 tone"t1*$+/,<t'*$+4,& % sound*tone,& stem*tone,& 1la.el*2?o of Samples2,& 'la.el*2Amplitude2,& title*29ual Tone Multiple =re!uenc'2,& % % end& pause*3.75,& end& esult: -7ence t8e a.ove 9TM= signals 8as .een generated and plotted using MATLAB !ut"ut: ot8erwise disp*2invalid num.er2,&

18

M.Tech I Sem Lab Manual EXPERIMENT NO.5 &STIMAT& T0& PS* !- A '!IS3 SI('AL ,SI'( P& I!*!( AM A'* M!*I-I&* P& I!*!( AM Aim: -To write a MATLAB program to find out PS9 using PCD:E9EHDAM and ME9:=:C9 PCD:E9EHDAM. Software used: -MATLAB 7.5 Program: %% Clearing and closing commands clc clear all close all %% 9eclaring inputs f%"%333& f0"0333& fs"/333& %% Program for PCD:E9EHDAM t"3$%Bfs$%& 1"05sin*05pi5f%5t,<45sin*05pi5f05t,<rand*si)e*t,,& p11%"a.s*fft*1,.I0,& p110"a.s*fft*1corr*1,+lengt8*t,,,& su.plot*0+%+%, plot*t5fs+%35log%3*p11%,,& 1la.el*2=re!uenc' in 7ert)$2, 'la.el*2Power in d.$2, title*2PS9 using SJKADC MAH?:TK9C MCT7E92, su.plot*0+%+0, plot*t5fs+%35log%3*p110,,& 1la.el*2=re!uenc' in 7ert)$2, 'la.el*2Power in d.$2, title*2PS9 using AKTECEDDCLAT:E? MCT7E92, Program for M!*I-I&* P& I!*!( AM: ?"/& n"3$%Bfs$%& 1"sin*05pi5f%5n,<sin*05pi5f05n,<rand*si)e*n,,& '"a.s*fft*1,.I0,&

19

M.Tech I Sem Lab Manual su.plot*0+%+%, plot*n5fs+%35log%3*',, 1la.el*2=re!uenc' in 7ert)$2, 'la.el*2Magnitude in d.$2, title*2PS9 using SJKADC MAH?:TK9C MCT7E92,& w"8anning*?,& u"3& for i"%$?& u"u<*w*i,.I0,& end for i"%$?& '%"(a.s*fft*1,.I0,5w*i,.I0-B*u5?,& end su.plot*0+%+0, plot*n5fs+%35log%3*'%,, 1la.el*2=re!uenc' in 7ert)$2, 'la.el*2Magnitude in d.$2, title*2PS9 using 7A??:?H L:?9EL2,& esult: -7ence t8e estimation of PS9 using PCD:E9EHDAM and ME9:=:C9 PCD:E9EHDAM 8as .een verified using MATLAB

20

M.Tech I Sem Lab Manual !ut"uts: - Periodogram

Modified Periodogram

21

M.Tech I Sem Lab Manual EXPERIMENT NO.6 &STIMATI!' !- P!4& met8od. Software used: -MATLAB 7.5 Program: %% Clearing and Closing commands clc clear all close all %% 9eclaring :nputs fs"0333& f%"033& f0"/33& M"%0;& Program for $A TL&TT M&T0!*: t"3$%Bfs$%& 1"05sin*05pi5f%5t,<05sin*05pi5f05t,<rand*si)e*t,,& L"lengt8*1,& M"LBM& '%"(-& for i"%$M$L#M '0"a.s*fft*1*i$i<M,,.I0,& '%"('%&'0-& end '4"sum*'%,& w%"'4BM& w%0"%35log*w%,& fs%"*fsBM,<0& t%"**%$fs%,Bfs%,& plot*t%+w%0, 1la.el*2?ormali)ed =re!uenc'2, 'la.el*2PS92, title*2BADTLCTT MCT7E9 of Power Spectral Cstimation2,& SP&%T ,M ,SI'( $A TL&TT A'* 4&L%0 M&T0!*S Aim: -To write a MATLAB program to estimate power spectrum using BADTLCTT and LCLC7

22

M.Tech I Sem Lab Manual Program for 4&L%0 M&T0!*: t"3$%Bfs$%& 1"05sin*05pi5f%5t,<05sin*05pi5f05t,<rand*si)e*t,,& L"lengt8*1,& M"LBM& w"8ann*M<%,& m"3& su"(-& for i"%$MB0$L#M<% g"w2.51*i$M<i,& w0"a.s*fft*g,.I0,& su"(su&w0-& end su%"sum*su,& f"sum*w.I0,& w%"su%Bf& w%0"%35log*w%,& fs%"*fsBM,<0& t%"**%$fs%,Bfs%,& plot*t%+w%0, 1la.el*2?ormali)ed =re!uenc'2, 'la.el*2PS92, title*2LCLC7 MCT7E9 of Power Spectral Cstimation2,& esult: -7ence t8e estimation of PS9 using BADTLCTT and LCLC7 met8od 8as .een verified using MATLAB

23

M.Tech I Sem Lab Manual !ut"uts: - $artlett Method

4elch Method

24

M.Tech I Sem Lab Manual EXPERIMENT NO.7 &STIMATI!' !- P!4& BLACMMA?#TKMCN met8od. Software used: -MATLAB 7.5 Program: %% Clearing and Closing commands clc clear all close all fs"0333& f%"033& f0"/33& t"3$%Bfs$%& 1"sin*05pi5f%5t,<sin*05pi5f05t,<rand*si)e*t,,& L"lengt8*1,& '"1corr*1,& wi"8ann*lengt8*',,& o"wi2.5'& i"lengt8*',& ."a.s*fft*1corr*o,,,BL& i%"lengt8*.,& t%"*%$i%,Bi%& .%"%35log*.,& plot*t%+.%,& 1la.el*2?ormali)ed =fre!uenc'2,& 'la.el*2psd2,& title*2BLACMMA? TKMCN met8od of Power Cstimation2,& esult: -7ence t8e estimation of PS9 using BLACMMA?#TKMCN met8od 8as .een verified using MATLAB SP&%T ,M ,SI'( $LA%5MA'-T,5&3 M&T0!* Aim: -To write a MATLAB program to estimate power spectrum using Power Spectrum using

25

M.Tech I Sem Lab Manual Output: -

EXPERIMENT NO.8

26

M.Tech I Sem Lab Manual &STIMATI!' !- P!4& SP&%T ,M ,SI'( PA AM&T I% M&T0!*S 1 $, (. )3,L&-4AL5& NKLC#LALMCD and BKDH met8od. Software used: -MATLAB 7.5 Program: %% Clearing and Closing commands clc clear all close all Program for $, ( method: a"(% #0.0%47 0.F/3; #0.%6F7 3.F63F-& randn*2state2+%,& 1"filter*%+a+randn*056+%,,& p.urg*1+/,& 1la.el*2?ormali)ed =re!uenc'2,& 'la.el*2Power Sectrum in d.2,& title*2BKDH met8od of Power Spectrum Cstimation2,& Program for 3,L& 4AL5& randn*2state2+%,& 1"filter*%+a+randn*056+%,,& p'ulear*1+/,& 1la.el*2?ormali)ed =re!uenc'2,& 'la.el*2Power Spectrum in d.2,& title*2NKLC#LALMCD met8od of Power Spectrum Cstimation2,& esult: -7ence t8e estimation of PS9 using NKLC#LALMCD and BKDH met8od 8as .een verified using MATLAB method:

Aim:-To write a MATLAB program to estimate power spectrum using Power Spectrum using

a"(% #0.0%47 0.F/3; #0.%6F7 3.F63F-&

Output: - Burg Method

27

M.Tech I Sem Lab Manual

3ule 4al6er Method

EXPERIMENT NO. *&SI(' !- LP% -ILT& ,SI'( L&VI'S!'-*, $I' AL(! IT0M

28

M.Tech I Sem Lab Manual Aim: -To write a MATLAB program to 9esign of LPC filter using LC :?SE?#9KDB:? Algorit8m. Software used: -MATLAB 7.5 Program: %% Clearing and Closing commands clc clear all close all %% Program t"3$%304& fs"%333& 1"sin*05pi553Bfs5t,<sin*05pi5%03Bfs5t,& '"1<rand*si)e*t,,& p"%3& (a+g-"lpc*'+p,& a& stem*a, 1la.el*2Se!uence 2,& 'la.el*2Amplitude2,& title*2LPC filter coefficients2,& esult: -7ence t8e 9esign of LPC filter using LC :?SE?#9KDB:? Algorit8m 8as .een verified using MATLAB

Output: -

29

M.Tech I Sem Lab Manual

30

Вам также может понравиться