SlideShare a Scribd company logo
Sampling of Continuous Signals in MATLAB 
All signals in MATLAB are discrete-time, but they will look like continuous-time 
signals if the sampling rate is much higher than the Nyquist rate. 
Example (1): 
We want to sample a function: x = sin(2 pi f t), 
where f = 2 kHz and plot the samples values on a graph. 
Let x1 be the signal sampled at 10 kHz. Let x2 be the signal sampled at 3 kHz. 
Solution: 
f = 2000; 
T = 1/f; 
tmin = 0; 
1 
tmax = 5*T; % Plot 5 cycles 
0.5 
dt1 = 1/10000; 
0 
dt2 = 1/3000; 
-0.5 
t1 = tmin:dt1:tmax; 
-1 
t2 = tmin:dt2:tmax; 
0 0.5 1 1.5 2 2.5 
x 10-3 
x1 = sin(2*pi*f*t1); 
x2 = sin(2*pi*f*t2); 
subplot(211) 
stem(t1,x1); 
subplot(212) 
stem(t2,x2); 
0 0.5 1 1.5 2 2.5 
x 10-3 
1 
0.5 
0 
-0.5 
-1 
Note: 
STEM Discrete sequence or "stem" plot. 
STEM(Y): 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.
Example (2): 
We want to sample a function: x = sin(2 pi f t), 
where f = 2 kHz and display the samples values in a vector. 
Let x1 be the signal sampled at 10 kHz. Let x2 be the signal sampled at 3 kHz. 
Solution: 
% Sample the sinusoid x = sin(2 pi f t), where f = 2 kHz, and 
plot the sampled signals over the continuous-time signal. 
% Let x1 be the signal sampled at 10 kHz. 
% Let x2 be the signal sampled at 3 kHz. 
f = 2000; 
T = 1/f; 
tmin = 0; 
tmax = 5*T; 
%Sampling rate 
dt1 = 1/10000; 
dt2 = 1/3000; 
for t1 = tmin:dt1:tmax 
i=1; 
x1(i) = sin(2*pi*f*t1); 
i=i+1; 
end; 
disp(x1); 
for t2 = tmin:dt2:tmax; 
j=1; 
x2(j) = sin(2*pi*f*t2); 
j=j+1; 
end; 
disp(x2);
X1: 
Columns 1 through 7 
-0.0000 0.9511 0.5878 -0.5878 -0.9511 -0.0000 0.9511 
Columns 8 through 14 
0.5878 -0.5878 -0.9511 -0.0000 0.9511 0.5878 -0.5878 
Columns 15 through 21 
-0.9511 -0.0000 0.9511 0.5878 -0.5878 -0.9511 -0.0000 
Columns 22 through 26 
0.9511 0.5878 -0.5878 -0.9511 -0.0000 
X2: 
Columns 1 through 7 
-0.8660 -0.8660 0.8660 -0.0000 -0.8660 0.8660 -0.0000 
Column 8 
-0.8660
Example (3): 
We want to sample a function: x = sin(2 pi f t), 
where f = 2 kHz and plot the samples values on a graph containing the original 
signal. 
Let x1 be the signal sampled at 10 kHz. Let x2 be the signal sampled at 3 kHz. 
Solution: 
% Sample the sinusoid x = sin(2 pi f t), where f = 2 kHz, and 
plot the sampled 
% signals over the continuous-time signal. 
% Let x1 be the signal sampled at 10 kHz. 
% Let x2 be the signal sampled at 3 kHz. 
f = 2000; 
T = 1/f; 
tmin = 0; 
tmax = 5*T; 
dt = T/100; % take 100 points within each cycle 
% for an accurate plot use sufficient points within one cycle 
(100,200,500…) Increasing ‘dt’ will decrease the accuracy 
t = tmin:dt:tmax; 
x = sin(2*pi*f*t); 
dt1 = 1/10000; 
dt2 = 1/3000; 
t1 = tmin:dt1:tmax; 
t2 = tmin:dt2:tmax; 
x1 = sin(2*pi*f*t1); 
x2 = sin(2*pi*f*t2); 
subplot(211) 
plot(t,x,'r'); 
hold on 
stem(t1,x1); % to display the samples on the original plot 
subplot(212) 
plot(t,x,'r'); 
hold on 
stem(t2,x2); % to display the samples on the original plot
0 0.5 1 1.5 2 2.5 
x 10-3 
1 
0.5 
0 
-0.5 
-1 
0 0.5 1 1.5 2 2.5 
x 10-3 
1 
0.5 
0 
-0.5 
-1
MATLAB treatment of audio signals 
Recording an audio signal via a microphone: 
y = audiorecorder 
After you create an audiorecorder object, you can use the methods listed below on 
that object. 
 record(y) Starts recording 
 record(y,length) Records for length number of seconds. 
 stop(y) Stops recording 
 pause(y) Pauses recording 
 resume(y) Restarts recording from where recording was paused. 
 play(y) Creates an audioplayer, plays the recorded audio data, 
and returns a handle to the created audioplayer. 
Reading an audio file .wav 
 y = wavread(filename) loads a WAVE file specified by filename, returning 
the sampled data in y. 
 [y, Fs, nbits] = wavread(filename) returns the sample rate (Fs) in Hertz and 
the number of bits per sample (nbits) used to encode the data in the file.

More Related Content

What's hot

Math powerpoint- Polynomial equations and graph of polynomial functions
Math powerpoint- Polynomial equations and graph of polynomial functionsMath powerpoint- Polynomial equations and graph of polynomial functions
Math powerpoint- Polynomial equations and graph of polynomial functions
Jana Marie Aguilar
 
Applied Digital Signal Processing 1st Edition Manolakis Solutions Manual
Applied Digital Signal Processing 1st Edition Manolakis Solutions ManualApplied Digital Signal Processing 1st Edition Manolakis Solutions Manual
Applied Digital Signal Processing 1st Edition Manolakis Solutions Manual
towojixi
 
Update Rules for CNN Backpropagation
Update Rules for CNN BackpropagationUpdate Rules for CNN Backpropagation
Update Rules for CNN Backpropagation
Thomas Epelbaum
 
Chapter6 sampling
Chapter6 samplingChapter6 sampling
con-dif2
con-dif2con-dif2
con-dif2
Luoyin Feng
 
bask, bfsk, bpsk
bask, bfsk, bpskbask, bfsk, bpsk
bask, bfsk, bpsk
blzz2net
 
RES701 Research Methodology_FFT
RES701 Research Methodology_FFTRES701 Research Methodology_FFT
RES701 Research Methodology_FFT
VIT University (Chennai Campus)
 
inverse z-transform ppt
inverse z-transform pptinverse z-transform ppt
inverse z-transform ppt
mihir jain
 
Dsp U Lec10 DFT And FFT
Dsp U   Lec10  DFT And  FFTDsp U   Lec10  DFT And  FFT
Dsp U Lec10 DFT And FFT
taha25
 
Ct2 2013 14
Ct2 2013 14Ct2 2013 14
Ct2 2013 14
dana53
 
Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual
Jitendra Jangid
 
Digital communication telecommunication lab ksit
Digital communication telecommunication lab ksitDigital communication telecommunication lab ksit
Digital communication telecommunication lab ksit
Ganesh Mandakapu
 
signal and system solution Quiz2
signal and system solution Quiz2signal and system solution Quiz2
signal and system solution Quiz2
iqbal ahmad
 
00e isi
00e isi00e isi
00e isi
jaihooo
 
FFT
FFTFFT
Mathematical physics group 16
Mathematical physics group 16Mathematical physics group 16
Mathematical physics group 16
derry92
 
Dsp U Lec04 Discrete Time Signals & Systems
Dsp U   Lec04 Discrete Time Signals & SystemsDsp U   Lec04 Discrete Time Signals & Systems
Dsp U Lec04 Discrete Time Signals & Systems
taha25
 
Transformasi z
Transformasi zTransformasi z
Transformasi z
schlamhaff
 
Lti system
Lti systemLti system
Lti system
Fariza Zahari
 
SIGNAL OPERATIONS
SIGNAL OPERATIONSSIGNAL OPERATIONS
SIGNAL OPERATIONS
mihir jain
 

What's hot (20)

Math powerpoint- Polynomial equations and graph of polynomial functions
Math powerpoint- Polynomial equations and graph of polynomial functionsMath powerpoint- Polynomial equations and graph of polynomial functions
Math powerpoint- Polynomial equations and graph of polynomial functions
 
Applied Digital Signal Processing 1st Edition Manolakis Solutions Manual
Applied Digital Signal Processing 1st Edition Manolakis Solutions ManualApplied Digital Signal Processing 1st Edition Manolakis Solutions Manual
Applied Digital Signal Processing 1st Edition Manolakis Solutions Manual
 
Update Rules for CNN Backpropagation
Update Rules for CNN BackpropagationUpdate Rules for CNN Backpropagation
Update Rules for CNN Backpropagation
 
Chapter6 sampling
Chapter6 samplingChapter6 sampling
Chapter6 sampling
 
con-dif2
con-dif2con-dif2
con-dif2
 
bask, bfsk, bpsk
bask, bfsk, bpskbask, bfsk, bpsk
bask, bfsk, bpsk
 
RES701 Research Methodology_FFT
RES701 Research Methodology_FFTRES701 Research Methodology_FFT
RES701 Research Methodology_FFT
 
inverse z-transform ppt
inverse z-transform pptinverse z-transform ppt
inverse z-transform ppt
 
Dsp U Lec10 DFT And FFT
Dsp U   Lec10  DFT And  FFTDsp U   Lec10  DFT And  FFT
Dsp U Lec10 DFT And FFT
 
Ct2 2013 14
Ct2 2013 14Ct2 2013 14
Ct2 2013 14
 
Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual
 
Digital communication telecommunication lab ksit
Digital communication telecommunication lab ksitDigital communication telecommunication lab ksit
Digital communication telecommunication lab ksit
 
signal and system solution Quiz2
signal and system solution Quiz2signal and system solution Quiz2
signal and system solution Quiz2
 
00e isi
00e isi00e isi
00e isi
 
FFT
FFTFFT
FFT
 
Mathematical physics group 16
Mathematical physics group 16Mathematical physics group 16
Mathematical physics group 16
 
Dsp U Lec04 Discrete Time Signals & Systems
Dsp U   Lec04 Discrete Time Signals & SystemsDsp U   Lec04 Discrete Time Signals & Systems
Dsp U Lec04 Discrete Time Signals & Systems
 
Transformasi z
Transformasi zTransformasi z
Transformasi z
 
Lti system
Lti systemLti system
Lti system
 
SIGNAL OPERATIONS
SIGNAL OPERATIONSSIGNAL OPERATIONS
SIGNAL OPERATIONS
 

Viewers also liked

Transformada de Fourier
Transformada  de FourierTransformada  de Fourier
Transformada de Fourier
Carlos Matute
 
Amplificador
AmplificadorAmplificador
Amplificador
Karlimar Reina
 
ANÁLISIS DE TRANSISTORES BJT EN PEQUEÑA SEÑAL
ANÁLISIS DE TRANSISTORES BJT EN PEQUEÑA SEÑAL ANÁLISIS DE TRANSISTORES BJT EN PEQUEÑA SEÑAL
ANÁLISIS DE TRANSISTORES BJT EN PEQUEÑA SEÑAL
Ing. Jesus A. López K.
 
Clase de digitalización
Clase de digitalizaciónClase de digitalización
Clase de digitalización
Métodos Digitales - UBA
 
Senales analogicas-y-digitales-ppt
Senales analogicas-y-digitales-pptSenales analogicas-y-digitales-ppt
Senales analogicas-y-digitales-ppt
Lejasita Sierra
 
Transistor
TransistorTransistor
Transistor
Karlimar Reina
 
Aplicaciones de serie de fourier
Aplicaciones de serie de fourierAplicaciones de serie de fourier
Aplicaciones de serie de fourier
yaqui catunta
 
Modelo híbrido del bjt
Modelo híbrido del bjtModelo híbrido del bjt
Modelo híbrido del bjt
Jesus Daniel Romero Vasquez
 
PROCESAMIENTO DIGITAL DE SEÑALES CON MATLAB
PROCESAMIENTO DIGITAL DE SEÑALES CON MATLABPROCESAMIENTO DIGITAL DE SEÑALES CON MATLAB
PROCESAMIENTO DIGITAL DE SEÑALES CON MATLAB
INFOVIC
 
Procesamiento digital de imágenes con matlab
Procesamiento digital de imágenes con matlabProcesamiento digital de imágenes con matlab
Procesamiento digital de imágenes con matlab
Percy Julio Chambi Pacco
 
Señales de tiempo continuo y discreto MATLAB
Señales de tiempo continuo y discreto MATLABSeñales de tiempo continuo y discreto MATLAB
Señales de tiempo continuo y discreto MATLAB
Jose Agustin Estrada
 
3F3 – Digital Signal Processing (DSP) - Part1
3F3 – Digital Signal Processing (DSP) - Part13F3 – Digital Signal Processing (DSP) - Part1
3F3 – Digital Signal Processing (DSP) - Part1
op205
 
Modelo hibrido ruben gonzalez
Modelo hibrido ruben gonzalezModelo hibrido ruben gonzalez
Modelo hibrido ruben gonzalez
Ruben Gonzalez
 
Paginas de matematicas
Paginas de matematicasPaginas de matematicas
Paginas de matematicas
espanol
 

Viewers also liked (14)

Transformada de Fourier
Transformada  de FourierTransformada  de Fourier
Transformada de Fourier
 
Amplificador
AmplificadorAmplificador
Amplificador
 
ANÁLISIS DE TRANSISTORES BJT EN PEQUEÑA SEÑAL
ANÁLISIS DE TRANSISTORES BJT EN PEQUEÑA SEÑAL ANÁLISIS DE TRANSISTORES BJT EN PEQUEÑA SEÑAL
ANÁLISIS DE TRANSISTORES BJT EN PEQUEÑA SEÑAL
 
Clase de digitalización
Clase de digitalizaciónClase de digitalización
Clase de digitalización
 
Senales analogicas-y-digitales-ppt
Senales analogicas-y-digitales-pptSenales analogicas-y-digitales-ppt
Senales analogicas-y-digitales-ppt
 
Transistor
TransistorTransistor
Transistor
 
Aplicaciones de serie de fourier
Aplicaciones de serie de fourierAplicaciones de serie de fourier
Aplicaciones de serie de fourier
 
Modelo híbrido del bjt
Modelo híbrido del bjtModelo híbrido del bjt
Modelo híbrido del bjt
 
PROCESAMIENTO DIGITAL DE SEÑALES CON MATLAB
PROCESAMIENTO DIGITAL DE SEÑALES CON MATLABPROCESAMIENTO DIGITAL DE SEÑALES CON MATLAB
PROCESAMIENTO DIGITAL DE SEÑALES CON MATLAB
 
Procesamiento digital de imágenes con matlab
Procesamiento digital de imágenes con matlabProcesamiento digital de imágenes con matlab
Procesamiento digital de imágenes con matlab
 
Señales de tiempo continuo y discreto MATLAB
Señales de tiempo continuo y discreto MATLABSeñales de tiempo continuo y discreto MATLAB
Señales de tiempo continuo y discreto MATLAB
 
3F3 – Digital Signal Processing (DSP) - Part1
3F3 – Digital Signal Processing (DSP) - Part13F3 – Digital Signal Processing (DSP) - Part1
3F3 – Digital Signal Processing (DSP) - Part1
 
Modelo hibrido ruben gonzalez
Modelo hibrido ruben gonzalezModelo hibrido ruben gonzalez
Modelo hibrido ruben gonzalez
 
Paginas de matematicas
Paginas de matematicasPaginas de matematicas
Paginas de matematicas
 

Similar to Matlab Señales Discretas

Matlab 2
Matlab 2Matlab 2
Matlab 2
asguna
 
Contemporary communication systems 1st edition mesiya solutions manual
Contemporary communication systems 1st edition mesiya solutions manualContemporary communication systems 1st edition mesiya solutions manual
Contemporary communication systems 1st edition mesiya solutions manual
to2001
 
DSP Lab 1-6.pdf
DSP Lab 1-6.pdfDSP Lab 1-6.pdf
DSP Lab 1-6.pdf
SaiSumanthK1
 
signal.pdf
signal.pdfsignal.pdf
signal.pdf
gptchat9867
 
233_Sample-Chapter.pdf
233_Sample-Chapter.pdf233_Sample-Chapter.pdf
233_Sample-Chapter.pdf
Sampathkumar477190
 
233_Sample-Chapter (1).pdf
233_Sample-Chapter (1).pdf233_Sample-Chapter (1).pdf
233_Sample-Chapter (1).pdf
ssuser4dafea
 
Dsp Lab Record
Dsp Lab RecordDsp Lab Record
Dsp Lab Record
Aleena Varghese
 
7076 chapter5 slides
7076 chapter5 slides7076 chapter5 slides
7076 chapter5 slides
Nguyen Mina
 
Echantionnage.docx
Echantionnage.docxEchantionnage.docx
Echantionnage.docx
nesrinetaamallah
 
Conitunous Time Modulation.pdf
Conitunous Time Modulation.pdfConitunous Time Modulation.pdf
Conitunous Time Modulation.pdf
MHApu1
 
PPT Chapter-1-V1.pptx__26715_1_1539251776000.pptx.pptx
PPT Chapter-1-V1.pptx__26715_1_1539251776000.pptx.pptxPPT Chapter-1-V1.pptx__26715_1_1539251776000.pptx.pptx
PPT Chapter-1-V1.pptx__26715_1_1539251776000.pptx.pptx
idrissaeed
 
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
Martin Wachiye Wafula
 
Operations on Continuous time Signals.
Operations on Continuous time Signals.Operations on Continuous time Signals.
Operations on Continuous time Signals.
Shanawaz Ahamed
 
Comm lab manual_final
Comm lab manual_finalComm lab manual_final
Comm lab manual_final
GauravMishra427
 
Comm lab manual_final-1
Comm lab manual_final-1Comm lab manual_final-1
Comm lab manual_final-1
Abhishek Bansal
 
Fourier Specturm via MATLAB
Fourier Specturm via MATLABFourier Specturm via MATLAB
Fourier Specturm via MATLAB
ZunAib Ali
 
OPERATIONS ON SIGNALS
OPERATIONS ON SIGNALSOPERATIONS ON SIGNALS
OPERATIONS ON SIGNALS
vishalgohel12195
 
orfanidis-solutions-book-2nd-edition-pdf
orfanidis-solutions-book-2nd-edition-pdforfanidis-solutions-book-2nd-edition-pdf
orfanidis-solutions-book-2nd-edition-pdf
mavim69186
 
Introduction to Signal Processing Orfanidis [Solution Manual]
Introduction to Signal Processing Orfanidis [Solution Manual]Introduction to Signal Processing Orfanidis [Solution Manual]
Introduction to Signal Processing Orfanidis [Solution Manual]
slyhamm
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plotting
Amr Rashed
 

Similar to Matlab Señales Discretas (20)

Matlab 2
Matlab 2Matlab 2
Matlab 2
 
Contemporary communication systems 1st edition mesiya solutions manual
Contemporary communication systems 1st edition mesiya solutions manualContemporary communication systems 1st edition mesiya solutions manual
Contemporary communication systems 1st edition mesiya solutions manual
 
DSP Lab 1-6.pdf
DSP Lab 1-6.pdfDSP Lab 1-6.pdf
DSP Lab 1-6.pdf
 
signal.pdf
signal.pdfsignal.pdf
signal.pdf
 
233_Sample-Chapter.pdf
233_Sample-Chapter.pdf233_Sample-Chapter.pdf
233_Sample-Chapter.pdf
 
233_Sample-Chapter (1).pdf
233_Sample-Chapter (1).pdf233_Sample-Chapter (1).pdf
233_Sample-Chapter (1).pdf
 
Dsp Lab Record
Dsp Lab RecordDsp Lab Record
Dsp Lab Record
 
7076 chapter5 slides
7076 chapter5 slides7076 chapter5 slides
7076 chapter5 slides
 
Echantionnage.docx
Echantionnage.docxEchantionnage.docx
Echantionnage.docx
 
Conitunous Time Modulation.pdf
Conitunous Time Modulation.pdfConitunous Time Modulation.pdf
Conitunous Time Modulation.pdf
 
PPT Chapter-1-V1.pptx__26715_1_1539251776000.pptx.pptx
PPT Chapter-1-V1.pptx__26715_1_1539251776000.pptx.pptxPPT Chapter-1-V1.pptx__26715_1_1539251776000.pptx.pptx
PPT Chapter-1-V1.pptx__26715_1_1539251776000.pptx.pptx
 
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
 
Operations on Continuous time Signals.
Operations on Continuous time Signals.Operations on Continuous time Signals.
Operations on Continuous time Signals.
 
Comm lab manual_final
Comm lab manual_finalComm lab manual_final
Comm lab manual_final
 
Comm lab manual_final-1
Comm lab manual_final-1Comm lab manual_final-1
Comm lab manual_final-1
 
Fourier Specturm via MATLAB
Fourier Specturm via MATLABFourier Specturm via MATLAB
Fourier Specturm via MATLAB
 
OPERATIONS ON SIGNALS
OPERATIONS ON SIGNALSOPERATIONS ON SIGNALS
OPERATIONS ON SIGNALS
 
orfanidis-solutions-book-2nd-edition-pdf
orfanidis-solutions-book-2nd-edition-pdforfanidis-solutions-book-2nd-edition-pdf
orfanidis-solutions-book-2nd-edition-pdf
 
Introduction to Signal Processing Orfanidis [Solution Manual]
Introduction to Signal Processing Orfanidis [Solution Manual]Introduction to Signal Processing Orfanidis [Solution Manual]
Introduction to Signal Processing Orfanidis [Solution Manual]
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plotting
 

Recently uploaded

[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
nooriasukmaningtyas
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
PauloRodrigues104553
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 

Recently uploaded (20)

[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 

Matlab Señales Discretas

  • 1. Sampling of Continuous Signals in MATLAB All signals in MATLAB are discrete-time, but they will look like continuous-time signals if the sampling rate is much higher than the Nyquist rate. Example (1): We want to sample a function: x = sin(2 pi f t), where f = 2 kHz and plot the samples values on a graph. Let x1 be the signal sampled at 10 kHz. Let x2 be the signal sampled at 3 kHz. Solution: f = 2000; T = 1/f; tmin = 0; 1 tmax = 5*T; % Plot 5 cycles 0.5 dt1 = 1/10000; 0 dt2 = 1/3000; -0.5 t1 = tmin:dt1:tmax; -1 t2 = tmin:dt2:tmax; 0 0.5 1 1.5 2 2.5 x 10-3 x1 = sin(2*pi*f*t1); x2 = sin(2*pi*f*t2); subplot(211) stem(t1,x1); subplot(212) stem(t2,x2); 0 0.5 1 1.5 2 2.5 x 10-3 1 0.5 0 -0.5 -1 Note: STEM Discrete sequence or "stem" plot. STEM(Y): 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.
  • 2. Example (2): We want to sample a function: x = sin(2 pi f t), where f = 2 kHz and display the samples values in a vector. Let x1 be the signal sampled at 10 kHz. Let x2 be the signal sampled at 3 kHz. Solution: % Sample the sinusoid x = sin(2 pi f t), where f = 2 kHz, and plot the sampled signals over the continuous-time signal. % Let x1 be the signal sampled at 10 kHz. % Let x2 be the signal sampled at 3 kHz. f = 2000; T = 1/f; tmin = 0; tmax = 5*T; %Sampling rate dt1 = 1/10000; dt2 = 1/3000; for t1 = tmin:dt1:tmax i=1; x1(i) = sin(2*pi*f*t1); i=i+1; end; disp(x1); for t2 = tmin:dt2:tmax; j=1; x2(j) = sin(2*pi*f*t2); j=j+1; end; disp(x2);
  • 3. X1: Columns 1 through 7 -0.0000 0.9511 0.5878 -0.5878 -0.9511 -0.0000 0.9511 Columns 8 through 14 0.5878 -0.5878 -0.9511 -0.0000 0.9511 0.5878 -0.5878 Columns 15 through 21 -0.9511 -0.0000 0.9511 0.5878 -0.5878 -0.9511 -0.0000 Columns 22 through 26 0.9511 0.5878 -0.5878 -0.9511 -0.0000 X2: Columns 1 through 7 -0.8660 -0.8660 0.8660 -0.0000 -0.8660 0.8660 -0.0000 Column 8 -0.8660
  • 4. Example (3): We want to sample a function: x = sin(2 pi f t), where f = 2 kHz and plot the samples values on a graph containing the original signal. Let x1 be the signal sampled at 10 kHz. Let x2 be the signal sampled at 3 kHz. Solution: % Sample the sinusoid x = sin(2 pi f t), where f = 2 kHz, and plot the sampled % signals over the continuous-time signal. % Let x1 be the signal sampled at 10 kHz. % Let x2 be the signal sampled at 3 kHz. f = 2000; T = 1/f; tmin = 0; tmax = 5*T; dt = T/100; % take 100 points within each cycle % for an accurate plot use sufficient points within one cycle (100,200,500…) Increasing ‘dt’ will decrease the accuracy t = tmin:dt:tmax; x = sin(2*pi*f*t); dt1 = 1/10000; dt2 = 1/3000; t1 = tmin:dt1:tmax; t2 = tmin:dt2:tmax; x1 = sin(2*pi*f*t1); x2 = sin(2*pi*f*t2); subplot(211) plot(t,x,'r'); hold on stem(t1,x1); % to display the samples on the original plot subplot(212) plot(t,x,'r'); hold on stem(t2,x2); % to display the samples on the original plot
  • 5. 0 0.5 1 1.5 2 2.5 x 10-3 1 0.5 0 -0.5 -1 0 0.5 1 1.5 2 2.5 x 10-3 1 0.5 0 -0.5 -1
  • 6. MATLAB treatment of audio signals Recording an audio signal via a microphone: y = audiorecorder After you create an audiorecorder object, you can use the methods listed below on that object.  record(y) Starts recording  record(y,length) Records for length number of seconds.  stop(y) Stops recording  pause(y) Pauses recording  resume(y) Restarts recording from where recording was paused.  play(y) Creates an audioplayer, plays the recorded audio data, and returns a handle to the created audioplayer. Reading an audio file .wav  y = wavread(filename) loads a WAVE file specified by filename, returning the sampled data in y.  [y, Fs, nbits] = wavread(filename) returns the sample rate (Fs) in Hertz and the number of bits per sample (nbits) used to encode the data in the file.