SlideShare ist ein Scribd-Unternehmen logo
1 von 10
DIGITAL SIGNAL
PROCESSING
TASK-1
(a)
OBJECTIVE:
To generate unit sample sequence delta(n), unit step sequence u(n), delayed
unit step sequence u(n-N) where N=4, unit ramp sequence r(n).
PROGRAM:
% 19BEC0852 -1a
clc
clear all;
close all;
n=-10:1:10;
u=[zeros(1,10),ones(1,11)];
stem(n,u);
title('Unit step sequence')
del=[zeros(1,10),ones(1,1),zeros(
1,10)];
figure
stem(n,del);
title('Unit delta sequence')
u=[zeros(1,14),ones(1,7)];
figure
stem(n,u);
title('Shifted Unit step
sequence')
r=n.*(n>=0);
figure;
stem(n,r);
title('unit ramp sequences')
Name:- Naragam.Kiran Ganesh
Reg no:- 19BEC0852
Lab slot:L45+l46
OUTPUT:
RESULT/INFERENCE:
Unit sample sequence (n), Ramp function r(n), delayed unit step sequence u(n-
N) graphs are plotted on matlab.
(b) Generate a real exponential sequence for 0<a<1, a>1, -1< a<0, a<-
1.Use ‘for’ loop and subplot.
OBJECTIVE
To plot exponential sequence graph for 0<a<1, a>1, -1< a<0, a<-1.
PROGRAM
% 19BEC0852 -1a
clc;
clear all;
close all;
n=-10:10;
for i=1:4;
a=input('Enter a value:')
y=a.^n;
subplot(2,2,i); stem(n,y);
end
OUTPUT:
RESULT/INFERENCE
A real exponential sequence graphs for 0<a<1, a>1, -1< a<0, a<-1 are plotted in matlab.
(c) Generate a 5Hz continuous sinusoid plot of amplitude
1.2 and 15Hz continuous sinusoid plot of amplitude 0.7. Comment
on the sampling frequency.
OBJECTIVE:
To generate a 5Hz continuous sinusoid plot of amplitude 1.2 and 15Hz
continuous sinusoid plot of amplitude 0.7 .
PROGRAM:
% 19BEC0852 -1c
clc
clear all
close all
t=0:0.01:pi;
a=input('Enter amplitude:');
f=input('Enter frequency:');
T=1/f;
y=a*sin (2*pi*f*t);
subplot (2,1,1);
plot(t,y)
title('A=1.2 and f=5 Hz')
hold on
a=input('Enter amplitude:');
f=input('Enter frequency:');
T=1/f;
y=a*sin(2*pi*f*t);
subplot(2,1,2);
plot(t,y)
title ('A=0.7 and f=15Hz')
Input:
Enter amplitude:1.2
Enter frequency:5
Enter amplitude:0.7
Enter frequency:15
OUTPUT
RESULT
A 5Hz continuous sinusoid plot of amplitude 1.2 and 15Hz continuous sinusoid
plot of amplitude 0.7 is plotted on matlab.
(d) Plot 𝑢(𝑛− 2), 𝑢(𝑛+ 3), 𝑢(−𝑛− 2), 𝑢(−𝑛+ 3) from -10 to 10 time
indices. Indicate which signal is causal, anti-causal and non-
causal.
OBJECTIVE
To plot (𝑛− 2),𝑢(𝑛+ 3),𝑢(−𝑛− 2),𝑢(−𝑛+ 3) from -10 to 10 time indices and to
check whether it is causal, anti-causal and non-causal.
% 19BEC0852-1d
clc;
clear all;
close all;
n=-10:10;
u1=[zeros(1,12),ones(1,9)];
u2=[zeros(1,7),ones(1,14)];
u3=[ones(1,9),zeros(1,12)];
u4=[ones(1,14),zeros(1,7)];
subplot(2,2,1);
stem(n,u1);
subplot(2,2,2);
stem(n,u2);
subplot(2,2,3);
stem(n,u3);
subplot(2,2,4);
stem(n,u4);
PROGRAM:
OUTPUT
2. Using MATLAB perform the linear convolution between input
x(n) and impulse response h(n) to obtain the response of LTI
system y(n) in the time domain without using the inbuilt function
‘conv’. Verify the result using ‘conv’.
OBJECTIVE
Using matlab perform the linear convolution b/w input x(n) and impulse
response h(n).
PROGRAM
clc;
clear all;
close all;
x=input('samples of x(n): ');
h=input('samples of h(n): ');
xlen= length(x);
hlen=length(h);
k=0;
for i=1:xlen;
for j=1:hlen;
y(i,j+k) = x(i)*h(j);
end
k=k+1;
end;
disp('conv');
z=sum(y);
disp(z);
stem(z);
disp('Verification Using conv(x,h)');
disp(conv(x,h));
INPUT
samples of x(n): [1 2 3]
samples of h(n): [4 5 6]
OUTPUT
conv
4 13 28 27 18
Verification Using conv(x,h)
4 13 28 27 18
Inference:
From this experiment we can obtain response of LTI system in time
domain and also can verify with ‘conv’. And in this experiment the
response we got is verified with ‘conv’.

Weitere ähnliche Inhalte

Was ist angesagt?

Generation of discrete time signals
Generation of discrete time signalsGeneration of discrete time signals
Generation of discrete time signals
siva kumar
 
Using Petri Net Invariants in State Space Construction
Using Petri Net Invariants in State Space ConstructionUsing Petri Net Invariants in State Space Construction
Using Petri Net Invariants in State Space Construction
Universität Rostock
 

Was ist angesagt? (20)

A star
A starA star
A star
 
Introduction to MATLAB
Introduction to MATLAB Introduction to MATLAB
Introduction to MATLAB
 
2D array
2D array2D array
2D array
 
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
QUEUE || FUNCTION WRITING BASED ON QUEUE || LINKED LIST || DATA STRUCTURE || ...
 
Analysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemAnalysis of Electro-Mechanical System
Analysis of Electro-Mechanical System
 
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABMathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
 
Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4
 
Reconstruction
ReconstructionReconstruction
Reconstruction
 
A* (aster) Search Algorithm
A* (aster) Search AlgorithmA* (aster) Search Algorithm
A* (aster) Search Algorithm
 
Automata theory -Conversion of ε nfa to nfa
Automata theory -Conversion of ε nfa to nfaAutomata theory -Conversion of ε nfa to nfa
Automata theory -Conversion of ε nfa to nfa
 
Generation of discrete time signals
Generation of discrete time signalsGeneration of discrete time signals
Generation of discrete time signals
 
Topological sort
Topological sortTopological sort
Topological sort
 
Ch01 basic concepts_nosoluiton
Ch01 basic concepts_nosoluitonCh01 basic concepts_nosoluiton
Ch01 basic concepts_nosoluiton
 
Asymptoptic notations
Asymptoptic notationsAsymptoptic notations
Asymptoptic notations
 
Using Petri Net Invariants in State Space Construction
Using Petri Net Invariants in State Space ConstructionUsing Petri Net Invariants in State Space Construction
Using Petri Net Invariants in State Space Construction
 
Fibonacci Numbers in Modulo N
Fibonacci Numbers in Modulo NFibonacci Numbers in Modulo N
Fibonacci Numbers in Modulo N
 
Algorithms of graph
Algorithms of graphAlgorithms of graph
Algorithms of graph
 
Effect of adding zero
 Effect of adding zero Effect of adding zero
Effect of adding zero
 
Theory of Computation Unit 4
Theory of Computation Unit 4Theory of Computation Unit 4
Theory of Computation Unit 4
 
Program for axisymmetric problem matlab
Program for axisymmetric problem  matlabProgram for axisymmetric problem  matlab
Program for axisymmetric problem matlab
 

Ähnlich wie Dsp lab task1 ganesh

Basic simulation lab manual1
Basic simulation lab manual1Basic simulation lab manual1
Basic simulation lab manual1
Janardhana Raju M
 
Fourier series example
Fourier series exampleFourier series example
Fourier series example
Abi finni
 

Ähnlich wie Dsp lab task1 ganesh (20)

DSP_EXP.pptx
DSP_EXP.pptxDSP_EXP.pptx
DSP_EXP.pptx
 
Matlab programs
Matlab programsMatlab programs
Matlab programs
 
Digital Signal Processing
Digital Signal ProcessingDigital Signal Processing
Digital Signal Processing
 
Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual
 
DSP LAB COMPLETE CODES.docx
DSP LAB COMPLETE CODES.docxDSP LAB COMPLETE CODES.docx
DSP LAB COMPLETE CODES.docx
 
Basic simulation lab manual1
Basic simulation lab manual1Basic simulation lab manual1
Basic simulation lab manual1
 
Informe laboratorio n°1
Informe laboratorio n°1Informe laboratorio n°1
Informe laboratorio n°1
 
Recursion in C
Recursion in CRecursion in C
Recursion in C
 
Sequences
SequencesSequences
Sequences
 
Dsp manual
Dsp manualDsp manual
Dsp manual
 
Fourier series example
Fourier series exampleFourier series example
Fourier series example
 
Conference ppt
Conference pptConference ppt
Conference ppt
 
Introduction
IntroductionIntroduction
Introduction
 
C1 - Insertion Sort
C1 - Insertion SortC1 - Insertion Sort
C1 - Insertion Sort
 
Mergesort
MergesortMergesort
Mergesort
 
Dsp iit workshop
Dsp iit workshopDsp iit workshop
Dsp iit workshop
 
Control system lab nyquist plot
Control system lab nyquist plotControl system lab nyquist plot
Control system lab nyquist plot
 
Matlab file
Matlab file Matlab file
Matlab file
 
algorithm Unit 3
algorithm Unit 3algorithm Unit 3
algorithm Unit 3
 
A Mathematically Derived Number of Resamplings for Noisy Optimization (GECCO2...
A Mathematically Derived Number of Resamplings for Noisy Optimization (GECCO2...A Mathematically Derived Number of Resamplings for Noisy Optimization (GECCO2...
A Mathematically Derived Number of Resamplings for Noisy Optimization (GECCO2...
 

Mehr von ChetanShahukari (12)

Presentation1 copy (4)
Presentation1   copy (4)Presentation1   copy (4)
Presentation1 copy (4)
 
Presentation1 copy (3)
Presentation1   copy (3)Presentation1   copy (3)
Presentation1 copy (3)
 
Dsp review
Dsp reviewDsp review
Dsp review
 
Dsp review 1,2,3
Dsp review 1,2,3Dsp review 1,2,3
Dsp review 1,2,3
 
Urbanplanning cat1
Urbanplanning cat1Urbanplanning cat1
Urbanplanning cat1
 
Micro task1
Micro task1Micro task1
Micro task1
 
Presentation1
Presentation1Presentation1
Presentation1
 
19bec0855 project review 1-converted
19bec0855 project review 1-converted19bec0855 project review 1-converted
19bec0855 project review 1-converted
 
Iot vijaya priya r cat1
Iot vijaya priya r cat1Iot vijaya priya r cat1
Iot vijaya priya r cat1
 
Ppt 2
Ppt 2Ppt 2
Ppt 2
 
Presentation1 copy (2)
Presentation1   copy (2)Presentation1   copy (2)
Presentation1 copy (2)
 
Presentation1 copy
Presentation1   copyPresentation1   copy
Presentation1 copy
 

Kürzlich hochgeladen

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 

Kürzlich hochgeladen (20)

UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Dsp lab task1 ganesh

  • 1. DIGITAL SIGNAL PROCESSING TASK-1 (a) OBJECTIVE: To generate unit sample sequence delta(n), unit step sequence u(n), delayed unit step sequence u(n-N) where N=4, unit ramp sequence r(n). PROGRAM: % 19BEC0852 -1a clc clear all; close all; n=-10:1:10; u=[zeros(1,10),ones(1,11)]; stem(n,u); title('Unit step sequence') del=[zeros(1,10),ones(1,1),zeros( 1,10)]; figure stem(n,del); title('Unit delta sequence') u=[zeros(1,14),ones(1,7)]; figure stem(n,u); title('Shifted Unit step sequence') r=n.*(n>=0); figure; stem(n,r); title('unit ramp sequences') Name:- Naragam.Kiran Ganesh Reg no:- 19BEC0852 Lab slot:L45+l46
  • 2. OUTPUT: RESULT/INFERENCE: Unit sample sequence (n), Ramp function r(n), delayed unit step sequence u(n- N) graphs are plotted on matlab. (b) Generate a real exponential sequence for 0<a<1, a>1, -1< a<0, a<- 1.Use ‘for’ loop and subplot. OBJECTIVE To plot exponential sequence graph for 0<a<1, a>1, -1< a<0, a<-1. PROGRAM % 19BEC0852 -1a clc; clear all; close all; n=-10:10; for i=1:4; a=input('Enter a value:') y=a.^n; subplot(2,2,i); stem(n,y); end
  • 3. OUTPUT: RESULT/INFERENCE A real exponential sequence graphs for 0<a<1, a>1, -1< a<0, a<-1 are plotted in matlab.
  • 4. (c) Generate a 5Hz continuous sinusoid plot of amplitude 1.2 and 15Hz continuous sinusoid plot of amplitude 0.7. Comment on the sampling frequency. OBJECTIVE: To generate a 5Hz continuous sinusoid plot of amplitude 1.2 and 15Hz continuous sinusoid plot of amplitude 0.7 . PROGRAM: % 19BEC0852 -1c clc clear all close all t=0:0.01:pi; a=input('Enter amplitude:'); f=input('Enter frequency:'); T=1/f; y=a*sin (2*pi*f*t); subplot (2,1,1); plot(t,y) title('A=1.2 and f=5 Hz') hold on a=input('Enter amplitude:'); f=input('Enter frequency:'); T=1/f; y=a*sin(2*pi*f*t); subplot(2,1,2); plot(t,y) title ('A=0.7 and f=15Hz')
  • 5. Input: Enter amplitude:1.2 Enter frequency:5 Enter amplitude:0.7 Enter frequency:15 OUTPUT RESULT A 5Hz continuous sinusoid plot of amplitude 1.2 and 15Hz continuous sinusoid plot of amplitude 0.7 is plotted on matlab.
  • 6. (d) Plot 𝑢(𝑛− 2), 𝑢(𝑛+ 3), 𝑢(−𝑛− 2), 𝑢(−𝑛+ 3) from -10 to 10 time indices. Indicate which signal is causal, anti-causal and non- causal. OBJECTIVE To plot (𝑛− 2),𝑢(𝑛+ 3),𝑢(−𝑛− 2),𝑢(−𝑛+ 3) from -10 to 10 time indices and to check whether it is causal, anti-causal and non-causal. % 19BEC0852-1d clc; clear all; close all; n=-10:10; u1=[zeros(1,12),ones(1,9)]; u2=[zeros(1,7),ones(1,14)]; u3=[ones(1,9),zeros(1,12)]; u4=[ones(1,14),zeros(1,7)]; subplot(2,2,1); stem(n,u1); subplot(2,2,2); stem(n,u2); subplot(2,2,3); stem(n,u3); subplot(2,2,4); stem(n,u4); PROGRAM: OUTPUT
  • 7.
  • 8. 2. Using MATLAB perform the linear convolution between input x(n) and impulse response h(n) to obtain the response of LTI system y(n) in the time domain without using the inbuilt function ‘conv’. Verify the result using ‘conv’. OBJECTIVE Using matlab perform the linear convolution b/w input x(n) and impulse response h(n). PROGRAM clc; clear all; close all; x=input('samples of x(n): '); h=input('samples of h(n): '); xlen= length(x); hlen=length(h); k=0; for i=1:xlen; for j=1:hlen; y(i,j+k) = x(i)*h(j); end k=k+1; end; disp('conv'); z=sum(y); disp(z); stem(z); disp('Verification Using conv(x,h)'); disp(conv(x,h)); INPUT samples of x(n): [1 2 3] samples of h(n): [4 5 6]
  • 9. OUTPUT conv 4 13 28 27 18 Verification Using conv(x,h) 4 13 28 27 18
  • 10. Inference: From this experiment we can obtain response of LTI system in time domain and also can verify with ‘conv’. And in this experiment the response we got is verified with ‘conv’.