You are on page 1of 11

DAYANANDA SAGAR COLLEGE OF ENGINEERING

DEPARTMENT OF ELECTRONICS AND COMMUNICATION

DSP Lab Question Bank Note:



Only Filter Questions have been changed. Practice all necessary formulae for filters. The combination of questions may be changed by examiners. The values and equations may be changed by examiners. Programs 9 10 11 12 13 are also included.

PART-A
1. Write and execute a program using Matlab to verify sampling theorem for the following conditions i) Over -Sampling ii) Under- Sampling for an input x(t)=cos(2**fd*t) or x(t)= sin(2*pi*fd*t);. fd will be specified.

2. Using Matlab find the output y(n) of a given LTI system whose impulse response h(n) = [1,1,2,1], to an input x(n)=[1,2,3,4] . Index will be specified.

3. Using Matlab obtain the circular convolution of the two finite duration sequences given below x1(n)=[1,1,2,1] x2(n)=[1,2,3,4] 4. Write and verify a Matlab program to find the autocorrelation of the given sequence x(n)= [4,,8,5,-1,6]. 5. Using Matlab find the Cross-Correlation between the two given sequences x1(n)=[1,1,2,1] x2(n)=[1,2,3,4] . Index will be specified 6. Using Matlab plot the magnitude response of an N-pt DFT of the given sequence x(n)=[1,-2, 2,1] 7. Using Matlab obtain the linear convolution of the two given sequences using DFT and IDFT method. x1(n)=[1,1,2,1] y(n)=[1,2,3,4]

8. Using Matlab obtain the circular convolution of the two given sequences using DFT and IDFT method. x1(n)=[1,1,2,1] y(n)=[1,2,3,4]

9. Using Matlab design and implement a digital low pass filter H(z) that when used in an A/D-H(z)-D/A structure gives an equivalent analog filter with following specifications i) Monotonic Pass Band and Stop Band ii) Pass Band Ripple 3.01dB iii) Pass Band Edge: 500Hz iv) Stop Band attenuation 15dB v) Stop Band Edge: 750Hz vi) Sample rate of 2KHz 10.Design and implement an IIR digital low pass filter that when used in an A/DH(z)-D/A structure will satisfy the following specifications i) Ripple in the pass band and iv) Stop band attenuation monotonic' 20dB. in the stop band v) Stop band edge 500Hz. ii) Pass band ripple 2dB. vi) Sampling rate 4KHz. iii) Pass band edge 100Hz. . 11.Using Matlab design and implement a High Pass FIR Filter with the following desired frequency response. Hd(w)=Hd.(ejw) = =

;|w|/4 ; /4|w|

-jw(N-1/2)

Determine the co-efficients of the impulse response h(n) of the FIR Filter using a rectangular window of size N=5. 12.Using Matlab design and implement a Low Pass FIR Filter with the following desired frequency response. Hd(w)=Hd.(ejw) =

e-jw(N-1/2)

; |w| /4

=0 ; /4|w| Determine the co-efficients of the impulse response h(n) of the FIR Filter using a rectangular window of size N=5. 13.Using Matlab design and implement a Low Pass FIR Filter with the following desired frequency response. Hd(w)=Hd.(ejw) =

e-jw(N-1/2)

; |w| 3/4

=0 ; 3/4|w| Determine the co- efficients of the impulse response h(n) of the FIR Filter using a Hamming window of size N=7. 14.Using Matlab design FIR Filter using Kaiser Window for the following specifications. I) N= 30 ii) = 1.2

iii) Digital cutoff frequency= 0.3

Solving the Difference Equation 15.A causal discrete LTI System is described by y[n]-3/4y[n-1]+1/8y[n-2]=x[n] where x[n] and y[n] are the input and output of the system respectively. Find the Impulse response h[n] of the system using Matlab.

16.A causal discrete LTI System is described by y[n]-3/4y[n-1]+1/8y[n-2]=x[n] where x[n] and y[n] are the input and output of the system respectively. Find the Step response s[n] of the system using Matlab.

17.A causal discrete LTI System is described by y[n]-3/4y[n-1]+1/8y[n-2]=x[n] where x[n] and y[n] are the input and output of the system respectively. Find the response of the system to the input x[n]=sin(0.5n) using Matlab.

18.Solve the following difference equation for y(n) making use of specified initial conditions and the input x(n). y[n]-1/2y[n-1]=x[n]; n0 and y[-1]=1/4. Find the response of the system to the input x[n]=sin(0.5n) using Matlab.

PART-B

1. Write a c program to obtain the linear convolution of x(n)=[1,1,2,1] y(n)=[1,2,3,4] 2. Write and verify a c program that obtains the circular convolution of the two sequences x(n)=[1,1,2,1] y(n)=[1,2,3,4] 3. Find the N-Point DFT of the sequence x(n)=[1,-2,2,1] using ccstudio. 4. Obtain the impulse response of the given LTI system y[n]-3/4y[n-1]+1/8y[n2]=x[n] using ccstudio. Obtain the impulse response of the given LTI system y[n]-1/2y[n-1]=x[n] using ccstudio.

5. Design an FIR Low filter to meet given specifications by taking input from signal generator . For Example: Given: Order=30 Sampling rate = 8000 Cutoff Frequency= 1000 Hz Window= Bartlett.

Specifications can be changed.

6.

Write a C program to remove the noise and recover the desired signal from noisy signal with proper inputs.

QUESTION- 1 A. Write and execute a program using Matlab to verify sampling theorem for the following conditions i) Over Sampling ii) Under- Sampling for an input x(t)=cos(2**fd*t) B. Write a c program to obtain the linear convolution of x(n)=[1,1,2,1]

y(n)=[1,2,3,4] QUESTION- 2 A. Using Matlab find the output y(n) of a given LTI system whose impulse response h(n) = [1,1,2,1], to an input x(n)=[1,2,3,4] B. Write a c program to obtain the linear convolution of x(n)=[1,1,2,1] y(n)=[1,2,3,4] QUESTION- 03 A. Using Matlab obtain the circular convolution of the two finite duration sequences given below x1(n)=[1,1,2,1] x2(n)=[1,2,3,4] B. Obtain the impulse response of the given LTI system y[n]-1/2y[n-1]=x[n] using CCStudio QUESTION- 04 A. Write and verify a Matlab program to find the autocorrelation of the given sequence x(n)= [4,,8,5,-1,6]. B. Design an FIR Low filter to meet given specifications by taking input from signal generator. Given: Order=30 Sampling rate = 8000

Cutoff Frequency= 1000 Hz Window= Bartlett. QUESTION- 05 A. Using Matlab find the Cross-Correlation between the two given sequences x1(n)=[1,1,2,1] x2(n)=[1,2,3,4] . B. Write and verify a c program that obtains the circular convolution of the two sequences x(n)=[1,1,2,1] y(n)=[1,2,3,4] QUESTION- 06 A. Using Matlab plot the magnitude response of an N-pt DFT of the given sequence x(n)= [1,-2, 2,1] B. Find the N-Point DFT of the sequence x(n)=[1,-2,2,1] using CCStudio. QUESTION- 07 A. Using Matlab obtain the linear convolution of the two given sequences using DFT and IDFT method. x1(n)=[1,1,2,1] y(n)=[1,2,3,4]

B. Write and verify a c program that obtains the circular convolution of the two sequences x(n)=[1,1,2,1] y(n)=[1,2,3,4]

QUESTION- 08 A. Using Matlab obtain the circular convolution of the two given sequences using DFT and IDFT method. x(n)=[1,1,2,1] y(n)=[1,2,3,4] B. Write a c program to obtain the linear convolution of x(n)= [1,1,2,1] y(n) = [1,2,3,4] QUESTION- 09
A. Using Matlab design and implement a digital low pass filter H(z) that when used in an A/D-H(z)-D/A structure gives an equivalent analog filter with following specifications i) Monotonic Pass Band and Stop Band ii) Pass Band Ripple 3.01dB iii) Pass Band Edge: 500Hz iv) Stop Band attenuation 15dB v) Stop Band Edge: 750Hz vi) Sample rate of 2KHz

B. Write a c program to obtain the linear convolution of x(n)=[1,1,2,1] y(n)=[1,2,3,4]

QUESTION- 10 A. Design and implement an IIR digital low pass filter that when used in an A/D-H(z)-D/A
structure will satisfy the following specifications i) Ripple in the pass band and monotonic in the stop band iv) Stop band attenuation 20dB. ii) Pass band ripple 2dB. v) Stop band edge 500Hz. iii) Pass band edge 100Hz. vi) Sampling rate 4KHz.

B. Find the N-Point DFT of the sequence x(n)=[1,-2,2,1] using ccstudio QUESTION- 11 A. Using Matlab design and implement a High Pass FIR Filter with the following desired
frequency response. Determine the co-efficients of the impulse response h(n) of the FIR Filter using a rectangular window of size N=5.

Hd(w)=Hd.(ejw) =

0
-jw(N-1/2)

;|w|/4

=e ; /4|w| B. Find the N-Point DFT of the sequence x(n)=[1,-2,3,1] using ccstudio QUESTION- 12 A. Using Matlab design a Low Pass FIR Filter with the following desired frequency
response. Determine the co-efficients of the impulse response h(n) of the FIR Filter using a rectangular window of size N=5.

Hd(w)=Hd.(ejw) =

e-jw(N-1/2)

; |w| /4

=0 ; /4|w| B. Find the N-Point DFT of the sequence x(n)=[1,-2,2,1] using ccstudio QUESTION- 13 A. Using Matlab design a Low Pass FIR Filter with the following desired frequency response. Determine the co- efficients of the impulse response h(n) of the FIR Filter using a Hamming window of size N=7. Hd(w)=Hd.(ejw) =

e-jw(N-1/2)

; |w| 3/4

=0 ; 3/4|w| B. Obtain the impulse response of the given LTI system y[n]-1/2y[n-1]=x[n] using ccstudio QUESTION- 14 A. Using Matlab design FIR Filter using Kaiser Window for the following specifications. I) N= 30 ii) = 1.2 iii) Digital cutoff frequency= 0.3

B. Write a C program to remove the noise and recover the desired signal from noisy signal with proper inputs. QUESTION- 15 A. A causal discrete LTI System is described by y[n]-3/4y[n-1]+1/8y[n-2]=x[n] where x[n] and y[n] are the input and output of the system respectively. Find the Impulse response h[n] of the system using Matlab. B. Obtain the impulse response of the given LTI system y[n]-3/4y[n-1]+1/8y[n2]=x[n] using CCStudio QUESTION- 16 A. A causal discrete LTI System is described by y[n]-3/4y[n-1]+1/8y[n-2]=x[n] where x[n] and y[n] are the input and output of the system respectively. Find the Step response s[n] of the system using Matlab. B. Obtain the impulse response of the given LTI system y[n]-1/2y[n-1]=x[n] using CCStudio QUESTION- 17 A. A causal discrete LTI System is described by y[n]-3/4y[n-1]+1/8y[n-2]=x[n] where x[n] and y[n] are the input and output of the system respectively. Find the response of the system to the input x[n]=sin(0.5n) using Matlab B. Obtain the impulse response of the given LTI system y[n]-1/2y[n-1]=x[n] using CCStudio QUESTION- 18 A. Solve the following difference equation for y(n) making use of specified initial conditions and the input x(n). y[n]-1/2y[n-1]=x[n]; n0 and y[-1]=1/4. Find the response of the system to the input x[n]=sin(0.5n) using Matlab.

B. Write and verify a c program that obtains the circular convolution of the two sequences x(n)=[1,1,2,1] y(n)=[1,2,3,4]

Program9
clear all; close all; clc; %Specifications and Response for Lowpass Butterworth filter fp=500; fstp=750; Ap=3.01; As=15; fs=2000; [N,wc]=buttord(2*fp/fs,2*fstp/fs,Ap,As) [b,a]=butter(N,wc) %plot the frequency response [mag,freq]=freqz(b,a,256,fs); subplot(3,1,2) plot(freq,abs(mag)); title('Filter Response'); grid on; %Input Signal n=0:1/fs:0.1; f1=100;f2=550;f3=900; x1=sin(2*pi*n*f1); x2=sin(2*pi*n*f2); x3=sin(2*pi*n*f3); x=[x1 x2 x3]; subplot(3,1,1); plot(x); title('Input'); grid on; %Generate o/p y=filter(b,a,x); subplot(3,1,3); plot(y); title('Output'); grid on;

Program10
clear all; close all; clc; %Specifications and filter Response fp=100; fstp=500; Ap=2; As=20; fs=4000;

[N,wc]=cheb1ord(2*fp/fs,2*fstp/fs,Ap,As) [b,a]=cheby1(N,Ap,wc) %plot the frequency response [mag,freq]=freqz(b,a,256,fs); subplot(3,1,2) plot(freq,abs(mag)); title('Filter Response'); grid on; %Input Signal n=0:1/fs:0.1; f1=50;f2=120;f3=600; x1=sin(2*pi*n*f1); x2=sin(2*pi*n*f2); x3=sin(2*pi*n*f3); x=[x1 x2 x3]; subplot(3,1,1); plot(x); title('Input'); grid on; %Generate o/p y=filter(b,a,x); subplot(3,1,3); plot(y); title('output'); grid on;

Note: FREQZ(B,A,N,Fs) return frequency vector F (in Hz), where Fs is the sampling frequency (in Hz)

Program11
clear all; close all; clc; %Specifications and Response for FIR High filter wc=pi/4; N= 4; wc=wc/pi; rw = rectwin(N+1); subplot(2,1,1) stem(rw); title('Rectangular Window'); h=fir1(N, wc,'high',rectwin(N+1)) %plot the frequency response [mag,freq]=freqz(h,1,128); mag = 20*log10(abs(mag)); subplot(2,1,2); plot(freq/pi,mag); title('Filter Response');

Program12
clear all;

Close all; clc; %Specifications and Response for FIR High filter wc=pi/4; N=4; wc=wc/pi; rw = rectwin(N+1); subplot(2,1,1) stem(rw); title('Rectangular Window'); h=fir1(N, wc,rectwin(N+1)) %plot the frequency response [mag,freq]=freqz(h,1,128); mag = 20*log10(abs(mag)); subplot(2,1,2) plot(freq/pi,mag); title('Filter Response');

Program13
clear all; close all; clc; %Specifications and Response for FIR Low Pass filter wc=3*pi/4; N=6; wc=wc/pi; hw = hamming(N+1); subplot(2,1,1) stem(hw); title('Hamming Window'); h=fir1(N, wc,hamming(N+1)) %plot the frequency response [mag,freq] = freqz(h,1,128); mag = 20*log10(abs(mag)); subplot(2,1,2) plot(freq/pi,mag); title('Filter Response');

You might also like