SlideShare a Scribd company logo
1 of 20
A
Practical Report
on

DIGITAL SIGNAL PROCESSING
&
CONTROL SYSTEM
Under MATLAB Environment

Submitted To:
Mr. Asim Ali Khan
Associate Professor
Mr. Manpreet Singh Manna
Associate Professor

Submitted By:
Paramjeet Singh Jamwal
PG/ICE/136321
M.Tech
First Semester

DEPARTMENT OF ELECTRICAL AND INSTRUMENTATION ENGINEERING
SANT LONGOWAL INSTITUTE OF ENGINEERING & TECHNOLOGY
LONGOWAL - 148106
JAN 2014
1|Page

info4eee | MATLAB
S.No.
1.
2.
3.
4.
5.
6.
7.

Command
Clc
clear all
close all
zeros(N)
zeros(M,N)
ones(N)
ones(M,N)

8.

subplot(m,n,p)

9.

stem(y)

10.
11.
12.

stem(x,y)
xlabel(‘text’)
ylabel(‘text’)
Input(‘How many
assignments’)
sum(A)
prod(A)
mean(A)
length(A)
inv(A)
A’
rand(N)
rand(N,M)
magic(N)

13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.

max(A)
min(A)

Function
Clear command window and homes the cursors
Removes all variables, globals, functions and MEX links.
Closes all the open figure windows.
An N-by-N matrix of zeros.
An M-by-N matrix of zeros.
An N-by-N matrix of ones.
An M-by-N matrix of ones.
Breaks the Figure window into an m-by-n matrix of small
axes, selects the p-th axes for the current plot, and returns the
axis handle.
Plots the data sequence y as stems from the x axis terminated
with circles for the data value. If y is a matrix then each
column is plotted as a separate series.
Plots the data sequence y at the values specified in x.
Adds text beside the x-axis on the current axis.
Adds text beside the y-axis on the current axis.
To get user defined value
To find sum of matrix ‘A’ column wise.
To find product of ‘A’(column wise).
Find mean of ‘A’.
To find length of matrix ‘A’.
To find inverse of matrix ‘A’ if possible.
It gives transpose of matrix ‘A’.
It generates N-N random matrix.
It generates N-M random matrix.
It generates N-N matrix whose sum of all rows and columns
are equal.
It shows largest element present in each column.
It shows smallest element present in each column.

2|Page

info4eee | MATLAB
1. Write a program to generate unit step signal.
Program:
n=input('enter lowest index= ');
m=input('enter highest index= ');
t=n:m;
x=ones(1,m-n+1);
stem(t,x);
axis([n m 0 1.5]);
title('Unit Step Signal')
xlabel('Value of n')
ylabel('Amplitude')

Command Window:
>> psj_unitstep
enter lowest index= 7
enter highest index= 17
Figure Window:

3|Page

info4eee | MATLAB
2. Write a program to generate ramp signal.
Program:
n=input('enter lowest index= ');
m=input('enter highest index= ');
t=n:m;
x=0:m-n;
stem(t,x);
axis([n m 0 m-n+1]);
title('Unit Ramp Signal')
xlabel('Value of n')
ylabel('Amplitude')

Command Window:
>> psj_unitramp
enter lowest index= 7
enter highest index= 17
Figure Window:

4|Page

info4eee | MATLAB
3. Write a program to generate unit impulse signal.
Program:
n=input('enter the value of impluse point= ');
t=n-2:n+2;
x=[zeros(1,2) ones(1,1) zeros(1,2)];
stem(t,x);
axis([n-2 n+2 0 1.5]);
title('Unit Impulse Signal')
xlabel('Value of n')
ylabel('Amplitude')

Command Window:
>> psj_unitimpulse
enter the value of impluse point= 7
Figure Window:

5|Page

info4eee | MATLAB
4. Write a program to find the convolution of two numbers.
Program:
x=input('Enter the value of x= ');
h=input('Enter the value of h= ');
lx=length(x);
lh=length(h);
z(1,1:lx+lh-1)=zeros;
l=max(lx,lh);
for i=1:l
y(1,2*i-1)=x(1,i)*h(1,i);
z(1,2*i-1)=z(1,2*i-1)+y(1,2*i-1);
end
for j=2:l
for i=j:l
y(1,2*i-j)=x(1,i)*h(1,i-j+1)+x(1,i-j+1)*h(1,i);
z(1,2*i-j)=z(1,2*i-j)+y(1,2*i-j);
end
end
disp('The Convolution of x & h is');
z

Command Window:
>> psj_convolution
Enter the value of x= [2,-1,0,0,1,0,-1]
Enter the value of h= [1,2,2,1,0,-1,0]
The Convolution of x & h is
z=
2

3

2

0

0

0

2

-1

-2

-2

0

1

0

6|Page

info4eee | MATLAB
5. Write a program to generate cosine wave of different amplitude.
Program:
t=0:0.01:10;
c1=0.5*cos(2*pi*t);
c2=cos(4*pi*t);
c3=(2/3)*cos(6*pi*t);
c=1+c1+c2+c3;
subplot(4,1,1),plot(t,c1);
xlabel('time axis----->'),ylabel('Amplitude----->');
axis([0 10 -0.7 0.7]);
title('0.5*cos(2*pi*t)')
subplot(4,1,2),plot(t,c2);
xlabel('time axis----->'),ylabel('Amplitude----->');
title('cos(4*pi*t)')
axis([0 10 -1.2 1.2]);
subplot(4,1,3),plot(t,c3);
xlabel('time axis----->'),ylabel('Amplitude----->');
title('(2/3)*cos(6*pi*t)')
subplot(4,1,4),plot(t,c);
xlabel('time axis----->'),ylabel('Amplitude of c----->');
title('1+0.5*cos(2*pi*t)+cos(4*pi*t)+(2/3)*cos(6*pi*t)')

Command Window:
>> psj_cosine

7|Page

info4eee | MATLAB
Figure Window:

8|Page

info4eee | MATLAB
6. Inbuilt function for Fourier transform in MATLAB.
S.No.

Command
FFT(X)

1.
FFT(X,N)
FFT(X,N,DIM)
FFT2(X)

2.
FFT2(X,MROWS,NCOLS)

FFTN(X)

3.
FFTN(X,SIZ)

IFFT(X)
IFFT(X,N)
IFFT(X,N,DIM)

4.
IFFT(..., 'symmetric')

IFFT(..., 'nonsymmetric')

IFFT2(F)

IFFT2(F,MROWS,NCOLS)

5.
IFFT2(..., 'symmetric')

IFFT2(..., 'nonsymmetric')

IFFTN(F)

6.
IFFTN(F,SIZ)

Function
Discrete Fourier transform (DFT) of vector X. For
matrices, the FFT operation is applied to each
column. For N-D arrays, the FFT operation operates
on the first non-singleton dimension.
N-point FFT padded with zeros if X has less than N
points and truncated if it has more.
FFT operation across the dimension DIMs.
Two-dimensional Fourier transform of matrix X. If
X is a vector, the result will have the same
orientation.
Pads matrix X with zeros to size MROWS-byNCOLS before transforming.
N-dimensional discrete Fourier transform of the N-D
array X. If X is a vector, the output will have the
same orientation.
Pads X so that its size vector is SIZ before
performing the transform. If any element of SIZ is
smaller than the corresponding dimension of X, then
X will be cropped in that dimension.
Inverse discrete Fourier transform of X.
N-point inverse transform.
Inverse discrete Fourier transform of X across the
dimension DIM.
IFFT to treat X as conjugate symmetric along the
active dimension. This option is useful when X is
not exactly
conjugate symmetric merely because of round-off
error.
IFFT to make no assumptions about the symmetry of
X.
Two-dimensional inverse Fourier transform of
matrix F. If F is a vector, the result will have the
same orientation.
Pads matrix F with zeros to size MROWS-byNCOLS before transforming.
IFFT2 to treat F as conjugate symmetric in two
dimensions so that the output is purely real. This
option is useful when F is not exactly conjugate
symmetric merely because of round-off error.
IFFT2 to make no assumptions about the symmetry
of F.
N-dimensional inverse discrete Fourier transform of
the N-D array F. If F is a vector, the result will have
the same orientation.
Pads F so that its size vector is SIZ before
performing the transform. If any element of SIZ is
9|Page

info4eee | MATLAB
IFFTN(..., 'symmetric')

IFFTN(..., 'nonsymmetric')

7.

DFTMTX(N)

CONJ(DFTMTX(N))/N

S = SPECTROGRAM(X)

S = SPECTROGRAM(X,WINDOW)

8.
S=
SPECTROGRAM(X,WINDOW,NOV
ERLAP)

S=
SPECTROGRAM(X,WINDOW,NOV
ERLAP,NFFT)
S=
SPECTROGRAM(X,WINDOW,NOV
ERLAP,NFFT,Fs)

[S,F,T] = SPECTROGRAM(...)

[S,F,T] =

smaller than the corresponding dimension of F, then
F will be cropped in that dimension.
IFFTN to treat F as multidimensionally conjugate
symmetric so that the output is purely real. This
option is useful when F is not exactly conjugate
symmetric merely because of round-off error.
IFFTN to make no assumptions about the symmetry
of F.
N-by-N complex matrix of values around the unitcircle whose inner product with a column vector of
length N yields the discrete Fourier transform of the
vector. If X is a column vector of length N, then
DFTMTX(N)*X yields the same result as FFT(X);
however, FFT(X) is more efficient.
The inverse discrete Fourier transform matrix.
Spectrogram of the signal specified by vector X in
the matrix S. By default, X is divided into eight
segment with 50% overlap, each segment is
windowed with a Hamming window. The number of
frequency points used to calculate the discrete
Fourier transforms is equal to the maximum of 256
or the next power of two greater than the length of
each segment of X. If X cannot be divided exactly
into eight segments, X will be truncated accordingly.
when WINDOW is a vector, divides X into
segments of length equal to the length of WINDOW,
and then windows each segment with the vector
specified in WINDOW. If WINDOW is an integer,
X is divided into segments of length equal to that
integer value, and a Hamming window of equal
length is used. If WINDOW is not specified, the
default is used.
the number of samples each segment of X overlaps.
NOVERLAP must be an integer smaller than
WINDOW if WINDOW is an integer. NOVERLAP
must be an integer smaller than the length of
WINDOW if WINDOW is a vector.
If
NOVERLAP is not specified, the default value is
used to obtain a 50% overlap.
specifies the number of frequency points used to
calculate the discrete Fourier transforms. If NFFT is
not specified, the default NFFT is used.
Fs is the sampling frequency specified in Hz. If Fs is
specified as empty, it defaults to 1 Hz. If it is not
specified, normalized frequency is used.
a vector of frequencies F and a vector of times T at
which the spectrogram is computed. F has length
equal to the number of rows of S. T has length k and
its value corresponds to the center of each segment.
where F is a vector of frequencies in Hz computes
10 | P a g e

info4eee | MATLAB
SPECTROGRAM(X,WINDOW,NOV
ERLAP,F,Fs)

[S,F,T,P] = SPECTROGRAM(...)

SPECTROGRAM(...)

9.

[X,T] =
INSTDFFT(XHAT,LOWB,UPPB)

10

[XHAT,OMEGA] =
NSTDFFT(X,LOWB,UPPB)

the spectrogram at those frequencies using the
Goertzel algorithm. The specified frequencies in F
are rounded to the nearest DFT bin commensurate
with the signal's resolution.
P is a matrix representing the Power Spectral
Density (PSD) of each segment. For real signals,
SPECTROGRAM returns the one-sided modified
periodogram estimate of the PSD of each segment;
for complex signals and in the case when a vector of
frequencies is specified, it returns the two-sided
PSD.
The PSD estimate for each segment on a surface in
the current figure with no output arguments. It uses
SURF(f,t,10*log10(abs(P)) where P is the fourth
output argument. A trailing input string,
FREQLOCATION, controls where MATLAB
displays the frequency axis. This string can be either
'xaxis' or 'yaxis'. Setting this FREQLOCATION to
'yaxis' displays frequency on the y-axis and time on
the x-axis. The default is 'xaxis' which displays the
frequency on the x-axis. If FREQLOCATION is
specified when output arguments are requested, it is
ignored.
the inverse nonstandard FFT of XHAT, on a powerof-2 regular grid (non necessarily integers) on the
interval [LOWB,UPPB]. Output arguments are X
the recovered signal computed on the time interval T
given by T = LOWB + [0:n-1]*(UPPB-LOWB)/n,
where n is the length of XHAT. Outputs are vectors
of length n. The length of XHAT must be a power of
2.
a nonstandard FFT of signal X sampled on a powerof-2 regular grid (non necessarily integers) on the
interval [LOWB,UPPB]. Output arguments are
XHAT the shifted FFT of computed on the interval
OMEGA given by OMEGA = [-n:2:n-2]/(2*(UPPBLOWB)) where n is the length of X. Outputs are
vectors of length n. Length of X must be a power of
2.

11 | P a g e

info4eee | MATLAB
7. Write a program to find the Fourier transform of cosine function.
Program:
t=0:0.01:10;
x=cos(2*pi*t);
y=fft(x);
z=ifft(y);
subplot(3,1,1);
plot(x);
title('Cosine Wave')
subplot(3,1,2);
plot(y);
title('FFT of Cosine Wave')
subplot(3,1,3);
plot(z);
title('IFFT')

Command Window:
>> psj_fourier
Figure Window:

12 | P a g e

info4eee | MATLAB
8. Write a program to find the DFT of given sequence.
Program:
h=input('enter sequence= ');
N=input('enter N=');
n=length(h);
x=[h,zeros(1,N-n)];
y=zeros(N,1);
for k=1:N,
for n=1:N,
y(k)=y(k)+x(n)*exp(-i*2*pi*(k-1)*(n-1)/N);
end
end
disp('DFT of x=');
y

Command Window:
>> psj_dft
enter sequence= [1 2 4 8 16 32 64 128]
enter N=8
DFT of x=
y=
1.0e+002 *
2.5500
0.4864 + 1.6607i
-0.5100 + 1.0200i
-0.7864 + 0.4607i
-0.8500 - 0.0000i
-0.7864 - 0.4607i
-0.5100 - 1.0200i
0.4864 - 1.6607i

13 | P a g e

info4eee | MATLAB
9. Write a program to find the IDFT of given sequence.
Program:
h=input('enter sequence = ');
N=input('enter N = ');
n=length(x);
x=[h,zeros(1,N-n)];
y=zeros(N,1);
for n=1:N,
for k=1:N,
y(k)=y(k)+(1/N)*x(n)*exp(i*2*pi*(k-1)*(n-1)/N);
end
end
disp('IDFT of Sequence = ');
y

Command Window:
>> psj_idft
enter sequence = [36 -4+9.656i -4+4i -4+1.656i -4 -4-1.656i -4-4i -4-9.656i]
enter N = 8
IDFT of Sequence =
y=
1.0000
2.0003 + 0.0000i
3.0000 + 0.0000i
4.0003
5.0000 - 0.0000i
5.9997 - 0.0000i
7.0000 + 0.0000i
7.9997 - 0.0000i

14 | P a g e

info4eee | MATLAB
10. Write a program to find the DFT of given sequence using matrix.
Program:
x=input('Enter the sequence = ');
n=length(x);
w=dftmtx(n);
y=[w*x'];
w;
disp('DFT of Sequence');
y

Command Window:
>> psj_dftumtx
Enter the sequence = [1 2 3 4 4 3 2 1]
DFT of Sequence
y=
20.0000
-5.8284 - 2.4142i
0
-0.1716 - 0.4142i
0
-0.1716 + 0.4142i
0
-5.8284 + 2.4142

15 | P a g e

info4eee | MATLAB
11. Write a program to find the IDFT using matrix.
Program:
x=input('enter the sequence = ');
n=length(x);
w=conj(dftmtx(n))/n;
y=[inv(w)*x']/n;
w;
disp('IDFT of Sequence');
y

Command Window:
>> psj_idftumtx
enter the sequence = [36 -4+9.656i -4+4i -4+1.656i -4 -4-1.656i -4-4i -49.656i]
IDFT of Sequence
y=
1.0000 + 0.0000i
2.0003 + 0.0000i
3.0000 - 0.0000i
4.0003 - 0.0000i
5.0000 + 0.0000i
5.9997 + 0.0000i
7.0000 - 0.0000i
7.9997 + 0.0000i

16 | P a g e

info4eee | MATLAB
12. Write a program to generate DFT Matrix without using direct command.
Program:
N=input('Enter the value of N = ');
x=zeros(N,N);
for j=1:N,
n=N*(j-1);
for k=1:N,
x(k+n)=exp(-i*2*pi*(j-1)*(k-1)/N);
end
end
disp('Resultant matrix ');
x

Command Window:
>> psj_dftmtx
Enter the value of N = 4
Resultant matrix
x=
1.0000
1.0000
1.0000
1.0000

1.0000
0.0000 - 1.0000i
-1.0000 - 0.0000i
-0.0000 + 1.0000i

1.0000
-1.0000 - 0.0000i
1.0000 + 0.0000i
-1.0000 - 0.0000i

1.0000
-0.0000 + 1.0000i
-1.0000 - 0.0000i
0.0000 - 1.0000i

17 | P a g e

info4eee | MATLAB
13. Write a program to find the step response and impulse response of transfer
function.
Program:
sys=tf([8 18 31],[1 6 14 24])
subplot(2,1,1)
step(sys)
subplot(2,1,2)
impulse(sys)

Command Window:
>> psj_sni
Transfer function:
8 s^2 + 18 s + 31
----------------------s^3 + 6 s^2 + 14 s + 24
Figure Window:

18 | P a g e

info4eee | MATLAB
14. Design a system to convert Fahrenheit to degree Celsius.
Setup:

19 | P a g e

info4eee | MATLAB
15. Design a system for torque converter.
Setup:

-------------------------------------A

Group
--------------------------------------

20 | P a g e

info4eee | MATLAB

More Related Content

What's hot

Effects of varying number of samples in an image
Effects of varying number of samples in an imageEffects of varying number of samples in an image
Effects of varying number of samples in an imagelakshmymk
 
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)Ravikiran A
 
Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual Jitendra Jangid
 
digital signal-processing-lab-manual
digital signal-processing-lab-manualdigital signal-processing-lab-manual
digital signal-processing-lab-manualAhmed Alshomi
 
Discreate time system and z transform
Discreate time system and z transformDiscreate time system and z transform
Discreate time system and z transformVIKAS KUMAR MANJHI
 
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier AnalysisDSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier AnalysisAmr E. Mohamed
 
Lti and z transform
Lti and z transformLti and z transform
Lti and z transformpranvendra29
 
Digital Signal Processing
Digital Signal ProcessingDigital Signal Processing
Digital Signal ProcessingSandip Ladi
 
Z Transform And Inverse Z Transform - Signal And Systems
Z Transform And Inverse Z Transform - Signal And SystemsZ Transform And Inverse Z Transform - Signal And Systems
Z Transform And Inverse Z Transform - Signal And SystemsMr. RahüL YøGi
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Amairullah Khan Lodhi
 
DSP, Differences between Fourier series ,Fourier Transform and Z transform
DSP, Differences between  Fourier series ,Fourier Transform and Z transform DSP, Differences between  Fourier series ,Fourier Transform and Z transform
DSP, Differences between Fourier series ,Fourier Transform and Z transform Naresh Biloniya
 

What's hot (20)

Effects of varying number of samples in an image
Effects of varying number of samples in an imageEffects of varying number of samples in an image
Effects of varying number of samples in an image
 
Z Transform
Z TransformZ Transform
Z Transform
 
Analog properties and Z-transform
Analog properties and Z-transformAnalog properties and Z-transform
Analog properties and Z-transform
 
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
 
Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual
 
z transforms
z transformsz transforms
z transforms
 
Digital Signal Processing Assignment Help
Digital Signal Processing Assignment HelpDigital Signal Processing Assignment Help
Digital Signal Processing Assignment Help
 
digital signal-processing-lab-manual
digital signal-processing-lab-manualdigital signal-processing-lab-manual
digital signal-processing-lab-manual
 
Discreate time system and z transform
Discreate time system and z transformDiscreate time system and z transform
Discreate time system and z transform
 
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier AnalysisDSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
 
Lti and z transform
Lti and z transformLti and z transform
Lti and z transform
 
DSP Mat Lab
DSP Mat LabDSP Mat Lab
DSP Mat Lab
 
Z transform Day 1
Z transform Day 1Z transform Day 1
Z transform Day 1
 
Digital Signal Processing
Digital Signal ProcessingDigital Signal Processing
Digital Signal Processing
 
Z Transform And Inverse Z Transform - Signal And Systems
Z Transform And Inverse Z Transform - Signal And SystemsZ Transform And Inverse Z Transform - Signal And Systems
Z Transform And Inverse Z Transform - Signal And Systems
 
Matlab programs
Matlab programsMatlab programs
Matlab programs
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual
 
L23 315 f11
L23 315 f11L23 315 f11
L23 315 f11
 
DSP, Differences between Fourier series ,Fourier Transform and Z transform
DSP, Differences between  Fourier series ,Fourier Transform and Z transform DSP, Differences between  Fourier series ,Fourier Transform and Z transform
DSP, Differences between Fourier series ,Fourier Transform and Z transform
 
Vocabulary
VocabularyVocabulary
Vocabulary
 

Similar to Digital Signal Processing and Control System under MATLAB Environment

Dsp 1recordprophess-140720055832-phpapp01
Dsp 1recordprophess-140720055832-phpapp01Dsp 1recordprophess-140720055832-phpapp01
Dsp 1recordprophess-140720055832-phpapp01Sagar Gore
 
Programmable PN Sequence Generators
Programmable PN Sequence GeneratorsProgrammable PN Sequence Generators
Programmable PN Sequence GeneratorsRajesh Singh
 
Exponential-plus-Constant Fitting based on Fourier Analysis
Exponential-plus-Constant Fitting based on Fourier AnalysisExponential-plus-Constant Fitting based on Fourier Analysis
Exponential-plus-Constant Fitting based on Fourier AnalysisMatthieu Hodgkinson
 
Digital Signal Processing
Digital Signal ProcessingDigital Signal Processing
Digital Signal ProcessingPRABHAHARAN429
 
H infinity optimal_approximation_for_cau
H infinity optimal_approximation_for_cauH infinity optimal_approximation_for_cau
H infinity optimal_approximation_for_cauAl Vc
 
B02110105012
B02110105012B02110105012
B02110105012theijes
 
The International Journal of Engineering and Science (The IJES)
 The International Journal of Engineering and Science (The IJES) The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)theijes
 
Matlab cheatsheet
Matlab cheatsheetMatlab cheatsheet
Matlab cheatsheetlokeshkumer
 
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)Amr E. Mohamed
 
Fourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_14.ppt
Fourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_14.pptFourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_14.ppt
Fourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_14.pptMozammelHossain31
 
Fourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_13.ppt
Fourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_13.pptFourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_13.ppt
Fourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_13.pptMozammelHossain31
 
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoidFourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoidXavier Davias
 
multi threaded and distributed algorithms
multi threaded and distributed algorithms multi threaded and distributed algorithms
multi threaded and distributed algorithms Dr Shashikant Athawale
 
Big Data Analysis with Signal Processing on Graphs
Big Data Analysis with Signal Processing on GraphsBig Data Analysis with Signal Processing on Graphs
Big Data Analysis with Signal Processing on GraphsMohamed Seif
 

Similar to Digital Signal Processing and Control System under MATLAB Environment (20)

Dsp 1recordprophess-140720055832-phpapp01
Dsp 1recordprophess-140720055832-phpapp01Dsp 1recordprophess-140720055832-phpapp01
Dsp 1recordprophess-140720055832-phpapp01
 
Dsp manual
Dsp manualDsp manual
Dsp manual
 
Programmable PN Sequence Generators
Programmable PN Sequence GeneratorsProgrammable PN Sequence Generators
Programmable PN Sequence Generators
 
Exponential-plus-Constant Fitting based on Fourier Analysis
Exponential-plus-Constant Fitting based on Fourier AnalysisExponential-plus-Constant Fitting based on Fourier Analysis
Exponential-plus-Constant Fitting based on Fourier Analysis
 
Digital Signal Processing
Digital Signal ProcessingDigital Signal Processing
Digital Signal Processing
 
5 numerical analysis
5 numerical analysis5 numerical analysis
5 numerical analysis
 
H infinity optimal_approximation_for_cau
H infinity optimal_approximation_for_cauH infinity optimal_approximation_for_cau
H infinity optimal_approximation_for_cau
 
B02110105012
B02110105012B02110105012
B02110105012
 
The International Journal of Engineering and Science (The IJES)
 The International Journal of Engineering and Science (The IJES) The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
 
Nc2421532161
Nc2421532161Nc2421532161
Nc2421532161
 
Matlab cheatsheet
Matlab cheatsheetMatlab cheatsheet
Matlab cheatsheet
 
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)
 
Fourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_14.ppt
Fourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_14.pptFourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_14.ppt
Fourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_14.ppt
 
Fourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_13.ppt
Fourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_13.pptFourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_13.ppt
Fourier-Series_FT_Laplace-Transform_Letures_Regular_F-for-Students_13.ppt
 
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoidFourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
Fourier transforms & fft algorithm (paul heckbert, 1998) by tantanoid
 
Dsp Lab Record
Dsp Lab RecordDsp Lab Record
Dsp Lab Record
 
multi threaded and distributed algorithms
multi threaded and distributed algorithms multi threaded and distributed algorithms
multi threaded and distributed algorithms
 
Dsp file
Dsp fileDsp file
Dsp file
 
Assignment 2 solution acs
Assignment 2 solution acsAssignment 2 solution acs
Assignment 2 solution acs
 
Big Data Analysis with Signal Processing on Graphs
Big Data Analysis with Signal Processing on GraphsBig Data Analysis with Signal Processing on Graphs
Big Data Analysis with Signal Processing on Graphs
 

More from Paramjeet Singh Jamwal

Fundamentals of Electric Drives - Electric Drives
Fundamentals of Electric Drives - Electric DrivesFundamentals of Electric Drives - Electric Drives
Fundamentals of Electric Drives - Electric DrivesParamjeet Singh Jamwal
 
DC Network Theory - Basic Electrical Engineering
DC Network Theory - Basic Electrical EngineeringDC Network Theory - Basic Electrical Engineering
DC Network Theory - Basic Electrical EngineeringParamjeet Singh Jamwal
 
Virtual Instrumentation and Data Acquisition - PGICE - 2013
Virtual Instrumentation and Data Acquisition - PGICE - 2013Virtual Instrumentation and Data Acquisition - PGICE - 2013
Virtual Instrumentation and Data Acquisition - PGICE - 2013Paramjeet Singh Jamwal
 
Reliability Engineering - PGICE - 2013
Reliability Engineering - PGICE - 2013Reliability Engineering - PGICE - 2013
Reliability Engineering - PGICE - 2013Paramjeet Singh Jamwal
 
Reliability Engineering - PGICE - 2012
Reliability Engineering - PGICE - 2012Reliability Engineering - PGICE - 2012
Reliability Engineering - PGICE - 2012Paramjeet Singh Jamwal
 
Introduction to Filters under labVIEW Environment
Introduction to Filters under labVIEW EnvironmentIntroduction to Filters under labVIEW Environment
Introduction to Filters under labVIEW EnvironmentParamjeet Singh Jamwal
 
Non Linear and Adaptive Control System JAN 2014
Non Linear and Adaptive Control System JAN 2014Non Linear and Adaptive Control System JAN 2014
Non Linear and Adaptive Control System JAN 2014Paramjeet Singh Jamwal
 
Microcontroller and Embedded System JAN 2014
Microcontroller and Embedded System JAN 2014Microcontroller and Embedded System JAN 2014
Microcontroller and Embedded System JAN 2014Paramjeet Singh Jamwal
 
Instrumentation System Design JAN 2014
Instrumentation System Design JAN 2014Instrumentation System Design JAN 2014
Instrumentation System Design JAN 2014Paramjeet Singh Jamwal
 
Instrumentation System Design | Assignment
Instrumentation System Design | AssignmentInstrumentation System Design | Assignment
Instrumentation System Design | AssignmentParamjeet Singh Jamwal
 
Introduction to toolbox under matlab environment
Introduction to toolbox under matlab environmentIntroduction to toolbox under matlab environment
Introduction to toolbox under matlab environmentParamjeet Singh Jamwal
 
Hydrology & Site Selection of Hydro Power Plant
Hydrology & Site Selection of Hydro Power PlantHydrology & Site Selection of Hydro Power Plant
Hydrology & Site Selection of Hydro Power PlantParamjeet Singh Jamwal
 

More from Paramjeet Singh Jamwal (20)

Introduction to MATLAB - I
Introduction to MATLAB - IIntroduction to MATLAB - I
Introduction to MATLAB - I
 
Fundamentals of Electric Drives - Electric Drives
Fundamentals of Electric Drives - Electric DrivesFundamentals of Electric Drives - Electric Drives
Fundamentals of Electric Drives - Electric Drives
 
DC Network Theory - Basic Electrical Engineering
DC Network Theory - Basic Electrical EngineeringDC Network Theory - Basic Electrical Engineering
DC Network Theory - Basic Electrical Engineering
 
Virtual Instrumentation and Data Acquisition - PGICE - 2013
Virtual Instrumentation and Data Acquisition - PGICE - 2013Virtual Instrumentation and Data Acquisition - PGICE - 2013
Virtual Instrumentation and Data Acquisition - PGICE - 2013
 
Reliability Engineering - PGICE - 2013
Reliability Engineering - PGICE - 2013Reliability Engineering - PGICE - 2013
Reliability Engineering - PGICE - 2013
 
Reliability Engineering - PGICE - 2012
Reliability Engineering - PGICE - 2012Reliability Engineering - PGICE - 2012
Reliability Engineering - PGICE - 2012
 
Introduction to Filters under labVIEW Environment
Introduction to Filters under labVIEW EnvironmentIntroduction to Filters under labVIEW Environment
Introduction to Filters under labVIEW Environment
 
Medical Image Compression
Medical Image CompressionMedical Image Compression
Medical Image Compression
 
Non Linear and Adaptive Control System JAN 2014
Non Linear and Adaptive Control System JAN 2014Non Linear and Adaptive Control System JAN 2014
Non Linear and Adaptive Control System JAN 2014
 
Microcontroller and Embedded System JAN 2014
Microcontroller and Embedded System JAN 2014Microcontroller and Embedded System JAN 2014
Microcontroller and Embedded System JAN 2014
 
Instrumentation System Design JAN 2014
Instrumentation System Design JAN 2014Instrumentation System Design JAN 2014
Instrumentation System Design JAN 2014
 
Instrumentation System Design | Assignment
Instrumentation System Design | AssignmentInstrumentation System Design | Assignment
Instrumentation System Design | Assignment
 
Digital signal processing JAN 2014
Digital signal processing JAN 2014Digital signal processing JAN 2014
Digital signal processing JAN 2014
 
Introduction to toolbox under matlab environment
Introduction to toolbox under matlab environmentIntroduction to toolbox under matlab environment
Introduction to toolbox under matlab environment
 
Cardiovascular System
Cardiovascular SystemCardiovascular System
Cardiovascular System
 
Image Compression
Image CompressionImage Compression
Image Compression
 
Hydrology & Site Selection of Hydro Power Plant
Hydrology & Site Selection of Hydro Power PlantHydrology & Site Selection of Hydro Power Plant
Hydrology & Site Selection of Hydro Power Plant
 
Electromagnetic Field Theory May 2013
Electromagnetic Field Theory May 2013Electromagnetic Field Theory May 2013
Electromagnetic Field Theory May 2013
 
Digital Image Processing May 2013
Digital Image Processing May 2013Digital Image Processing May 2013
Digital Image Processing May 2013
 
Basic Electrical Engineering May 2013
Basic Electrical Engineering May 2013Basic Electrical Engineering May 2013
Basic Electrical Engineering May 2013
 

Recently uploaded

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 

Recently uploaded (20)

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 

Digital Signal Processing and Control System under MATLAB Environment

  • 1. A Practical Report on DIGITAL SIGNAL PROCESSING & CONTROL SYSTEM Under MATLAB Environment Submitted To: Mr. Asim Ali Khan Associate Professor Mr. Manpreet Singh Manna Associate Professor Submitted By: Paramjeet Singh Jamwal PG/ICE/136321 M.Tech First Semester DEPARTMENT OF ELECTRICAL AND INSTRUMENTATION ENGINEERING SANT LONGOWAL INSTITUTE OF ENGINEERING & TECHNOLOGY LONGOWAL - 148106 JAN 2014 1|Page info4eee | MATLAB
  • 2. S.No. 1. 2. 3. 4. 5. 6. 7. Command Clc clear all close all zeros(N) zeros(M,N) ones(N) ones(M,N) 8. subplot(m,n,p) 9. stem(y) 10. 11. 12. stem(x,y) xlabel(‘text’) ylabel(‘text’) Input(‘How many assignments’) sum(A) prod(A) mean(A) length(A) inv(A) A’ rand(N) rand(N,M) magic(N) 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. max(A) min(A) Function Clear command window and homes the cursors Removes all variables, globals, functions and MEX links. Closes all the open figure windows. An N-by-N matrix of zeros. An M-by-N matrix of zeros. An N-by-N matrix of ones. An M-by-N matrix of ones. Breaks the Figure window into an m-by-n matrix of small axes, selects the p-th axes for the current plot, and returns the axis handle. Plots the data sequence y as stems from the x axis terminated with circles for the data value. If y is a matrix then each column is plotted as a separate series. Plots the data sequence y at the values specified in x. Adds text beside the x-axis on the current axis. Adds text beside the y-axis on the current axis. To get user defined value To find sum of matrix ‘A’ column wise. To find product of ‘A’(column wise). Find mean of ‘A’. To find length of matrix ‘A’. To find inverse of matrix ‘A’ if possible. It gives transpose of matrix ‘A’. It generates N-N random matrix. It generates N-M random matrix. It generates N-N matrix whose sum of all rows and columns are equal. It shows largest element present in each column. It shows smallest element present in each column. 2|Page info4eee | MATLAB
  • 3. 1. Write a program to generate unit step signal. Program: n=input('enter lowest index= '); m=input('enter highest index= '); t=n:m; x=ones(1,m-n+1); stem(t,x); axis([n m 0 1.5]); title('Unit Step Signal') xlabel('Value of n') ylabel('Amplitude') Command Window: >> psj_unitstep enter lowest index= 7 enter highest index= 17 Figure Window: 3|Page info4eee | MATLAB
  • 4. 2. Write a program to generate ramp signal. Program: n=input('enter lowest index= '); m=input('enter highest index= '); t=n:m; x=0:m-n; stem(t,x); axis([n m 0 m-n+1]); title('Unit Ramp Signal') xlabel('Value of n') ylabel('Amplitude') Command Window: >> psj_unitramp enter lowest index= 7 enter highest index= 17 Figure Window: 4|Page info4eee | MATLAB
  • 5. 3. Write a program to generate unit impulse signal. Program: n=input('enter the value of impluse point= '); t=n-2:n+2; x=[zeros(1,2) ones(1,1) zeros(1,2)]; stem(t,x); axis([n-2 n+2 0 1.5]); title('Unit Impulse Signal') xlabel('Value of n') ylabel('Amplitude') Command Window: >> psj_unitimpulse enter the value of impluse point= 7 Figure Window: 5|Page info4eee | MATLAB
  • 6. 4. Write a program to find the convolution of two numbers. Program: x=input('Enter the value of x= '); h=input('Enter the value of h= '); lx=length(x); lh=length(h); z(1,1:lx+lh-1)=zeros; l=max(lx,lh); for i=1:l y(1,2*i-1)=x(1,i)*h(1,i); z(1,2*i-1)=z(1,2*i-1)+y(1,2*i-1); end for j=2:l for i=j:l y(1,2*i-j)=x(1,i)*h(1,i-j+1)+x(1,i-j+1)*h(1,i); z(1,2*i-j)=z(1,2*i-j)+y(1,2*i-j); end end disp('The Convolution of x & h is'); z Command Window: >> psj_convolution Enter the value of x= [2,-1,0,0,1,0,-1] Enter the value of h= [1,2,2,1,0,-1,0] The Convolution of x & h is z= 2 3 2 0 0 0 2 -1 -2 -2 0 1 0 6|Page info4eee | MATLAB
  • 7. 5. Write a program to generate cosine wave of different amplitude. Program: t=0:0.01:10; c1=0.5*cos(2*pi*t); c2=cos(4*pi*t); c3=(2/3)*cos(6*pi*t); c=1+c1+c2+c3; subplot(4,1,1),plot(t,c1); xlabel('time axis----->'),ylabel('Amplitude----->'); axis([0 10 -0.7 0.7]); title('0.5*cos(2*pi*t)') subplot(4,1,2),plot(t,c2); xlabel('time axis----->'),ylabel('Amplitude----->'); title('cos(4*pi*t)') axis([0 10 -1.2 1.2]); subplot(4,1,3),plot(t,c3); xlabel('time axis----->'),ylabel('Amplitude----->'); title('(2/3)*cos(6*pi*t)') subplot(4,1,4),plot(t,c); xlabel('time axis----->'),ylabel('Amplitude of c----->'); title('1+0.5*cos(2*pi*t)+cos(4*pi*t)+(2/3)*cos(6*pi*t)') Command Window: >> psj_cosine 7|Page info4eee | MATLAB
  • 9. 6. Inbuilt function for Fourier transform in MATLAB. S.No. Command FFT(X) 1. FFT(X,N) FFT(X,N,DIM) FFT2(X) 2. FFT2(X,MROWS,NCOLS) FFTN(X) 3. FFTN(X,SIZ) IFFT(X) IFFT(X,N) IFFT(X,N,DIM) 4. IFFT(..., 'symmetric') IFFT(..., 'nonsymmetric') IFFT2(F) IFFT2(F,MROWS,NCOLS) 5. IFFT2(..., 'symmetric') IFFT2(..., 'nonsymmetric') IFFTN(F) 6. IFFTN(F,SIZ) Function Discrete Fourier transform (DFT) of vector X. For matrices, the FFT operation is applied to each column. For N-D arrays, the FFT operation operates on the first non-singleton dimension. N-point FFT padded with zeros if X has less than N points and truncated if it has more. FFT operation across the dimension DIMs. Two-dimensional Fourier transform of matrix X. If X is a vector, the result will have the same orientation. Pads matrix X with zeros to size MROWS-byNCOLS before transforming. N-dimensional discrete Fourier transform of the N-D array X. If X is a vector, the output will have the same orientation. Pads X so that its size vector is SIZ before performing the transform. If any element of SIZ is smaller than the corresponding dimension of X, then X will be cropped in that dimension. Inverse discrete Fourier transform of X. N-point inverse transform. Inverse discrete Fourier transform of X across the dimension DIM. IFFT to treat X as conjugate symmetric along the active dimension. This option is useful when X is not exactly conjugate symmetric merely because of round-off error. IFFT to make no assumptions about the symmetry of X. Two-dimensional inverse Fourier transform of matrix F. If F is a vector, the result will have the same orientation. Pads matrix F with zeros to size MROWS-byNCOLS before transforming. IFFT2 to treat F as conjugate symmetric in two dimensions so that the output is purely real. This option is useful when F is not exactly conjugate symmetric merely because of round-off error. IFFT2 to make no assumptions about the symmetry of F. N-dimensional inverse discrete Fourier transform of the N-D array F. If F is a vector, the result will have the same orientation. Pads F so that its size vector is SIZ before performing the transform. If any element of SIZ is 9|Page info4eee | MATLAB
  • 10. IFFTN(..., 'symmetric') IFFTN(..., 'nonsymmetric') 7. DFTMTX(N) CONJ(DFTMTX(N))/N S = SPECTROGRAM(X) S = SPECTROGRAM(X,WINDOW) 8. S= SPECTROGRAM(X,WINDOW,NOV ERLAP) S= SPECTROGRAM(X,WINDOW,NOV ERLAP,NFFT) S= SPECTROGRAM(X,WINDOW,NOV ERLAP,NFFT,Fs) [S,F,T] = SPECTROGRAM(...) [S,F,T] = smaller than the corresponding dimension of F, then F will be cropped in that dimension. IFFTN to treat F as multidimensionally conjugate symmetric so that the output is purely real. This option is useful when F is not exactly conjugate symmetric merely because of round-off error. IFFTN to make no assumptions about the symmetry of F. N-by-N complex matrix of values around the unitcircle whose inner product with a column vector of length N yields the discrete Fourier transform of the vector. If X is a column vector of length N, then DFTMTX(N)*X yields the same result as FFT(X); however, FFT(X) is more efficient. The inverse discrete Fourier transform matrix. Spectrogram of the signal specified by vector X in the matrix S. By default, X is divided into eight segment with 50% overlap, each segment is windowed with a Hamming window. The number of frequency points used to calculate the discrete Fourier transforms is equal to the maximum of 256 or the next power of two greater than the length of each segment of X. If X cannot be divided exactly into eight segments, X will be truncated accordingly. when WINDOW is a vector, divides X into segments of length equal to the length of WINDOW, and then windows each segment with the vector specified in WINDOW. If WINDOW is an integer, X is divided into segments of length equal to that integer value, and a Hamming window of equal length is used. If WINDOW is not specified, the default is used. the number of samples each segment of X overlaps. NOVERLAP must be an integer smaller than WINDOW if WINDOW is an integer. NOVERLAP must be an integer smaller than the length of WINDOW if WINDOW is a vector. If NOVERLAP is not specified, the default value is used to obtain a 50% overlap. specifies the number of frequency points used to calculate the discrete Fourier transforms. If NFFT is not specified, the default NFFT is used. Fs is the sampling frequency specified in Hz. If Fs is specified as empty, it defaults to 1 Hz. If it is not specified, normalized frequency is used. a vector of frequencies F and a vector of times T at which the spectrogram is computed. F has length equal to the number of rows of S. T has length k and its value corresponds to the center of each segment. where F is a vector of frequencies in Hz computes 10 | P a g e info4eee | MATLAB
  • 11. SPECTROGRAM(X,WINDOW,NOV ERLAP,F,Fs) [S,F,T,P] = SPECTROGRAM(...) SPECTROGRAM(...) 9. [X,T] = INSTDFFT(XHAT,LOWB,UPPB) 10 [XHAT,OMEGA] = NSTDFFT(X,LOWB,UPPB) the spectrogram at those frequencies using the Goertzel algorithm. The specified frequencies in F are rounded to the nearest DFT bin commensurate with the signal's resolution. P is a matrix representing the Power Spectral Density (PSD) of each segment. For real signals, SPECTROGRAM returns the one-sided modified periodogram estimate of the PSD of each segment; for complex signals and in the case when a vector of frequencies is specified, it returns the two-sided PSD. The PSD estimate for each segment on a surface in the current figure with no output arguments. It uses SURF(f,t,10*log10(abs(P)) where P is the fourth output argument. A trailing input string, FREQLOCATION, controls where MATLAB displays the frequency axis. This string can be either 'xaxis' or 'yaxis'. Setting this FREQLOCATION to 'yaxis' displays frequency on the y-axis and time on the x-axis. The default is 'xaxis' which displays the frequency on the x-axis. If FREQLOCATION is specified when output arguments are requested, it is ignored. the inverse nonstandard FFT of XHAT, on a powerof-2 regular grid (non necessarily integers) on the interval [LOWB,UPPB]. Output arguments are X the recovered signal computed on the time interval T given by T = LOWB + [0:n-1]*(UPPB-LOWB)/n, where n is the length of XHAT. Outputs are vectors of length n. The length of XHAT must be a power of 2. a nonstandard FFT of signal X sampled on a powerof-2 regular grid (non necessarily integers) on the interval [LOWB,UPPB]. Output arguments are XHAT the shifted FFT of computed on the interval OMEGA given by OMEGA = [-n:2:n-2]/(2*(UPPBLOWB)) where n is the length of X. Outputs are vectors of length n. Length of X must be a power of 2. 11 | P a g e info4eee | MATLAB
  • 12. 7. Write a program to find the Fourier transform of cosine function. Program: t=0:0.01:10; x=cos(2*pi*t); y=fft(x); z=ifft(y); subplot(3,1,1); plot(x); title('Cosine Wave') subplot(3,1,2); plot(y); title('FFT of Cosine Wave') subplot(3,1,3); plot(z); title('IFFT') Command Window: >> psj_fourier Figure Window: 12 | P a g e info4eee | MATLAB
  • 13. 8. Write a program to find the DFT of given sequence. Program: h=input('enter sequence= '); N=input('enter N='); n=length(h); x=[h,zeros(1,N-n)]; y=zeros(N,1); for k=1:N, for n=1:N, y(k)=y(k)+x(n)*exp(-i*2*pi*(k-1)*(n-1)/N); end end disp('DFT of x='); y Command Window: >> psj_dft enter sequence= [1 2 4 8 16 32 64 128] enter N=8 DFT of x= y= 1.0e+002 * 2.5500 0.4864 + 1.6607i -0.5100 + 1.0200i -0.7864 + 0.4607i -0.8500 - 0.0000i -0.7864 - 0.4607i -0.5100 - 1.0200i 0.4864 - 1.6607i 13 | P a g e info4eee | MATLAB
  • 14. 9. Write a program to find the IDFT of given sequence. Program: h=input('enter sequence = '); N=input('enter N = '); n=length(x); x=[h,zeros(1,N-n)]; y=zeros(N,1); for n=1:N, for k=1:N, y(k)=y(k)+(1/N)*x(n)*exp(i*2*pi*(k-1)*(n-1)/N); end end disp('IDFT of Sequence = '); y Command Window: >> psj_idft enter sequence = [36 -4+9.656i -4+4i -4+1.656i -4 -4-1.656i -4-4i -4-9.656i] enter N = 8 IDFT of Sequence = y= 1.0000 2.0003 + 0.0000i 3.0000 + 0.0000i 4.0003 5.0000 - 0.0000i 5.9997 - 0.0000i 7.0000 + 0.0000i 7.9997 - 0.0000i 14 | P a g e info4eee | MATLAB
  • 15. 10. Write a program to find the DFT of given sequence using matrix. Program: x=input('Enter the sequence = '); n=length(x); w=dftmtx(n); y=[w*x']; w; disp('DFT of Sequence'); y Command Window: >> psj_dftumtx Enter the sequence = [1 2 3 4 4 3 2 1] DFT of Sequence y= 20.0000 -5.8284 - 2.4142i 0 -0.1716 - 0.4142i 0 -0.1716 + 0.4142i 0 -5.8284 + 2.4142 15 | P a g e info4eee | MATLAB
  • 16. 11. Write a program to find the IDFT using matrix. Program: x=input('enter the sequence = '); n=length(x); w=conj(dftmtx(n))/n; y=[inv(w)*x']/n; w; disp('IDFT of Sequence'); y Command Window: >> psj_idftumtx enter the sequence = [36 -4+9.656i -4+4i -4+1.656i -4 -4-1.656i -4-4i -49.656i] IDFT of Sequence y= 1.0000 + 0.0000i 2.0003 + 0.0000i 3.0000 - 0.0000i 4.0003 - 0.0000i 5.0000 + 0.0000i 5.9997 + 0.0000i 7.0000 - 0.0000i 7.9997 + 0.0000i 16 | P a g e info4eee | MATLAB
  • 17. 12. Write a program to generate DFT Matrix without using direct command. Program: N=input('Enter the value of N = '); x=zeros(N,N); for j=1:N, n=N*(j-1); for k=1:N, x(k+n)=exp(-i*2*pi*(j-1)*(k-1)/N); end end disp('Resultant matrix '); x Command Window: >> psj_dftmtx Enter the value of N = 4 Resultant matrix x= 1.0000 1.0000 1.0000 1.0000 1.0000 0.0000 - 1.0000i -1.0000 - 0.0000i -0.0000 + 1.0000i 1.0000 -1.0000 - 0.0000i 1.0000 + 0.0000i -1.0000 - 0.0000i 1.0000 -0.0000 + 1.0000i -1.0000 - 0.0000i 0.0000 - 1.0000i 17 | P a g e info4eee | MATLAB
  • 18. 13. Write a program to find the step response and impulse response of transfer function. Program: sys=tf([8 18 31],[1 6 14 24]) subplot(2,1,1) step(sys) subplot(2,1,2) impulse(sys) Command Window: >> psj_sni Transfer function: 8 s^2 + 18 s + 31 ----------------------s^3 + 6 s^2 + 14 s + 24 Figure Window: 18 | P a g e info4eee | MATLAB
  • 19. 14. Design a system to convert Fahrenheit to degree Celsius. Setup: 19 | P a g e info4eee | MATLAB
  • 20. 15. Design a system for torque converter. Setup: -------------------------------------A Group -------------------------------------- 20 | P a g e info4eee | MATLAB