SlideShare ist ein Scribd-Unternehmen logo
1 von 3
Downloaden Sie, um offline zu lesen
DISCRETE – TIME SIGNALS PLOTTING ON MATLAB
EXAMPLE
Solution by: MartinWachiye Wafula
MultimediaUniversity of Kenya
wachiyem@gmail.com
Problem:
Using MATLAB, producethe plot for (a), (d), (g) and (h)
Solution:
The code on MATLAB is as shownbelow:
%DISCRETE-TIME SIGNALS
%Author: Martin Wachiye Wafula
% Multimedia University of Kenya
%Date: 15th February, 2017
n = -6:6;
%The original signal x[n]
xn =((n+1)==0)+ (n==0)+ ((n-1)==0)+ ((n-2)==0)+ ...
0.5*(((n-3)==0)+ ((n-4)==0));
subplot(3,2,1)
stem(n,xn,'filled'), xlabel('n'), ylabel('x[n]')
title('plot of x[n]'), grid
%x[n] could also be plotted using the code below
% xn1 = ((n+1)==0)+(n>=0)-((n-3)>=0)+0.5*(((n-3)>=0)-((n-5)>=0));
%stem(n,xn1,'filled')
%(a) signal x[n-2]
xn_a = (((n-2)+1)==0)+ ((n-2)==0) + (((n-2)-1)==0) + ...
(((n-2)-2)==0) + 0.5*((((n-2)-3)==0) + (((n-2)-4)==0) );
subplot(3,2,2)
stem(n,xn_a,'filled'), xlabel('n'), ylabel('x[n-2]')
title('plot(a) x(n-2)'),grid
%signal (d): x[n]u[2-n]
xn_d = xn .*((2-n)>=0);
subplot(3,2,3)
stem(n,xn_d,'filled'), xlabel('n'), ylabel('x[n]u[2-n]')
title('plot(d) x[n]u[2-n]'),grid
% to obtain odd and even part of the signal x[n]
xN = fliplr(xn); %reversed version of x[n] i.e x[-n]
xe = (xn + xN)/2; %computing the even part
xo = (xn - xN)/2; %computing the odd part
ver = xn - (xe + xo) % to verify our decomposition
subplot(3,2,4)
stem(n,xe,'filled'), xlabel('n'), ylabel('xe[n]'),axis([-6 6 -1 1.5])
title('(g) Even Part'), grid
subplot(3,2,5)
stem(n,xo,'filled'), xlabel('n'), ylabel('xo[n]'),axis([-6 6 -1 1.5])
title('(h) Odd Part'), grid
The plots obtainedfrom running the code are as depictedby the screenshot
below:
Discrete time signals on MATLAB

Weitere ähnliche Inhalte

Was ist angesagt?

RF Module Design - [Chapter 3] Linearity
RF Module Design - [Chapter 3]  LinearityRF Module Design - [Chapter 3]  Linearity
RF Module Design - [Chapter 3] LinearitySimen Li
 
Amplitude modulation
Amplitude modulationAmplitude modulation
Amplitude modulationRumah Belajar
 
pcb layers in layout
pcb layers in layoutpcb layers in layout
pcb layers in layoutAnum Mairaj
 
Signals and systems 2e oppenheim solutions
Signals and systems 2e oppenheim solutionsSignals and systems 2e oppenheim solutions
Signals and systems 2e oppenheim solutionsrbatec
 
Chapter10 switching
Chapter10 switchingChapter10 switching
Chapter10 switchingSuneel Varma
 
C# Yurt Otomasyonu Mehmet Yüceer
C# Yurt Otomasyonu Mehmet YüceerC# Yurt Otomasyonu Mehmet Yüceer
C# Yurt Otomasyonu Mehmet YüceerMehmet Yüceer
 
Cmos digital integrated circuits analysis and design 4th edition kang solutio...
Cmos digital integrated circuits analysis and design 4th edition kang solutio...Cmos digital integrated circuits analysis and design 4th edition kang solutio...
Cmos digital integrated circuits analysis and design 4th edition kang solutio...vem2001
 
Translnear circuits by Anubhav
Translnear circuits by AnubhavTranslnear circuits by Anubhav
Translnear circuits by AnubhavAnubhav Anand
 
Transfer functions, poles and zeros.
Transfer functions, poles and zeros.Transfer functions, poles and zeros.
Transfer functions, poles and zeros.ARIF HUSSAIN
 
single stage amplifier Unit 5 AMVLSI
single stage amplifier Unit 5 AMVLSIsingle stage amplifier Unit 5 AMVLSI
single stage amplifier Unit 5 AMVLSIHarsha Raju
 
Digital Signal Processing Tutorial:Chapt 3 frequency analysis
Digital Signal Processing Tutorial:Chapt 3 frequency analysisDigital Signal Processing Tutorial:Chapt 3 frequency analysis
Digital Signal Processing Tutorial:Chapt 3 frequency analysisChandrashekhar Padole
 
Decimation in time and frequency
Decimation in time and frequencyDecimation in time and frequency
Decimation in time and frequencySARITHA REDDY
 
Lecture digital modulation
Lecture digital modulationLecture digital modulation
Lecture digital modulationRonoh Kennedy
 

Was ist angesagt? (20)

RF Module Design - [Chapter 3] Linearity
RF Module Design - [Chapter 3]  LinearityRF Module Design - [Chapter 3]  Linearity
RF Module Design - [Chapter 3] Linearity
 
Discrete Fourier Series | Discrete Fourier Transform | Discrete Time Fourier ...
Discrete Fourier Series | Discrete Fourier Transform | Discrete Time Fourier ...Discrete Fourier Series | Discrete Fourier Transform | Discrete Time Fourier ...
Discrete Fourier Series | Discrete Fourier Transform | Discrete Time Fourier ...
 
Amplitude modulation
Amplitude modulationAmplitude modulation
Amplitude modulation
 
pcb layers in layout
pcb layers in layoutpcb layers in layout
pcb layers in layout
 
MINIMUM SHIFT KEYING(MSK)
MINIMUM SHIFT KEYING(MSK)MINIMUM SHIFT KEYING(MSK)
MINIMUM SHIFT KEYING(MSK)
 
Signals and systems 2e oppenheim solutions
Signals and systems 2e oppenheim solutionsSignals and systems 2e oppenheim solutions
Signals and systems 2e oppenheim solutions
 
Chapter10 switching
Chapter10 switchingChapter10 switching
Chapter10 switching
 
C# Yurt Otomasyonu Mehmet Yüceer
C# Yurt Otomasyonu Mehmet YüceerC# Yurt Otomasyonu Mehmet Yüceer
C# Yurt Otomasyonu Mehmet Yüceer
 
Cmos digital integrated circuits analysis and design 4th edition kang solutio...
Cmos digital integrated circuits analysis and design 4th edition kang solutio...Cmos digital integrated circuits analysis and design 4th edition kang solutio...
Cmos digital integrated circuits analysis and design 4th edition kang solutio...
 
Dynamic logic circuits
Dynamic logic circuitsDynamic logic circuits
Dynamic logic circuits
 
Theory of Computation Unit 3
Theory of Computation Unit 3Theory of Computation Unit 3
Theory of Computation Unit 3
 
Saw filters
Saw filtersSaw filters
Saw filters
 
Translnear circuits by Anubhav
Translnear circuits by AnubhavTranslnear circuits by Anubhav
Translnear circuits by Anubhav
 
Theory of Computation Unit 2
Theory of Computation Unit 2Theory of Computation Unit 2
Theory of Computation Unit 2
 
Transfer functions, poles and zeros.
Transfer functions, poles and zeros.Transfer functions, poles and zeros.
Transfer functions, poles and zeros.
 
single stage amplifier Unit 5 AMVLSI
single stage amplifier Unit 5 AMVLSIsingle stage amplifier Unit 5 AMVLSI
single stage amplifier Unit 5 AMVLSI
 
Dc unit 2
Dc unit 2Dc unit 2
Dc unit 2
 
Digital Signal Processing Tutorial:Chapt 3 frequency analysis
Digital Signal Processing Tutorial:Chapt 3 frequency analysisDigital Signal Processing Tutorial:Chapt 3 frequency analysis
Digital Signal Processing Tutorial:Chapt 3 frequency analysis
 
Decimation in time and frequency
Decimation in time and frequencyDecimation in time and frequency
Decimation in time and frequency
 
Lecture digital modulation
Lecture digital modulationLecture digital modulation
Lecture digital modulation
 

Andere mochten auch

DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLABDIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLABMartin Wachiye Wafula
 
Outside the frame: Information and experience design in 360°
Outside the frame: Information and experience design in 360°Outside the frame: Information and experience design in 360°
Outside the frame: Information and experience design in 360°Heather Rhea
 
The beauty of infomation
The beauty of infomationThe beauty of infomation
The beauty of infomationWill Chai
 
4 pillars to the science of marketing
4 pillars to the science of marketing4 pillars to the science of marketing
4 pillars to the science of marketingNicolas Draca
 
discrete time signals and systems
 discrete time signals and systems discrete time signals and systems
discrete time signals and systemsZlatan Ahmadovic
 
журавка яна
журавка янажуравка яна
журавка янаutyyflbq
 
Manejo de los síntomas vasomotores y del síndrome genitourinario en pacientes...
Manejo de los síntomas vasomotores y del síndrome genitourinario en pacientes...Manejo de los síntomas vasomotores y del síndrome genitourinario en pacientes...
Manejo de los síntomas vasomotores y del síndrome genitourinario en pacientes...Jose Olmedo
 

Andere mochten auch (11)

DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLABDIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
 
Report ada
Report adaReport ada
Report ada
 
Outside the frame: Information and experience design in 360°
Outside the frame: Information and experience design in 360°Outside the frame: Information and experience design in 360°
Outside the frame: Information and experience design in 360°
 
The beauty of infomation
The beauty of infomationThe beauty of infomation
The beauty of infomation
 
Kdtm trinh bayduan-v1.1
Kdtm trinh bayduan-v1.1Kdtm trinh bayduan-v1.1
Kdtm trinh bayduan-v1.1
 
4 pillars to the science of marketing
4 pillars to the science of marketing4 pillars to the science of marketing
4 pillars to the science of marketing
 
discrete time signals and systems
 discrete time signals and systems discrete time signals and systems
discrete time signals and systems
 
журавка яна
журавка янажуравка яна
журавка яна
 
Printed av aid
Printed av aidPrinted av aid
Printed av aid
 
Manejo de los síntomas vasomotores y del síndrome genitourinario en pacientes...
Manejo de los síntomas vasomotores y del síndrome genitourinario en pacientes...Manejo de los síntomas vasomotores y del síndrome genitourinario en pacientes...
Manejo de los síntomas vasomotores y del síndrome genitourinario en pacientes...
 
Mi ppt inicial
Mi ppt inicialMi ppt inicial
Mi ppt inicial
 

Ähnlich wie Discrete time signals on MATLAB

Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Alamgir Hossain
 
[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망jaypi Ko
 
Natural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesNatural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesMark Brandao
 
Rcommands-for those who interested in R.
Rcommands-for those who interested in R.Rcommands-for those who interested in R.
Rcommands-for those who interested in R.Dr. Volkan OBAN
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine LearningBig_Data_Ukraine
 
Neural networks with python
Neural networks with pythonNeural networks with python
Neural networks with pythonSimone Piunno
 
MATLAB for Technical Computing
MATLAB for Technical ComputingMATLAB for Technical Computing
MATLAB for Technical ComputingNaveed Rehman
 
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov VyacheslavSeminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov VyacheslavVyacheslav Arbuzov
 
DSP_DiscSignals_LinearS_150417.pptx
DSP_DiscSignals_LinearS_150417.pptxDSP_DiscSignals_LinearS_150417.pptx
DSP_DiscSignals_LinearS_150417.pptxHamedNassar5
 

Ähnlich wie Discrete time signals on MATLAB (20)

Mat lab
Mat labMat lab
Mat lab
 
Matlab programs
Matlab programsMatlab programs
Matlab programs
 
Mathematica for Physicits
Mathematica for PhysicitsMathematica for Physicits
Mathematica for Physicits
 
Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report
 
Matlab Assignment Help
Matlab Assignment HelpMatlab Assignment Help
Matlab Assignment Help
 
Matlab1
Matlab1Matlab1
Matlab1
 
[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망
 
Natural and Clamped Cubic Splines
Natural and Clamped Cubic SplinesNatural and Clamped Cubic Splines
Natural and Clamped Cubic Splines
 
Rcommands-for those who interested in R.
Rcommands-for those who interested in R.Rcommands-for those who interested in R.
Rcommands-for those who interested in R.
 
Signals and Systems Homework Help.pptx
Signals and Systems Homework Help.pptxSignals and Systems Homework Help.pptx
Signals and Systems Homework Help.pptx
 
Matlab algebra
Matlab algebraMatlab algebra
Matlab algebra
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 
Neural networks with python
Neural networks with pythonNeural networks with python
Neural networks with python
 
Dsp lab manual
Dsp lab manualDsp lab manual
Dsp lab manual
 
MATLAB for Technical Computing
MATLAB for Technical ComputingMATLAB for Technical Computing
MATLAB for Technical Computing
 
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov VyacheslavSeminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
Seminar PSU 09.04.2013 - 10.04.2013 MiFIT, Arbuzov Vyacheslav
 
DSP_DiscSignals_LinearS_150417.pptx
DSP_DiscSignals_LinearS_150417.pptxDSP_DiscSignals_LinearS_150417.pptx
DSP_DiscSignals_LinearS_150417.pptx
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
Lent Matlab H Ss
Lent Matlab H SsLent Matlab H Ss
Lent Matlab H Ss
 
Computer algebra-system-maple
Computer algebra-system-mapleComputer algebra-system-maple
Computer algebra-system-maple
 

Mehr von Martin Wachiye Wafula

Mehr von Martin Wachiye Wafula (10)

Introduction to information theory
Introduction to information theoryIntroduction to information theory
Introduction to information theory
 
Intelligent reflecting surfaces (IRS)
Intelligent reflecting surfaces  (IRS)Intelligent reflecting surfaces  (IRS)
Intelligent reflecting surfaces (IRS)
 
ELECTRONIC MANAGEMENT SYSTEM BASED ON RFID AND USSD
ELECTRONIC MANAGEMENT SYSTEM BASED ON RFID AND USSDELECTRONIC MANAGEMENT SYSTEM BASED ON RFID AND USSD
ELECTRONIC MANAGEMENT SYSTEM BASED ON RFID AND USSD
 
Disruptive technologies and market place
Disruptive technologies and market placeDisruptive technologies and market place
Disruptive technologies and market place
 
5G: LET'S DEMYSTIFY IT, 5G Technology Update
5G: LET'S DEMYSTIFY IT, 5G Technology Update5G: LET'S DEMYSTIFY IT, 5G Technology Update
5G: LET'S DEMYSTIFY IT, 5G Technology Update
 
Analog filters matlab_examples
Analog filters matlab_examplesAnalog filters matlab_examples
Analog filters matlab_examples
 
Matlab task1
Matlab task1Matlab task1
Matlab task1
 
Matlab problems
Matlab problemsMatlab problems
Matlab problems
 
Discrete time signals on MATLAB
Discrete time signals on MATLABDiscrete time signals on MATLAB
Discrete time signals on MATLAB
 
Unity in diversity
Unity in diversityUnity in diversity
Unity in diversity
 

Kürzlich hochgeladen

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
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...roncy bisnoi
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
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 EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
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 EscortsCall Girls in Nagpur High Profile
 
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 MACHINESIVASHANKAR N
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
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 RecordAsst.prof M.Gokilavani
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
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.pptxfenichawla
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
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.pptxAsutosh Ranjan
 

Kürzlich hochgeladen (20)

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
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...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
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
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
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
 
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
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
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
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
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
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
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
 

Discrete time signals on MATLAB

  • 1. DISCRETE – TIME SIGNALS PLOTTING ON MATLAB EXAMPLE Solution by: MartinWachiye Wafula MultimediaUniversity of Kenya wachiyem@gmail.com Problem: Using MATLAB, producethe plot for (a), (d), (g) and (h) Solution: The code on MATLAB is as shownbelow: %DISCRETE-TIME SIGNALS %Author: Martin Wachiye Wafula % Multimedia University of Kenya %Date: 15th February, 2017 n = -6:6; %The original signal x[n] xn =((n+1)==0)+ (n==0)+ ((n-1)==0)+ ((n-2)==0)+ ... 0.5*(((n-3)==0)+ ((n-4)==0)); subplot(3,2,1) stem(n,xn,'filled'), xlabel('n'), ylabel('x[n]') title('plot of x[n]'), grid %x[n] could also be plotted using the code below % xn1 = ((n+1)==0)+(n>=0)-((n-3)>=0)+0.5*(((n-3)>=0)-((n-5)>=0)); %stem(n,xn1,'filled') %(a) signal x[n-2] xn_a = (((n-2)+1)==0)+ ((n-2)==0) + (((n-2)-1)==0) + ... (((n-2)-2)==0) + 0.5*((((n-2)-3)==0) + (((n-2)-4)==0) );
  • 2. subplot(3,2,2) stem(n,xn_a,'filled'), xlabel('n'), ylabel('x[n-2]') title('plot(a) x(n-2)'),grid %signal (d): x[n]u[2-n] xn_d = xn .*((2-n)>=0); subplot(3,2,3) stem(n,xn_d,'filled'), xlabel('n'), ylabel('x[n]u[2-n]') title('plot(d) x[n]u[2-n]'),grid % to obtain odd and even part of the signal x[n] xN = fliplr(xn); %reversed version of x[n] i.e x[-n] xe = (xn + xN)/2; %computing the even part xo = (xn - xN)/2; %computing the odd part ver = xn - (xe + xo) % to verify our decomposition subplot(3,2,4) stem(n,xe,'filled'), xlabel('n'), ylabel('xe[n]'),axis([-6 6 -1 1.5]) title('(g) Even Part'), grid subplot(3,2,5) stem(n,xo,'filled'), xlabel('n'), ylabel('xo[n]'),axis([-6 6 -1 1.5]) title('(h) Odd Part'), grid The plots obtainedfrom running the code are as depictedby the screenshot below: