M.tech Isem Manual
M.tech Isem Manual
M.tech Isem Manual
PPDCET_ECE_SSP
1. Basic Operations on Signals, Generation of Various Signals and finding its FFT.
2. Program to verify Decimation and Interpolation of a given Sequences.
3. Program to Convert CD data into DVD data
4. Generation of Dual Tone Multiple Frequency (DTMF) Signals
5. Plot the Periodogram of a Noisy Signal and estimate PSD using Periodogram and
Modified Periodogram methods
6. Estimation of Power Spectrum using Bartlett and Welch methods
7. Parametric methods (Yule-Walker and Burg) of Power Spectrum Estimation
8. Design of LPC filter using Levinson-Durbin Algorithm
9. Computation of Reflection Coefficients using Schur Algorithm
10. To study Finite Length Effects using Simulink
11. Design and verification of Matched filter
12. Adaptive Noise Cancellation using Simulink
13. Design and Simulation of Notch Filter to remove 60Hz Hum/any unwanted
frequency component of given Signal (Speech/ECG)
PPDCET_ECE_SSP
EXPERIMENT NO.1
1.1. To generate Various fundamental discrete time signals
PPDCET_ECE_SSP
t=0:1:5;
a1=.5;
y4=exp(a1*t);
subplot(4,2,4)
stem(t,y4)
xlabel('no of samples')
ylabel('amplitude')
title('exponential increasing sequence')
% program for exponentially decreasing
t=0:1:5;
a2=.2;
y5=exp(-a2*t);
subplot(4,2,5)
stem(t,y5)
xlabel('no of samples')
ylabel('amplitude')
title('exponential decreasing sequence')
% program for sine wave generation
t=0:0.1:2;
y6=sin(2*pi*t);
subplot(4,2,6)
stem(t,y6)
xlabel('no of samples')
ylabel('amplitude')
title('sine wave')
% program for cosine wave generation
t=0:0.1:2;
y7=cos(2*pi*t);
subplot(4,2,7)
stem(t,y7)
xlabel('no of samples')
ylabel('amplitude')
title('cosine wave')
Result: - Hence different basic signals have been generated and plotted using MATLAB
PPDCET_ECE_SSP
Output: -
PPDCET_ECE_SSP
PPDCET_ECE_SSP
xlabel('no of samples')
ylabel('amplitude')
title('multipilcation of signals')
% Folding of sequences
subplot(3,2,5)
stem(-x,x)
xlabel('no of samples')
ylabel('amplitude')
title('folded sequence')
% Amplitude scaling
subplot(3,2,6)
stem(x,x*2)
xlabel('no of samples')
ylabel('amplitude')
title('amplitude Scaling')
Result: -Hence basic operations signals have been generated and plotted using MATLAB
Output: -
PPDCET_ECE_SSP
Aim: - To write a MATLAB program to find out the DFT & IDFT of a given sequence.
Software used: -MATLAB 7.5
Program: %% Clearing and closing commands
clc
clear all
close all
%% Program for DFT
N=8;
x=[1 2 3 4 4 3 2 1];
for k=0:1:N-1;
for n=0:1:N-1;
p=exp(-j*2*pi*n*k/N);
x2(k+1,n+1)=p;
end;
end;
y=x*x2;
disp(y);
stem(x,y);
xlabel('time period')
ylabel('amplitude');
title('DFT of the sequence');
PPDCET_ECE_SSP
stem(x,y);
xlabel('time period');
ylabel('amplitude');
title('IDFT of the sequence');
Result: - Hence the DFT & IDFT of the given sequence has been found and plotted using
MATLAB
PPDCET_ECE_SSP
Outputs: FFT
Columns 1 through 4
20.0000
-5.8284 - 2.4142i
Columns 5 through 8
0 - 0.0000i -0.1716 + 0.4142i -0.0000 - 0.0000i -5.8284 + 2.4142i
10
PPDCET_ECE_SSP
IFFT
Columns 1 through 4
2.5000
-0.7286 + 0.3018i
Columns 5 through 8
0 + 0.0000i -0.0214 - 0.0518i -0.0000 + 0.0000i -0.7286 - 0.3018i
11
PPDCET_ECE_SSP
EXPERIMENT NO.2
PROGRAM TO VERIFY INTERPOLATION & DECIMATION OF A GIVEN SEQUENCE
Aim: -To write a MATLAB program to verify INTERPOLATION and DECIMATION of a given
sequence.
Software used: -MATLAB 7.5
Program: %% Clearing and Closing commands
clc
clear all
close all
%% Program for Interpolation
t=0:0.05:2;
x=cos(2*pi*t);
y=interp(x,2);
t2=interp(t,2);
subplot(2,1,1)
stem(t,x)
xlabel('Number of Namples');
ylabel('Amplitude')
title('Input Sequence')
subplot(2,1,2)
stem(t2,y)
xlabel('Number of Samples');
ylabel('Amplitude')
title('Interpolated Sequence')
%% Program for Decimation
t=0:0.05:2;
x=cos(2*pi*t);
y=decimate(x,2);
t1=decimate(t,2);
subplot(2,1,1)
stem(t,x)
xlabel('Number of Samples');
ylabel('Amplitude')
title('Input Sequence')
subplot(2,1,2)
12
PPDCET_ECE_SSP
stem(t1,y)
xlabel('Number of Samples');
ylabel('Amplitude')
title('Decimated Sequence')
Result: - Hence the INTERPOLATION and DECIMATION of a given sequence has been verified
using MATLAB
13
PPDCET_ECE_SSP
Outputs: -
14
PPDCET_ECE_SSP
EXPERIMENT NO.3
PROGRAM TO CONVERT CD DATA TO DVD DATA
Aim: -To write a MATLAB program to convert CD data to DVD data .
Software used: -MATLAB 7.5
Program: %% Clearing and closing commands
clc
clear all
close all
%% Program
[y, Fs, nbits] = wavread('type.wav');
disp('The sampling frequency is:');
Fs
disp('Number of bits per sample:');
nbits
disp('The length of the CD data is:');
length(y)
%%
p=interp(y,2);
Fs1=Fs*2;
disp('The sampling frequency is:');
Fs1
disp('Number of bits per sample:');
nbits
disp('The length of the DVD data is:');
length(p)
wavplay(y,Fs);
pause(2);
wavplay(p,Fs1);
Result:-Hence the data sampled at CD sampling rate is converted into DVD sampling rate has
been verified using MATLAB
15
PPDCET_ECE_SSP
16
PPDCET_ECE_SSP
EXPERIMENT NO.4
GENERATION OF DTMF (DUAL TONE MULTIPLE FREQUENCY) SIGNALS
Aim: -To write a MATLAB program for generation of DTMF signals.
Software used: -MATLAB 7.5
Program: %% Clearing and closing commands
clc
clear all
close all
%% Program
number=['9177857260','s'];
fs=8192;
T=0.5;
x=2*pi*[697,770,852,941];
y=2*pi*[1209,1336,1477];
t=[0:1/fs:T]';
tx=[sin(x(1)*t),sin(x(2)*t),sin(x(3)*t),sin(x(4)*t)]/2;
ty=[sin(y(1)*t),sin(y(2)*t),sin(y(3)*t)]/2;
for k=1:length(number)
switch number(k)
case'1'
tone=tx(:,1)+ty(:,1);
%
sound(tone);
stem(tone);
xlabel('No of Samples');
ylabel('Amplitude');
title('Dual Tone Multiple Frequency');
case'2'
tone=tx(:,1)+ty(:,2);
%
sound(tone);
stem(tone);
xlabel('No of Samples');
ylabel('Amplitude');
17
PPDCET_ECE_SSP
case'3'
tone=tx(:,1)+ty(:,3);
%
sound(tone);
stem(tone);
xlabel('No of Samples');
ylabel('Amplitude');
title('Dual Tone Multiple Frequency');
case'4'
tone=tx(:,2)+ty(:,1);
%
sound(tone);
stem(tone);
xlabel('No of Samples');
ylabel('Amplitude');
title('Dual Tone Multiple Frequency');
case'5'
tone=tx(:,2)+ty(:,2);
%
sound(tone);
stem(tone);
xlabel('No of Samples');
ylabel('Amplitude');
title('Dual Tone Multiple Frequency');
case'6'
tone=tx(:,2)+ty(:,3);
%
sound(tone);
stem(tone);
xlabel('No of Samples');
ylabel('Amplitude');
title('Dual Tone Multiple Frequency');
case'7'
tone=tx(:,3)+ty(:,1);
18
PPDCET_ECE_SSP
sound(tone);
stem(tone);
xlabel('No of Samples');
ylabel('Amplitude');
title('Dual Tone Multiple Frequency');
case'8'
tone=tx(:,3)+ty(:,2);
%
sound(tone);
stem(tone);
xlabel('No of Samples');
ylabel('Amplitude');
title('Dual Tone Multiple Frequency');
case'9'
tone=tx(:,3)+ty(:,3);
%
sound(tone);
stem(tone);
xlabel('No of Samples');
ylabel('Amplitude');
title('Dual Tone Multiple Frequency');
case'*'
tone=tx(:,4)+ty(:,1);
%
sound(tone);
stem(tone);
xlabel('No of Samples');
ylabel('Amplitude');
title('Dual Tone Multiple Frequency');
case'0'
tone=tx(:,4)+ty(:,2);
%
sound(tone);
stem(tone);
xlabel('No of Samples');
ylabel('Amplitude');
19
PPDCET_ECE_SSP
case'#'
tone=tx(:,4)+ty(:,3);
%
sound(tone);
stem(tone);
xlabel('No of Samples');
ylabel('Amplitude');
title('Dual Tone Multiple Frequency');
otherwise
disp('invalid number');
end;
pause(0.75);
end;
Result: -Hence the above DTMF signals has been generated and plotted using MATLAB
Output: -
20
PPDCET_ECE_SSP
EXPERIMENT NO.5
ESTIMATE THE PSD OF A NOISY SIGNAL USING PERIODOGRAM AND MODIFIED
PERIODOGRAM
Aim: -To write a MATLAB program to find out PSD using PERIODOGRAM and MODIFIED
PERIODOGRAM.
Software used: -MATLAB 7.5
Program: %% Clearing and closing commands
clc
clear all
close all
%% Declaring inputs
f1=1000;
f2=2000;
fs=4000;
%% Program for PERIODOGRAM
t=0:1/fs:1;
x=2*sin(2*pi*f1*t)+3*sin(2*pi*f2*t)+rand(size(t));
pxx1=abs(fft(x).^2);
pxx2=abs(fft(xcorr(x),length(t)));
subplot(2,1,1)
plot(t*fs,10*log10(pxx1));
xlabel('Frequency in Hertz:')
ylabel('Power in db:')
title('PSD using SQUARE MAGNITUDE METHOD')
subplot(2,1,2)
plot(t*fs,10*log10(pxx2));
xlabel('Frequency in Hertz:')
ylabel('Power in db:')
title('PSD using AUTOCORRELATION METHOD')
21
PPDCET_ECE_SSP
subplot(2,1,1)
plot(n*fs,10*log10(y))
xlabel('Frequency in Hertz:')
ylabel('Magnitude in db:')
title('PSD using SQUARE MAGNITUDE METHOD');
w=hanning(N);
u=0;
for i=1:N;
u=u+(w(i).^2);
end
for i=1:N;
y1=[abs(fft(x).^2)*w(i).^2]/(u*N);
end
subplot(2,1,2)
plot(n*fs,10*log10(y1))
xlabel('Frequency in Hertz:')
ylabel('Magnitude in db:')
title('PSD using HANNING WINDOW');
Result: -Hence the estimation of PSD using PERIODOGRAM and MODIFIED PERIODOGRAM
has been verified using MATLAB
22
PPDCET_ECE_SSP
Outputs: - Periodogram
Modified Periodogram
23
PPDCET_ECE_SSP
EXPERIMENT NO.6
ESTIMATION OF POWER SPECTRUM USING BARTLETT AND WELCH METHODS
Aim: -To write a MATLAB program to estimate power spectrum using BARTLETT and WELCH
method.
Software used: -MATLAB 7.5
Program: %% Clearing and Closing commands
clc
clear all
close all
%% Declaring Inputs
fs=2000;
f1=200;
f2=400;
M=128;
Program for BARTLETT METHOD:
t=0:1/fs:1;
x=2*sin(2*pi*f1*t)+2*sin(2*pi*f2*t)+rand(size(t));
L=length(x);
K=L/M;
y1=[];
for i=1:M:L-M
y2=abs(fft(x(i:i+M)).^2);
y1=[y1;y2];
end
y3=sum(y1);
w1=y3/K;
w12=10*log(w1);
fs1=(fs/K)+2;
t1=((1:fs1)/fs1);
plot(t1,w12)
xlabel('Normalized Frequency')
ylabel('PSD')
title('BARTLETT METHOD of Power Spectral Estimation');
24
PPDCET_ECE_SSP
Result: -Hence the estimation of PSD using BARTLETT and WELCH method has been verified
using MATLAB
25
PPDCET_ECE_SSP
Welch Method
26
PPDCET_ECE_SSP
EXPERIMENT NO.7
ESTIMATION OF POWER SPECTRUM USING PARAMETRIC METHODS
(YULE-WALKER & BURG)
Aim:-To write a MATLAB program to estimate power spectrum using Power Spectrum using
YULE-WALKER and BURG method.
Software used: -MATLAB 7.5
Program: %% Clearing and Closing commands
clc
clear all
close all
Program for BURG method:
a=[1 -2.2137 2.9408 -2.1697 0.9609];
randn('state',1);
x=filter(1,a,randn(256,1));
pburg(x,4);
xlabel('Normalized Frequency');
ylabel('Power Sectrum in db');
title('BURG method of Power Spectrum Estimation');
Result: -Hence the estimation of PSD using YULE-WALKER and BURG method has been
verified using MATLAB
27
PPDCET_ECE_SSP
28
PPDCET_ECE_SSP
EXPERIMENT NO.8
DESIGN OF LPC FILTER USING LEVINSON-DURBIN ALGORITHM
Aim: -To write a MATLAB program to Design of LPC filter using LEVINSON-DURBIN Algorithm.
Software used: -MATLAB 7.5
Program: %% Clearing and Closing commands
clc
clear all
close all
%% Program
t=0:1023;
fs=1000;
x=sin(2*pi*50/fs*t)+sin(2*pi*120/fs*t);
y=x+rand(size(t));
p=10;
[a,g]=lpc(y,p);
a;
stem(a)
xlabel('Sequence ');
ylabel('Amplitude');
title('LPC filter coefficients');
Result: -Hence the Design of LPC filter using LEVINSON-DURBIN Algorithm has been verified
using MATLAB
29
PPDCET_ECE_SSP
Output: -
30
PPDCET_ECE_SSP