+ All Categories
Home > Documents > Lab Manual Ec-603 Dsp

Lab Manual Ec-603 Dsp

Date post: 08-Nov-2014
Category:
Upload: deepaknayan
View: 44 times
Download: 3 times
Share this document with a friend
Description:
hey everything cN BE FOUN HERE.2;D;;
Popular Tags:
27
DIGITAL SIGNAL PROCESSING EC-603 EXPERIMENT-1 AIM:-  PROGRAM FOR THE GENERATION OF UNIT IMPULSE SIGNAL. PROGRAM:- clc; clear all; close all; t = -2:1:2; y = [zeros (1, 2), ones (1, 1), zeros(1,2) ]; subplot (2, 2, 1); stem (t, y); ylabel ( 'Amplitude '); xlabel (' (a) n '); BI LAB MANUAL AND WORKBOOK 6 LAB MANUAL AND WORK BOOK
Transcript
Page 1: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

EXPERIMENT­1

AIM:­  

PROGRAM FOR THE GENERATION OF UNIT IMPULSE SIGNAL. 

PROGRAM:­

clc; clear all; close all; 

t = ­2:1:2; 

y = [zeros (1, 2), ones (1, 1), zeros(1,2) ]; subplot (2, 2, 1); stem (t, y);

ylabel ( 'Amplitude  ');→

xlabel (' (a) n  ');→

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 2: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

VIVA VOCE

Ques1 What do you mean by signal ?

AnsA signal is defined as a information containing message.

Ques2 Explain classification of the signals.

Ans 1. Deterministic & non deterministic,

2. Periodic & aperiodic,

3. Even & odd signal,

4. Causal & non causal signal,

5. Energy & Power Signal.

Ques3 Explain classification of the systems.

Ans 1. Static & dynamic,

2. Linear & non linear ,

3. Time invariant & time variant

4. Causal & non causal

5. Stable & unstable.

Ques4 Discuss the applications of digital signal processing.

Ans 1. Telecommunication,

2. Military,

3. Consumer Electronics,

4. Image processing,

5. Speech processing,

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 3: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

6. Medicine.

7. Spectrum analysis.

Ques What do you mean by deterministic signal ?

Ans  The nature and amplitude of such signal at any time can be predicted.

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 4: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

EXPERIMENT ­2

AIM:­ 

PROGRAM FOR COMPUTING CIRCULAR CONVOLUTION.

PROGRAM:­

clc;

close all;

clear all;

g = input (' enter the first sequence'); 

h = input (' enter the 2nd sequence ');

N1 = length (g);

N2 = length (h);

N = max (N1, N2 ) ;

N3 = N1­ N2;

% Loop for getting equal length sequence 

if (N3 = 0)

      h = [h, zeros (1,N3 )];

else 

      g = [g, zeros (1,­N3 )];

end 

% Computation of circular convolved sequence 

for n =1: N,

     Y(n) = 0

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 5: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603     for I =1: N,

          j = n – I + 1;

          if (j = = 0)

              j=N + j;

           end 

           y(n) = y(n) + g(i) *h ( j);

      end 

end

disp ( 'The resultant signal is ' ); y

EXAMPLE:­

enter the first Sequence [1 2 4]

enter  the 2nd sequence [1 2 ] 

The resultant signal is 

y =1 4 8  8

 

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 6: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

VIVA VOCE

Ques1 What do you mean by periodic signal ?

Ans A periodic signal repeats after a fixed time period.

Ques2 What do you mean by even signal ?

Ans A even signal satisfies even symmetry.

Ques3 What do you mean by odd signal ?

Ans A odd signal satisfies odd symmetry.

Ques4 What do you mean by causal signal ?

Ans A signal is said to be causal, if its amplitude is zero for negative time.

Ques What do you mean by non­causal signal ?

Ans  A signal is said to be non­causal, if its amplitude is zero for positive time.

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 7: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

EXPERIMENT­3

AIM:­ 

PROGRAM FOR COMPUTING DISCRETE FOURIER TRANSFORM.

ALGORITHM:­

Get the signal x(n) of length N in matrix form 

Get the N value 

The transformed signal is denoted as 

PROGRAM:­ 

clc; close all; clear all ;

x = input ('enter the  sequence ');

n = input ('enter the length  of fft ');

X(k) = fft (x,n);

stem (y); y label ( 'imaginary axis ­­>' );

xlabel( 'Real axis—>' );

X(k)

EXAMPLE:­ 

enter the sequence [0 1 2 3 4 5 6 7]

enter the  length of fft 8

X(k) = 

     Columns 1 through 4 

     28.0000 – 4.0000 + 9.6569i – 4.0000 + 4.0000i + 4.0000 + 1.6569i

     Columns 5 through 8

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 8: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603     ­ 4.0000 – 4.0000 – 1.6569i – 4.0000 – 4.0000i – 4.0000 ­ 9.6569i

The eight point decimation­in time fast Fourier transform of the sequence x(n) is computed using mat­lab 

program and the resultant output is plotted in fig 15.6

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 9: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

VIVA VOCE

Ques1 What do you mean by energy signal ?

Ans The energy signal is one, which has finite energy and zero average power.

Ques2 What do you mean by power signal ?

Ans The power signal is one, which has finite average power and infinite energy.

Ques3 What do you mean by static system ?

Ans The output of a static system at any specific time depends on the the input at that particular 

time. It does not depends on the past or future value of the input.

Ques4 What do you mean by dynamic system ?

Ans The output of a dynamic system at any specific time depends on the the input at that  specific 

time and at other times also.

Ques What do you mean by linear system ?

Ans  A linear system is one, which follows the super position theorem.

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 10: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

EXPERIMENT­4

AIM:­ 

PROGRAM FOR THE DESIGN OF BUTTER WORTH ANALOG LOW PASS FILTER.

ALGORITHM:­

Get the passband and stop­band ripples,

Get the passband and stop­band edge frequencies, 

Get the sampling frequency,

Calculate the order of the filter  using Equ 8.46,

Find the filter coefficient,

Draw the magnitude and phase response, 

PROGRAM :­

clc; 

close all; clear all ;

format long 

rp = input ( 'enter the passband ripple' ); 

rs = input ( 'enter the stop­band ripple'  );

wp = input ( 'enter the pass band  freq' );

ws = input ( 'enter the stop­band freq' ); 

fs = input ( 'enter the sampling freq' );

w1 = 2*wp/fs; w2= 2 *ws/ fs; 

 [n, wn] = buttord ( w1, w2, rp, rs, 's ' );

 [z, p, k]= butter (n, wn); 

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 11: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603 [b, a] = zp2tf ( z, p, k );

 [b, a] =butter (n, wn, ' s');

w= 0: 0.01: pi;

 [h, om]= freqs (b, a, w);

m = 20*log 10 (abs (h));

an = angle (h);

subplot (2, 1, 1); plot (om/pi, m);

ylabel ( 'Gain in db ­­>' ); xlabel (' (a) Normalised frequency ­­>');

subplot (2, 1, 2 ); plot (om/pi, an); 

xlabel (' (b) Normalised frequency ­­>');

ylabel (' phase in radians ­­> ');

EXAMPLE:­ 

enter the passband ripple 0.15 

enter the stopband ripple 60

enter the passband freq 1500

enter the stopband freq 3000

enter the sampling freq 7000

The amplitude and phase response of the Butter­worth low pass analog filter are shown in fig 15.7 

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 12: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

VIVA VOCE

Ques1 What do you mean by non linear system ?

Ans A non linear system is one, which does not follow the super position theorem.

Ques2 What do you mean by time invariant system ?

Ans A time invariant system is one, whose input­ output relationship does not vary with time. It is a 

fixed system.

Ques3 What do you mean by time variant system ?

Ans A time variant system is one, whose input­ output relationship varies with time.

Ques4 What do you mean by causal system ?

Ans The response of the causal system to an input does not depend on future values of the input. It 

depends only on the present and/or past values of the input.

Ques5 What do you mean by non causal system ?

Ans  The response of the non causal system to an input depends on future values of the input as well 

as on the present and/or past values of the input.

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 13: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

EXPERIMENT­5

AIM:­ 

PROGRAM FOR THE DESIGN OF BUTTERWORTH ANALOG HIGHPASS FILTER.

PROGRAM:­

clc; 

close all; clear all; 

format long 

rp=input ('enter the passband ripple'); 

rs=input ('enter the stopband ripple'); 

wp= input(' enter the passband freq');

ws= input(' enter the stopband freq');

fs=input ('enter the sampling freq ');

w1 =2*wp /fs ; w2 =2*ws/fs ;

 [n, wn] = buttord (w1, w2, rp, rs, 's');

 [b, a] = butter (n, wn, 'high' ,'s');

w = 0: .01: pi; 

 [h,om] = freqs (b,a,w);

m = 20*log 10 (abs (h));

an = angle (h)

subplot (2, 1, 1); plot (om/pi,m);

ylabel ( 'Gain in dB ­­>'); xlabel ( '(a) Normalised frequency ­­>');

subplot (2 ,1 ,2 ); plot (om/pi,an );

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 14: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603xlabel ( '(b) Normalised frequency ­­> ');

ylabel ( 'phase in radians ­­>');

EXAMPLE:­ 

enter the passband ripple   0.2

enter the stopband ripple   40

enter the passband freq     2000

enter the stopband freq      3500

enter the sampling freq      8000

The amplitude and phase response of butter­worth high pass analog filter are shown in fig 

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 15: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

VIVA VOCE

Ques1 What do you mean by stable system ?

Ans A system is said to be bounded­input, bounded­output (BIBO) stable, if every bounded input 

produces a bounded output.

Ques2 What do you mean by unstable system ?

Ans A system is said to be unstable system, if it does not follows the BIBO criteria.

Ques3 Explain the z­ transform.

Ans The z­ transform gives a method for analysis of discrete time system in the frequency domain.

Ques4 Explain the region of convergence (ROC).

Ans The set of z values in the z – plane for which the magnitude of X(z) is finite, is called as    region 

of convergence (ROC).

Ques5 Explain the properties of region of convergence (ROC).

Ans  1. The ROC does not contains any poles.

2. when x(n) is of finite duration, then the ROC is the entire z­ plane, except z = 0. 

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 16: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

EXPERIMENT­6

AIM:­ 

PROGRAM FOR THE DESIGN OF BUTTER WORTH ANALOG BANDPASS FILTER. 

ALGORITHM:­

Get the passband and stopband ripples,

Get the passband and stopband edge frequencies, 

Get the sampling frequency, 

Calculate the order of the filter using equation,  

Find the filter coefficients, 

Draw the magnitude and phase responses,

PROGRAMME:­

clc ;

close all; clear all;

format long 

rp = input ( ' enter the passband ripple .  .   . ');

rs = input ( 'enter the stopband ripple .  .   .  ');

wp = input ( 'enter the passband freq.   .    . ');

ws = input ( 'enter the stopband freq.  .    .  ');

fs = input( 'enter the sampling freq .   .    .  ');

w1 = 2*wp/fs; w2=2*ws/fs;

 [n] = buttord (w1,w2,rp, rs); 

wn = [w1 w2 ];

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 17: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603 [b,a] = butter (n, wn, 'bandpass', ' s'); 

w = 0:  .01: pi;

 [h,om] = freqs (b, a, w);

m = 20*log 10 (abs (h));

an = angle (h);

subplot( 2, 1, 1); plot (om/pi, m);

ylabel ( 'Gain in db ­­>'); xlabel ( '(a) Normalized frequency ­­>');

Subplot (2, 1, 2); plot (om/pi, an); 

xlabel ( '(b) Normalized frequency ­­>');

ylabel ( 'phase in radians ­­>');

EXAMPLE:­

enter the pass band ripple . . .   0.36

enter the stop band ripple . .  .  36

enter the passband freq . . .       1500

enter the stop band freq . . .       2000

enter the sampling freq . . .        6000

The amplitude and phase responses of Butter­worth bandpass analog filter are shown in Fig 

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 18: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

VIVA VOCE

Ques1 Explain the properties of z – transform.

Ans 1. Linearity

2. Time reversal

3. Time shifting

4. Time scaling

5. Differentiation

6. Convolution

7. Correlation

8. Initial & Final value theorem

9. Time advance.

Ques2 Write the methods for inverse z­ transform.

Ans 1. Long division

2. Partial fraction expansion

3. Residue method.

Ques3 Explain the properties of DSP.

Ans 1. Linearity

2. Time invariance

3. Causality

4. Stability

Ques4 Explain the properties of convolution.

Ans 1. Commutative law

2. Associative law

3. Distributive law

Ques5 What do you mean by infinite impulse response (IIR) system.

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 19: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

Ans  An LTI  system is  said   to  be  an  IIR system,   if   its  unit  sample   response  h(n)   is  of   infinite 

duration.

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 20: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

EXPERIMENT ­7

AIM:­ 

PROGRAM FOR THE DESIGN OF BUTTERWORTH ANALOG BANDSTOP FILTER.

ALGORITHM:­

Get the passband and stopband ripples,

Get the passband and stopband edge frequencies, 

Get the sampling frequency, 

Calculate  the order of the filter using Equation,

Find the filter coefficients, 

Draw the magnitude and phase responses,

PROGRAM:­

clc : 

close all; clear all; 

format long 

rp = input ( 'enter the pass band ripple . . . ');

rs = input ( 'enter the stop band ripple . . .');

wp = input ( ' enter the passband freq . . . ');

ws = input ( ' enter the stopband freq . . .');

fs = input ( 'enter the sampling freq. .  .'); 

 w1 = 2*wp/fs ; w2= 2*ws/fs; 

 [n] = buttord (w1, w2, rp, rs, 's'); 

wn = [ w1 w2];

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 21: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603 [b,a] =  butter (n, wn, 'stop', 's'); 

w = 0: .01: pi;

[h, om] = freqs (b, a, w); 

m = 20*log 10 (abs (h));

an = angle (h);

subplot (2, 1, 1); plot (om/pi, m);

ylabel ( 'Gain in db ­­>'); xlabel ( '(a) Normalized frequency ­­>');

subplot (2, 1, 2); plot (om/pi, an);

xlabel ( '(b) Normalized frequency ­­>');

ylabel ('phase  in  radians ­­>');

EXAMPLE:­ 

enter the passband ripple . . .  0.28

enter the stop band ripple .  .  .  28

enter the passband freq .  .  .   1000

enter the stopband freq . . .     1400

enter the sampling freq .  .  .    5000

The amplitude and phase response of Butter­worth band stop analog filter are shown in Fig 

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 22: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

VIVA VOCE

Ques1 What do you mean by finite impulse response (FIR) system.

Ans An LTI system is said to be an FIR system, if its unit sample response h(n) is of finite duration.

Ques2 What do you mean by Discrete Fourier Transform (DFT).

Ans The Discrete Fourier transform computes  the values of the z –  transform for evenly spaced 

points around the unit circle for a given sequence.

Ques3 Explain the properties of DFT.

Ans         1. Linearity

2. Periodicity

3. Shifting

4. Convolution

5. Time reversal

6. Circular time shift

7. Circular frequency shift

8. Circular convolution

9. Circular correlation

10. Parseval's theorem

Ques4 What do you mean by Fast Fourier Transform (FFT).

Ans The FFT is an algorithm that efficiently computes the DFT using graphical method.

Ques5 Explain method for computing FFT.

Ans  1. Decimation – in – Time (DIT)

2. Decimation – in – Frequency (DIF)

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 23: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

EXPERIMENT ­8

AIM:­ 

PROGRAM FOR THE DESIGN OF FIR LOW PASS PASS, HIGH PASS,  BAND PASS AND BAND 

STOP FILTER USING HAMMING WINDOW.  

ALGORITHM:­

Get the passband and  stop­band ripples, 

Get the passband and stop­band edge frequencies,

Get the sampling frequency,

Calculate the order of the filter, 

Find the window coefficient using equation,

Draw the magnitude and phase response, 

PROGRAMME:­

clc; clear all; close all ;

rp = input ('enter the passband ripple'); 

rs = input ('enter the stopband ripple'); 

fp = input(' enter the passband freq');

fs = input(' enter the stopband freq');

f = input(' enter the sampling freq');

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); 

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 24: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603n1 = 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);

m = 20*log 10(abs(h));

subplot (2, 2, 1); plot (o/pi,m ); ylabel ('Gain in dB ­­>');

Xlabel ('(a) Normalised frequency­­>');

% High pass filter 

b = fir1 (n, wp, 'high', y);

[h,0] =  freqz (b, 1, 256 );

m = 20*log10 (abs(h));

subplot (2, 2, 2); plot( o/pi,m ); ylabel ('Gain in db­­>');

xlabel ('(b) Normalised frequency­­>');

% Bandpass filter 

wn = [ wp ws]; 

b = fir1 (n, wn, y);

 [h,o]= freqz (b, 1, 256 );

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 25: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603m = 20* log10 (abs( h ));

subplot (2, 2, 3); plot( o/pi,m ); ylabel(' Gain in dB­­>'); 

xlabel ('(c) Normalised frequency­­>');

%Bandstop filter 

b = fir1 (n, wn, 'stop', y);

 [h,o]= freqz (b, 1, 256 );

m = 20* log10 (abs( h ));

subplot (2, 2, 4); plot( o/pi,m ); ylabel(' Gain in dB­­>'); 

xlabel ('(d) Normalized frequency­­>');

EXAMPLE:­ 

enter the passband ripple           0.02

enter the stop band ripple         0.01

enter the  pass band freq          1200

enter the stop band freq           1700

enter the sampling freq            9000

The gain response of low pass,high pass band pass bandstop filter using Hamming window are shown in 

fig 

 

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 26: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

VIVA VOCE

Ques1 Explain method for IIR filter design.

Ans 1. Approximation of derivatives

2. Impulse invariant

3. Bilinear transformation

Ques2 Explain basic structure for IIR systems.

Ans 1. Direct form I

2. Direct form II

3. Cascade realization

4. Parallel realization 

Ques3 Explain windows techniques.

Ans 1. Rectangular

2. Hamming

3. Hanning

4. Blackman

5. Bartlett

6. Kaiser

Ques4 Explain the types of analog filters.

Ans 1. Low pass filter (LPF)

2. High pass filter (HPF)

3. Band pass filter (BPF)

4. Band stop filter (BSF)

Ques5 Write advantages of FIR filters over IIR filters.

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK

Page 27: Lab Manual Ec-603 Dsp

DIGITAL SIGNAL PROCESSING

EC-603

Ans  1. They are always stable.

2. the design methods are linear.

3. They can have an exact linear phase.

4. They can be realized efficiently in hardware.

BI LAB MANUAL AND WORKBOOK 6

LAB MANUAL AND WORK BOOK


Recommended