SlideShare a Scribd company logo
1 of 11
Download to read offline
Lab Task 2 Syed Abuzar DSP
1
Lab Report:
Submitted By :
Syed Abuzar Hussain Shah
Reg #
SP15-BEE-096
Submitted To:
Sir Usman
Class:
BEE-5A
Dated: 30/03/2017
Lab Task 2 Syed Abuzar DSP
2
Introduction:
In today’s Lab we will take a continuous time signal and sample it out with a fixed
sampling time
period and analyze its frequency response at each point.
Commands to be used:
• plot
• real
• exp
• imag
• Abs
• phase
• diff
• sin/cos
• hold on/off
Task:
Take a continuous time sinusoidal with a cut off frequency of 50 Hz with a
simulated sampling
frequency of 1000. Analyse its frequency spectrum using “fft”.
clc
clear all
close all
fn=50;
fs=1000;
N=1200;
t=(-100:100)*1/fs;
x=sin(2*pi*fn*t);
subplot(241)
plot(t*1000,x)
title(['fn = ' num2str(fn) 'Hz fs = ' num2str(fs) 'Hz'])
ylabel('x(t)')
xlabel('ms')
axis([-30 30 -2 2])
grid on;
Lab Task 2 Syed Abuzar DSP
3
fsq=2*fn;
x1=square(2*pi*fsq*t);
subplot(242)
plot(t*1000,x1)
axis([-30 30 -2 2])
title(['fsq = ' num2str(fsq) 'Hz'])
ylabel('x1(t)')
xlabel('ms')
grid on;
imp=abs(diff(x1))/2;
subplot(243)
stem(t*1000,[imp 0])
title(['impulse'])
ylabel(' delta(t)')
xlabel('ms')
axis([-30 30 -1 3])
grid on;
k=1;
for i=1:length(imp)
if(imp(i)==1)
y(i)=imp(i)*x(i);
z(k)=y(i);
k=k+1;
end
end
subplot(244)
stem(t*1000,[y 0])
hold on;
plot(t*1000,x,'r');
title(['Sampled Data'])
ylabel(' y(t)=x(t).delta(t)')
xlabel('ms')
axis([-30 30 -2 2])
grid on;
om=linspace(-fs/2,fs/2,N);
Lab Task 2 Syed Abuzar DSP
4
h=fft(x,N);
z=fftshift(h);
subplot(245)
plot(om,abs(z))
title(['fft of sinosidal wave'])
ylabel(' |X(jOmega)|')
xlabel('Omega(rad/sec)')
grid on;
h=fft(x1,N);
z=fftshift(h);
subplot(246)
plot(om,abs(z))
title(['fft of square wave'])
ylabel(' |X1(jOmega)|')
xlabel('Omega(rad/sec)')
grid on;
h=fft(imp,N);
z=fftshift(h);
subplot(247)
plot(om,abs(z))
title(['fft of impulse'])
ylabel(' |S(jOmega)|')
xlabel('Omega(rad/sec)')
grid on;
h=fft(y,N);
z=fftshift(h);
subplot(248)
plot(om/(2*fsq*pi),abs(z))
title(['fft of Y(jOmega)'])
ylabel(' Y(jOmega)=X(jOmega)*S(jOmega)')
xlabel('Omega(rad/sec)')
grid on;
Lab Task 2 Syed Abuzar DSP
5
Output:
Now generate a square wave with frequency “3fn/2” and repeat all steps.
clc
clear all
close all
fn=50;
fs=1000;
N=1200;
t=(-100:100)*1/fs;
x=sin(2*pi*fn*t);
subplot(241)
plot(t*1000,x)
title(['fn = ' num2str(fn) 'Hz fs = ' num2str(fs) 'Hz'])
ylabel('x(t)')
xlabel('ms')
axis([-30 30 -2 2])
grid on;
fsq=(3*fn)/2;
x1=square(2*pi*fsq*t);
subplot(242)
Lab Task 2 Syed Abuzar DSP
6
plot(t*1000,x1)
axis([-30 30 -2 2])
title(['fsq = ' num2str(fsq) 'Hz'])
ylabel('x1(t)')
xlabel('ms')
grid on;
imp=abs(diff(x1))/2;
subplot(243)
stem(t*1000,[imp 0])
title(['impulse'])
ylabel(' delta(t)')
xlabel('ms')
axis([-30 30 -1 3])
grid on;
k=1;
for i=1:length(imp)
if(imp(i)==1)
y(i)=imp(i)*x(i);
z(k)=y(i);
k=k+1;
end
end
subplot(244)
stem(t*1000,[y 0])
hold on;
plot(t*1000,x,'r');
title(['Sampled Data'])
ylabel(' y(t)=x(t).delta(t)')
xlabel('ms')
axis([-30 30 -2 2])
grid on;
om=linspace(-fs/2,fs/2,N);
h=fft(x,N);
z=fftshift(h);
subplot(245)
plot(om,abs(z))
Lab Task 2 Syed Abuzar DSP
7
title(['fft of sinosidal wave'])
ylabel(' |X(jOmega)|')
xlabel('Omega(rad/sec)')
grid on;
h=fft(x1,N);
z=fftshift(h);
subplot(246)
plot(om,abs(z))
title(['fft of square wave'])
ylabel(' |X1(jOmega)|')
xlabel('Omega(rad/sec)')
grid on;
h=fft(imp,N);
z=fftshift(h);
subplot(247)
plot(om,abs(z))
title(['fft of impulse'])
ylabel(' |S(jOmega)|')
xlabel('Omega(rad/sec)')
grid on;
h=fft(y,N);
z=fftshift(h);
subplot(248)
plot(om/(2*fsq*pi),abs(z))
title(['fft of Y(jOmega)'])
ylabel(' Y(jOmega)=X(jOmega)*S(jOmega)')
xlabel('Omega(rad/sec)')
grid on;
Lab Task 2 Syed Abuzar DSP
8
Output:
Now generate a square wave with frequency “5fn” and repeat all steps.
clc
clear all
close all
fn=50;
fs=1000;
N=1200;
t=(-100:100)*1/fs;
x=sin(2*pi*fn*t);
subplot(241)
plot(t*1000,x)
title(['fn = ' num2str(fn) 'Hz fs = ' num2str(fs) 'Hz'])
ylabel('x(t)')
xlabel('ms')
axis([-30 30 -2 2])
grid on;
fsq=5*fn;
x1=square(2*pi*fsq*t);
Lab Task 2 Syed Abuzar DSP
9
subplot(242)
plot(t*1000,x1)
axis([-30 30 -2 2])
title(['fsq = ' num2str(fsq) 'Hz'])
ylabel('x1(t)')
xlabel('ms')
grid on;
imp=abs(diff(x1))/2;
subplot(243)
stem(t*1000,[imp 0])
title(['impulse'])
ylabel(' delta(t)')
xlabel('ms')
axis([-30 30 -1 3])
grid on;
k=1;
for i=1:length(imp)
if(imp(i)==1)
y(i)=imp(i)*x(i);
z(k)=y(i);
k=k+1;
end
end
subplot(244)
stem(t*1000,[y 0])
hold on;
plot(t*1000,x,'r');
title(['Sampled Data'])
ylabel(' y(t)=x(t).delta(t)')
xlabel('ms')
axis([-30 30 -2 2])
grid on;
om=linspace(-fs/2,fs/2,N);
h=fft(x,N);
z=fftshift(h);
subplot(245)
Lab Task 2 Syed Abuzar DSP
10
plot(om,abs(z))
title(['fft of sinosidal wave'])
ylabel(' |X(jOmega)|')
xlabel('Omega(rad/sec)')
grid on;
h=fft(x1,N);
z=fftshift(h);
subplot(246)
plot(om,abs(z))
title(['fft of square wave'])
ylabel(' |X1(jOmega)|')
xlabel('Omega(rad/sec)')
grid on;
h=fft(imp,N);
z=fftshift(h);
subplot(247)
plot(om,abs(z))
title(['fft of impulse'])
ylabel(' |S(jOmega)|')
xlabel('Omega(rad/sec)')
grid on;
h=fft(y,N);
z=fftshift(h);
subplot(248)
plot(om/(2*fsq*pi),abs(z))
title(['fft of Y(jOmega)'])
ylabel(' Y(jOmega)=X(jOmega)*S(jOmega)')
xlabel('Omega(rad/sec)')
grid on;
Lab Task 2 Syed Abuzar DSP
11
Output:
Questions:
Q1. Provide your analysis for the changed frequency of Impulse train.
Ans: When we change the frequency of the square wave, the frequency of impulse
train also changes. When frequency of impulse train increases, number of samples
taken also increases so more information is stored.
Q2: Explain if you observe under or over sampling .
Ans: When I took samples according to Niquous Criteria (fsq=2fn), I observed
over sampling (fsq=5fn) but when I taken fsq=1.5fn I observed under sampling.In
Over sampling no data is lost but in under sampling we lose information.
Conclusion:
In this lab I learnt the difference between the oversampling and undersampling.
The frequency of impulse train has main role in under and over sampling. If
frequency is increased, sampling time also increases so we have more information
about the signal.

More Related Content

What's hot

C++ AMP 실천 및 적용 전략
C++ AMP 실천 및 적용 전략 C++ AMP 실천 및 적용 전략
C++ AMP 실천 및 적용 전략 명신 김
 
型理論 なんて自分には関係ないと思っているあなたへ
型理論 なんて自分には関係ないと思っているあなたへ型理論 なんて自分には関係ないと思っているあなたへ
型理論 なんて自分には関係ないと思っているあなたへYusuke Matsushita
 
Java Time Puzzlers
Java Time PuzzlersJava Time Puzzlers
Java Time PuzzlersEric Jain
 
Building Efficient and Highly Run-Time Adaptable Virtual Machines
Building Efficient and Highly Run-Time Adaptable Virtual MachinesBuilding Efficient and Highly Run-Time Adaptable Virtual Machines
Building Efficient and Highly Run-Time Adaptable Virtual MachinesGuido Chari
 
Original NPN Transistor KTC3875S-Y-RTK 150mA 60V SOT-23 ALO ALY SMD Code New
Original NPN Transistor KTC3875S-Y-RTK 150mA 60V SOT-23 ALO ALY SMD Code NewOriginal NPN Transistor KTC3875S-Y-RTK 150mA 60V SOT-23 ALO ALY SMD Code New
Original NPN Transistor KTC3875S-Y-RTK 150mA 60V SOT-23 ALO ALY SMD Code Newauthelectroniccom
 
A Speculative Technique for Auto-Memoization Processor with Multithreading
A Speculative Technique for Auto-Memoization Processor with MultithreadingA Speculative Technique for Auto-Memoization Processor with Multithreading
A Speculative Technique for Auto-Memoization Processor with MultithreadingMatsuo and Tsumura lab.
 
Introduction of GPS BPSK-R and BOC
Introduction of GPS BPSK-R and BOCIntroduction of GPS BPSK-R and BOC
Introduction of GPS BPSK-R and BOCPei-Che Chang
 
第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -Wataru Kani
 
How to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITHow to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITEgor Bogatov
 
Sheet with useful_formulas
Sheet with useful_formulasSheet with useful_formulas
Sheet with useful_formulasHoopeer Hoopeer
 
4 Type conversion functions
4 Type conversion functions4 Type conversion functions
4 Type conversion functionsDocent Education
 

What's hot (17)

C++ AMP 실천 및 적용 전략
C++ AMP 실천 및 적용 전략 C++ AMP 실천 및 적용 전략
C++ AMP 실천 및 적용 전략
 
型理論 なんて自分には関係ないと思っているあなたへ
型理論 なんて自分には関係ないと思っているあなたへ型理論 なんて自分には関係ないと思っているあなたへ
型理論 なんて自分には関係ないと思っているあなたへ
 
Java Time Puzzlers
Java Time PuzzlersJava Time Puzzlers
Java Time Puzzlers
 
Lec06
Lec06Lec06
Lec06
 
Ecg programa simulado
Ecg programa simuladoEcg programa simulado
Ecg programa simulado
 
Building Efficient and Highly Run-Time Adaptable Virtual Machines
Building Efficient and Highly Run-Time Adaptable Virtual MachinesBuilding Efficient and Highly Run-Time Adaptable Virtual Machines
Building Efficient and Highly Run-Time Adaptable Virtual Machines
 
Original NPN Transistor KTC3875S-Y-RTK 150mA 60V SOT-23 ALO ALY SMD Code New
Original NPN Transistor KTC3875S-Y-RTK 150mA 60V SOT-23 ALO ALY SMD Code NewOriginal NPN Transistor KTC3875S-Y-RTK 150mA 60V SOT-23 ALO ALY SMD Code New
Original NPN Transistor KTC3875S-Y-RTK 150mA 60V SOT-23 ALO ALY SMD Code New
 
A Speculative Technique for Auto-Memoization Processor with Multithreading
A Speculative Technique for Auto-Memoization Processor with MultithreadingA Speculative Technique for Auto-Memoization Processor with Multithreading
A Speculative Technique for Auto-Memoization Processor with Multithreading
 
Ray tracing with ZIO-ZLayer
Ray tracing with ZIO-ZLayerRay tracing with ZIO-ZLayer
Ray tracing with ZIO-ZLayer
 
Ray Tracing with ZIO
Ray Tracing with ZIORay Tracing with ZIO
Ray Tracing with ZIO
 
Introduction of GPS BPSK-R and BOC
Introduction of GPS BPSK-R and BOCIntroduction of GPS BPSK-R and BOC
Introduction of GPS BPSK-R and BOC
 
第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -第一回 冬のスイッチ大勉強会 - XBee編 -
第一回 冬のスイッチ大勉強会 - XBee編 -
 
PSpice Simulation Resault
PSpice Simulation ResaultPSpice Simulation Resault
PSpice Simulation Resault
 
How to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJITHow to add an optimization for C# to RyuJIT
How to add an optimization for C# to RyuJIT
 
Jan 2012 HUG: RHadoop
Jan 2012 HUG: RHadoopJan 2012 HUG: RHadoop
Jan 2012 HUG: RHadoop
 
Sheet with useful_formulas
Sheet with useful_formulasSheet with useful_formulas
Sheet with useful_formulas
 
4 Type conversion functions
4 Type conversion functions4 Type conversion functions
4 Type conversion functions
 

Similar to Sampling

Matlab 2
Matlab 2Matlab 2
Matlab 2asguna
 
DSP LAB COMPLETE CODES.docx
DSP LAB COMPLETE CODES.docxDSP LAB COMPLETE CODES.docx
DSP LAB COMPLETE CODES.docxMUMAR57
 
Basic simulation lab manual1
Basic simulation lab manual1Basic simulation lab manual1
Basic simulation lab manual1Janardhana Raju M
 
Numerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special FunctionsNumerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special FunctionsAmos Tsai
 
EC8553 Discrete time signal processing
EC8553 Discrete time signal processing EC8553 Discrete time signal processing
EC8553 Discrete time signal processing ssuser2797e4
 
Compte rendu com op touati
Compte rendu com op touatiCompte rendu com op touati
Compte rendu com op touatihamdinho
 
Fourier series example
Fourier series exampleFourier series example
Fourier series exampleAbi finni
 
Capitulo 12, 7ma edición
Capitulo 12, 7ma ediciónCapitulo 12, 7ma edición
Capitulo 12, 7ma ediciónSohar Carr
 
Matlab fair-record-model
Matlab fair-record-modelMatlab fair-record-model
Matlab fair-record-modelajaydev1111
 
Машинное обучение на JS. С чего начать и куда идти | Odessa Frontend Meetup #12
Машинное обучение на JS. С чего начать и куда идти | Odessa Frontend Meetup #12Машинное обучение на JS. С чего начать и куда идти | Odessa Frontend Meetup #12
Машинное обучение на JS. С чего начать и куда идти | Odessa Frontend Meetup #12OdessaFrontend
 
SolutionsPlease see answer in bold letters.Note pi = 3.14.docx
SolutionsPlease see answer in bold letters.Note pi = 3.14.docxSolutionsPlease see answer in bold letters.Note pi = 3.14.docx
SolutionsPlease see answer in bold letters.Note pi = 3.14.docxrafbolet0
 

Similar to Sampling (20)

Reconstruction
ReconstructionReconstruction
Reconstruction
 
Matlab 2
Matlab 2Matlab 2
Matlab 2
 
Dsp Lab Record
Dsp Lab RecordDsp Lab Record
Dsp Lab Record
 
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
 
Numerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special FunctionsNumerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special Functions
 
Multirate sim
Multirate simMultirate sim
Multirate sim
 
Dsp manual
Dsp manualDsp manual
Dsp manual
 
FFT
FFTFFT
FFT
 
EC8553 Discrete time signal processing
EC8553 Discrete time signal processing EC8553 Discrete time signal processing
EC8553 Discrete time signal processing
 
Compte rendu com op touati
Compte rendu com op touatiCompte rendu com op touati
Compte rendu com op touati
 
Fourier series example
Fourier series exampleFourier series example
Fourier series example
 
Capitulo 12, 7ma edición
Capitulo 12, 7ma ediciónCapitulo 12, 7ma edición
Capitulo 12, 7ma edición
 
Matlab fair-record-model
Matlab fair-record-modelMatlab fair-record-model
Matlab fair-record-model
 
Dsp iit workshop
Dsp iit workshopDsp iit workshop
Dsp iit workshop
 
Машинное обучение на JS. С чего начать и куда идти | Odessa Frontend Meetup #12
Машинное обучение на JS. С чего начать и куда идти | Odessa Frontend Meetup #12Машинное обучение на JS. С чего начать и куда идти | Odessa Frontend Meetup #12
Машинное обучение на JS. С чего начать и куда идти | Odessa Frontend Meetup #12
 
NWD the73js.pptx
NWD the73js.pptxNWD the73js.pptx
NWD the73js.pptx
 
Ecg
EcgEcg
Ecg
 
SolutionsPlease see answer in bold letters.Note pi = 3.14.docx
SolutionsPlease see answer in bold letters.Note pi = 3.14.docxSolutionsPlease see answer in bold letters.Note pi = 3.14.docx
SolutionsPlease see answer in bold letters.Note pi = 3.14.docx
 
Dsp manual
Dsp manualDsp manual
Dsp manual
 

More from COMSATS Abbottabad

Analysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemAnalysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemCOMSATS Abbottabad
 
coding and burning program in FPGA
coding and burning program in FPGAcoding and burning program in FPGA
coding and burning program in FPGACOMSATS Abbottabad
 
Fabrication process of Integrated Circuit (IC's)
Fabrication process of Integrated Circuit (IC's)Fabrication process of Integrated Circuit (IC's)
Fabrication process of Integrated Circuit (IC's)COMSATS Abbottabad
 
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086COMSATS Abbottabad
 
implementation of data instrucions in emu8086
implementation of data instrucions in emu8086implementation of data instrucions in emu8086
implementation of data instrucions in emu8086COMSATS Abbottabad
 
Addition, subtraction and multiplication in assembly language
Addition, subtraction and multiplication in assembly languageAddition, subtraction and multiplication in assembly language
Addition, subtraction and multiplication in assembly languageCOMSATS Abbottabad
 
Mathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electro-Mechanical System in MatlabMathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electro-Mechanical System in MatlabCOMSATS Abbottabad
 
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 MATLABCOMSATS Abbottabad
 
Aurduino coding for transformer interfacing
Aurduino coding for transformer interfacingAurduino coding for transformer interfacing
Aurduino coding for transformer interfacingCOMSATS Abbottabad
 
Transformer Interfacing with Laptop
Transformer Interfacing with LaptopTransformer Interfacing with Laptop
Transformer Interfacing with LaptopCOMSATS Abbottabad
 
Temperature control Switch and Display By Led
Temperature control Switch and Display By LedTemperature control Switch and Display By Led
Temperature control Switch and Display By LedCOMSATS Abbottabad
 

More from COMSATS Abbottabad (20)

Kalman filter
Kalman filterKalman filter
Kalman filter
 
Enterpreneurship
EnterpreneurshipEnterpreneurship
Enterpreneurship
 
Sine wave inverter
Sine wave inverterSine wave inverter
Sine wave inverter
 
Light Tracking Solar Panel
Light Tracking Solar PanelLight Tracking Solar Panel
Light Tracking Solar Panel
 
Analysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemAnalysis of Electro-Mechanical System
Analysis of Electro-Mechanical System
 
coding and burning program in FPGA
coding and burning program in FPGAcoding and burning program in FPGA
coding and burning program in FPGA
 
8 bit full adder
8 bit full adder8 bit full adder
8 bit full adder
 
Fabrication process of Integrated Circuit (IC's)
Fabrication process of Integrated Circuit (IC's)Fabrication process of Integrated Circuit (IC's)
Fabrication process of Integrated Circuit (IC's)
 
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
 
implementation of data instrucions in emu8086
implementation of data instrucions in emu8086implementation of data instrucions in emu8086
implementation of data instrucions in emu8086
 
Addition, subtraction and multiplication in assembly language
Addition, subtraction and multiplication in assembly languageAddition, subtraction and multiplication in assembly language
Addition, subtraction and multiplication in assembly language
 
Mathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electro-Mechanical System in MatlabMathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electro-Mechanical System in Matlab
 
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
 
Introduction to MATLAB
Introduction to MATLAB Introduction to MATLAB
Introduction to MATLAB
 
Encoder + decoder
Encoder + decoderEncoder + decoder
Encoder + decoder
 
Principles of Communication
Principles of CommunicationPrinciples of Communication
Principles of Communication
 
Aurduino coding for transformer interfacing
Aurduino coding for transformer interfacingAurduino coding for transformer interfacing
Aurduino coding for transformer interfacing
 
Transformer Interfacing with Laptop
Transformer Interfacing with LaptopTransformer Interfacing with Laptop
Transformer Interfacing with Laptop
 
Temperature control Switch and Display By Led
Temperature control Switch and Display By LedTemperature control Switch and Display By Led
Temperature control Switch and Display By Led
 
stress and strain
stress and strainstress and strain
stress and strain
 

Recently uploaded

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
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...ranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
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 NashikCall Girls in Nagpur High Profile
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
(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...ranjana rawat
 
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
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
(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...ranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
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
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
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
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 

Recently uploaded (20)

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune 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...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
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
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
(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 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
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
(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...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
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
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
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...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 

Sampling

  • 1. Lab Task 2 Syed Abuzar DSP 1 Lab Report: Submitted By : Syed Abuzar Hussain Shah Reg # SP15-BEE-096 Submitted To: Sir Usman Class: BEE-5A Dated: 30/03/2017
  • 2. Lab Task 2 Syed Abuzar DSP 2 Introduction: In today’s Lab we will take a continuous time signal and sample it out with a fixed sampling time period and analyze its frequency response at each point. Commands to be used: • plot • real • exp • imag • Abs • phase • diff • sin/cos • hold on/off Task: Take a continuous time sinusoidal with a cut off frequency of 50 Hz with a simulated sampling frequency of 1000. Analyse its frequency spectrum using “fft”. clc clear all close all fn=50; fs=1000; N=1200; t=(-100:100)*1/fs; x=sin(2*pi*fn*t); subplot(241) plot(t*1000,x) title(['fn = ' num2str(fn) 'Hz fs = ' num2str(fs) 'Hz']) ylabel('x(t)') xlabel('ms') axis([-30 30 -2 2]) grid on;
  • 3. Lab Task 2 Syed Abuzar DSP 3 fsq=2*fn; x1=square(2*pi*fsq*t); subplot(242) plot(t*1000,x1) axis([-30 30 -2 2]) title(['fsq = ' num2str(fsq) 'Hz']) ylabel('x1(t)') xlabel('ms') grid on; imp=abs(diff(x1))/2; subplot(243) stem(t*1000,[imp 0]) title(['impulse']) ylabel(' delta(t)') xlabel('ms') axis([-30 30 -1 3]) grid on; k=1; for i=1:length(imp) if(imp(i)==1) y(i)=imp(i)*x(i); z(k)=y(i); k=k+1; end end subplot(244) stem(t*1000,[y 0]) hold on; plot(t*1000,x,'r'); title(['Sampled Data']) ylabel(' y(t)=x(t).delta(t)') xlabel('ms') axis([-30 30 -2 2]) grid on; om=linspace(-fs/2,fs/2,N);
  • 4. Lab Task 2 Syed Abuzar DSP 4 h=fft(x,N); z=fftshift(h); subplot(245) plot(om,abs(z)) title(['fft of sinosidal wave']) ylabel(' |X(jOmega)|') xlabel('Omega(rad/sec)') grid on; h=fft(x1,N); z=fftshift(h); subplot(246) plot(om,abs(z)) title(['fft of square wave']) ylabel(' |X1(jOmega)|') xlabel('Omega(rad/sec)') grid on; h=fft(imp,N); z=fftshift(h); subplot(247) plot(om,abs(z)) title(['fft of impulse']) ylabel(' |S(jOmega)|') xlabel('Omega(rad/sec)') grid on; h=fft(y,N); z=fftshift(h); subplot(248) plot(om/(2*fsq*pi),abs(z)) title(['fft of Y(jOmega)']) ylabel(' Y(jOmega)=X(jOmega)*S(jOmega)') xlabel('Omega(rad/sec)') grid on;
  • 5. Lab Task 2 Syed Abuzar DSP 5 Output: Now generate a square wave with frequency “3fn/2” and repeat all steps. clc clear all close all fn=50; fs=1000; N=1200; t=(-100:100)*1/fs; x=sin(2*pi*fn*t); subplot(241) plot(t*1000,x) title(['fn = ' num2str(fn) 'Hz fs = ' num2str(fs) 'Hz']) ylabel('x(t)') xlabel('ms') axis([-30 30 -2 2]) grid on; fsq=(3*fn)/2; x1=square(2*pi*fsq*t); subplot(242)
  • 6. Lab Task 2 Syed Abuzar DSP 6 plot(t*1000,x1) axis([-30 30 -2 2]) title(['fsq = ' num2str(fsq) 'Hz']) ylabel('x1(t)') xlabel('ms') grid on; imp=abs(diff(x1))/2; subplot(243) stem(t*1000,[imp 0]) title(['impulse']) ylabel(' delta(t)') xlabel('ms') axis([-30 30 -1 3]) grid on; k=1; for i=1:length(imp) if(imp(i)==1) y(i)=imp(i)*x(i); z(k)=y(i); k=k+1; end end subplot(244) stem(t*1000,[y 0]) hold on; plot(t*1000,x,'r'); title(['Sampled Data']) ylabel(' y(t)=x(t).delta(t)') xlabel('ms') axis([-30 30 -2 2]) grid on; om=linspace(-fs/2,fs/2,N); h=fft(x,N); z=fftshift(h); subplot(245) plot(om,abs(z))
  • 7. Lab Task 2 Syed Abuzar DSP 7 title(['fft of sinosidal wave']) ylabel(' |X(jOmega)|') xlabel('Omega(rad/sec)') grid on; h=fft(x1,N); z=fftshift(h); subplot(246) plot(om,abs(z)) title(['fft of square wave']) ylabel(' |X1(jOmega)|') xlabel('Omega(rad/sec)') grid on; h=fft(imp,N); z=fftshift(h); subplot(247) plot(om,abs(z)) title(['fft of impulse']) ylabel(' |S(jOmega)|') xlabel('Omega(rad/sec)') grid on; h=fft(y,N); z=fftshift(h); subplot(248) plot(om/(2*fsq*pi),abs(z)) title(['fft of Y(jOmega)']) ylabel(' Y(jOmega)=X(jOmega)*S(jOmega)') xlabel('Omega(rad/sec)') grid on;
  • 8. Lab Task 2 Syed Abuzar DSP 8 Output: Now generate a square wave with frequency “5fn” and repeat all steps. clc clear all close all fn=50; fs=1000; N=1200; t=(-100:100)*1/fs; x=sin(2*pi*fn*t); subplot(241) plot(t*1000,x) title(['fn = ' num2str(fn) 'Hz fs = ' num2str(fs) 'Hz']) ylabel('x(t)') xlabel('ms') axis([-30 30 -2 2]) grid on; fsq=5*fn; x1=square(2*pi*fsq*t);
  • 9. Lab Task 2 Syed Abuzar DSP 9 subplot(242) plot(t*1000,x1) axis([-30 30 -2 2]) title(['fsq = ' num2str(fsq) 'Hz']) ylabel('x1(t)') xlabel('ms') grid on; imp=abs(diff(x1))/2; subplot(243) stem(t*1000,[imp 0]) title(['impulse']) ylabel(' delta(t)') xlabel('ms') axis([-30 30 -1 3]) grid on; k=1; for i=1:length(imp) if(imp(i)==1) y(i)=imp(i)*x(i); z(k)=y(i); k=k+1; end end subplot(244) stem(t*1000,[y 0]) hold on; plot(t*1000,x,'r'); title(['Sampled Data']) ylabel(' y(t)=x(t).delta(t)') xlabel('ms') axis([-30 30 -2 2]) grid on; om=linspace(-fs/2,fs/2,N); h=fft(x,N); z=fftshift(h); subplot(245)
  • 10. Lab Task 2 Syed Abuzar DSP 10 plot(om,abs(z)) title(['fft of sinosidal wave']) ylabel(' |X(jOmega)|') xlabel('Omega(rad/sec)') grid on; h=fft(x1,N); z=fftshift(h); subplot(246) plot(om,abs(z)) title(['fft of square wave']) ylabel(' |X1(jOmega)|') xlabel('Omega(rad/sec)') grid on; h=fft(imp,N); z=fftshift(h); subplot(247) plot(om,abs(z)) title(['fft of impulse']) ylabel(' |S(jOmega)|') xlabel('Omega(rad/sec)') grid on; h=fft(y,N); z=fftshift(h); subplot(248) plot(om/(2*fsq*pi),abs(z)) title(['fft of Y(jOmega)']) ylabel(' Y(jOmega)=X(jOmega)*S(jOmega)') xlabel('Omega(rad/sec)') grid on;
  • 11. Lab Task 2 Syed Abuzar DSP 11 Output: Questions: Q1. Provide your analysis for the changed frequency of Impulse train. Ans: When we change the frequency of the square wave, the frequency of impulse train also changes. When frequency of impulse train increases, number of samples taken also increases so more information is stored. Q2: Explain if you observe under or over sampling . Ans: When I took samples according to Niquous Criteria (fsq=2fn), I observed over sampling (fsq=5fn) but when I taken fsq=1.5fn I observed under sampling.In Over sampling no data is lost but in under sampling we lose information. Conclusion: In this lab I learnt the difference between the oversampling and undersampling. The frequency of impulse train has main role in under and over sampling. If frequency is increased, sampling time also increases so we have more information about the signal.