DSP lab sample viva questions available for download. You can download using username and password on request.
Send request to download the material.
DSP Lab Viva Sample Questions
4. Matlab program to find frequency response of FIR LPF using Rectangular Window
Program:
n=10;
fp=200;
fr=300;
fs=1000;
fn=2*fp/fs;
window=rectwin(n+1);
b=fir1(n,fn,window);
[h,w]=freqz(b,1,128);
Gain=abs(h);
an=angle(h);
subplot(2,1,1);
plot(w/pi,gain);
title('Normal Magnitude response of LPF');
xlabel('Normalized Frequency');
ylabel('gain in db');
subplot(2,1,2);
plot(w/pi,an);
title('Phase response of LPF');
xlabel('Normalized Frequency');
ylabel('Angle');
5. Matlab Program to find frequency response of FIR Highpass using BLACKMAN window
Program:
n=10;
fp=200;
fr=300;
fs=1000;
fn=2*fp/fs;
window=blackman(n+1);
b=fir1(n,fn,'high',window);
[h,w]=freqz(b,1,128);
Gain=abs(h);
an=angle(h);
subplot(2,1,1);
plot(w/pi,gain);
title('Normal Magnitude response of HPF');
xlabel('Normalized Frequency');
ylabel('gain in db');
subplot(2,1,2);
plot(w/pi,an);
title('Phase response of HPF');
xlabel('Normalized Frequency');
ylabel('Angle');
6. Matlab Program to find frequency Response of FIR LPF using Blackman Window
Program:
n=10;
fp=200;
fr=300;
fs=1000;
fn=2*fp/fs;
window=blackman(n+1);
b=fir1(n,fn,window);
[h,w]=freqz(b,1,128);
Gain=abs(h);
an=angle(h);
subplot(2,1,1);
plot(w/pi,gain);
title('Normal Magnitude response of LPF');
xlabel('Normalized Frequency');
ylabel('gain in db');
subplot(2,1,2);
plot(w/pi,an);
title('Phase response of LPF');
xlabel('Normalized Frequency');
ylabel('Angle');
7. Matlab Program to find frequency response of FIR LPF using Hamming Window
n=10;
fp=200;
fr=300;
fs=1000;
fn=2*fp/fs;
window=hamming(n+1);
b=fir1(n,fn,window);
[h,w]=freqz(b,1,128);
Gain=abs(h);
an=angle(h);
subplot(2,1,1);
plot(w/pi,gain);
title('Normal Magnitude response of LPF');
xlabel('Normalized Frequency');
ylabel('gain in db');
subplot(2,1,2);
plot(w/pi,an);
title('Phase response of LPF');
xlabel('Normalized Frequency');
ylabel('Angle');
8. Matlab Program to find frequency response of FIR LPF using Hanning Window
n=10;
fp=200;
fr=300;
fs=1000;
fn=2*fp/fs;
window=hann(n+1);
b=fir1(n,fn,window);
[h,w]=freqz(b,1,128);
Gain=abs(h);
an=angle(h);
subplot(2,1,1);
plot(w/pi,gain);
title('Normal Magnitude response of LPF');
xlabel('Normalized Frequency');
ylabel('gain in db');
subplot(2,1,2);
plot(w/pi,an);
title('Phase response of LPF');
xlabel('Normalized Frequency');
ylabel('Angle');
9. Matlab Program to find frequency response of FIR LPF using Triangular Window
n=10;
fp=200;
fr=300;
fs=1000;
fn=2*fp/fs;
window=triang(n+1);
b=fir1(n,fn,window);
[h,w]=freqz(b,1,128);
Gain=abs(h);
an=angle(h);
subplot(2,1,1);
plot(w/pi,gain);
title('Normal Magnitude response of LPF');
xlabel('Normalized Frequency');
ylabel('gain in db');
subplot(2,1,2);
plot(w/pi,an);
title('Phase response of LPF');
xlabel('Normalized Frequency');
ylabel('Angle');
Write the Programs in the Observations and get it signed after doing in the lab.
By next week end everyone should complete these programs.
with regards,
B V K
1.Matlab code to generate sum of sinusoidal signals
Title('sum of sine waves');
t=0:0.5:2*pi;
y=sin(t);
subplot(4,2,1)
stem(y)
xlabel('n');
ylabel('amplitude');
title('sinewave');
subplot(4,2,2);
plot(y);
xlabel('n');
ylabel('amplitude');
title('sinewave');
y1=sin(t)+5*sin(2*t);
subplot(4,2,3);
xlabel('n');
ylabel('amplitude');
title('sinewave with harmonics');
subplot(4,2,4);
stem(y1);
xlabel('n');
ylabel('amplitude');
title('sinewave with harmonics');
y2=sin(t)+5*sin(2*t)+10*sin(3*t);
subplot(4,2,5);
stem(y2);
xlabel('n');
ylabel('amplitude');
title('sinewave with two harmonics');
subplot(4,2,6);
plot(y2);
xlabel('n');
ylabel('amplitude');
title('sine wave with two harmonics');
y3=sin(t)+5*sin(2*t)+10*sin(3*t)+15*sin(4*t);
subplot(4,2,7);
stem(y3);
xlabel('n');
ylabel('amplitude');
title('sinewave with three harmonics');
subplot(4,2,8);
plot(y3);
xlabel('n');
ylabel('amplitude');
2.Matlab Program to verify Linear Convolution
x=input('Enter Input Sequence:');
y=input('Enter Impulse Response:');
y=conv(x,h);
subplot(3,1,1);
stem(x);
ylabel('amplitude');
xlabel('a');
title('input signal');
subplot(3,1,2);
stem(h);
ylabel('amplitude');
xlabel('b');
title('Impulse Response');
subplot(3,1,3);
stem(y);
ylabel('amplitude');
xlabel('c');
title('Linear Convolution');
disp('The Resultant Signal is:');
disp(y)
3.Matlab Program to find N-Point fft of a sequence
x=input('Enter the Sequence:');
n=input('Enter the Length of FFT:');
y=fft(x,n);
subplot(2,1,1);
stem(x);
title('Input Sequence');
xlabel('time index n');
ylabel('Amplitude');
subplot(2,1,2);
stem(y);
title('output sequence');
xlabel('frequency index');
ylabel('amplitude');
with regards,
B V K