SlideShare a Scribd company logo
clear
clc
% Practical : Exp-4 Title: Sampling Theorem
% Name: Omkar Rane
% Batch: 1 Block : 1
% Roll No: SETB118
% Seat No: S177086
%a). To analyze undersampled and oversampled signals.
%_________________________________________________________________________%
a=1;
t=0:1/2000:0.02;
y=a*cos(2*pi*60*t);
subplot(311);
plot(t,y);
xlabel('t');
ylabel('A');
title('Continous cosine');
%________________________________________________________________________%
a=1;
t240 = 0:1/240:0.02;
n240=0:(length(t240)-1);
ts1=1/240;
y=a*cos(2*pi*60*ts1*n240);
subplot(312);
stem(n240,y);
xlabel('t');
ylabel('A');
title('discrete cos for sampling rate 240');
%________________________________________________________________________%
a=1;
t1000 = 0:1/1000:0.02;
n1000=0:(length(t1000)-1);
ts1=1/1000;
y=a*cos(2*pi*60*ts1*n1000);
subplot(313);
stem(n1000,y);
xlabel('t');
ylabel('A');
title('discrete cos for sampling rate 1000');
%________________________________________________________________________%
Output:-
clear
clc
%lab-4 part 2
% Practical : Exp-4 Title: Sampling Theorem
% Name: Omkar Rane
% Batch: 1 Block : 1
% Roll No: SETB118
% Seat No: S177086
%b). To comment on reconstructed signal while observing sampling signal.
%_________________________________________________________________________%
tf=0.05;
t=0:0.00005:tf;
f1=input('enter frequency 1 :');
f2=input('enter frequency 2 :');
f3=input('enter frequency 3 :');
fs=input('Enter Sampling frequency :');
ts=1/fs;
n=0:tf*fs;
q=n*ts;
xt1=cos(2*pi*f1*t);
xt2=cos(2*pi*f2*t);
xt3=cos(2*pi*f3*t);
xt=xt1+xt2+xt3;
xn=cos(2*pi*f1*q)+cos(2*pi*f2*q)+cos(2*pi*f3*q);
subplot(2,2,1);
plot(t,xt);
xlabel('t');
ylabel('A');
title('Original Continous Signal');
subplot(222);
stem(n,xn);
xlabel('t');
ylabel('A');
title('Discrete signal of original');
Output:
%lab-4 part 2
clear
clc
% Practical : Exp-4 Title: Sampling Theorem
% Name: Omkar Rane
% Batch: 1 Block : 1
% Roll No: SETB118
% Seat No: S177086
%c). To verify Nyquist criterion.
%_________________________________________________________%
tf=0.05;
t=0:0.00005:tf;
f1=input('enter frquency 1 :');
f2=input('enter frquency 2 :');
f3=input('enter frquency 3 :');
fs=input('Enter Sampling frequency :');
ts=1/fs;
n=0:tf*fs;
q=n*ts;
f=[f1 f2 f3];
fm=max(f);
xt1=cos(2*pi*f1*t);
xt2=cos(2*pi*f2*t);
xt3=cos(2*pi*f3*t);
xt=xt1+xt2+xt3;
xn=cos(2*pi*f1*q)+cos(2*pi*f2*q)+cos(2*pi*f3*q);
xa=xn*sinc(fs*(ones(length(n),1)*t-q'*ones(1,length(t))));
subplot(321);
plot(t,xt);
title('orignal signal');
subplot(322);
stem(q,xn);
title('sampled signal');
subplot(323);
plot(t,xa);
if fs<2*fm
title('reconstructed signal with sampling frequency
less than nyquist criteria ');
elseif fs==2*fm
title('rescontructed signal with sampling frequency
equal to nyquiest criteria');
else
title('Reconstructed signal with sampling frequency
greater than nyquist criteria');
end
Output: -
Condition when sampling frequency less than Nyquist criteria.
Output: -
Condition when sampling frequency equal to Nyquist criteria.
Condition when sampling frequency greater than Nyquist criteria.

More Related Content

More from Omkar Rane

Machine Learning Model for M.S admissions
Machine Learning Model for M.S admissionsMachine Learning Model for M.S admissions
Machine Learning Model for M.S admissions
Omkar Rane
 
Timer 0 programming on LPC 1768
Timer 0 programming on LPC 1768Timer 0 programming on LPC 1768
Timer 0 programming on LPC 1768
Omkar Rane
 
ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768
Omkar Rane
 
PWM based motor speed control using LPC 1768
PWM based motor speed control using LPC 1768PWM based motor speed control using LPC 1768
PWM based motor speed control using LPC 1768
Omkar Rane
 
UART interfacing on LPC1768 (Cortex M3 micro controller)
UART interfacing on LPC1768 (Cortex M3 micro controller)UART interfacing on LPC1768 (Cortex M3 micro controller)
UART interfacing on LPC1768 (Cortex M3 micro controller)
Omkar Rane
 
LED Blinking logic on LPC1768
LED Blinking logic on LPC1768LED Blinking logic on LPC1768
LED Blinking logic on LPC1768
Omkar Rane
 
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
Omkar Rane
 
Vlisi Course project presentation:Keypad Scanner
Vlisi Course project presentation:Keypad ScannerVlisi Course project presentation:Keypad Scanner
Vlisi Course project presentation:Keypad Scanner
Omkar Rane
 
VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner
Omkar Rane
 
LPC 1768 A study on Real Time clock features
LPC 1768 A study on Real Time clock featuresLPC 1768 A study on Real Time clock features
LPC 1768 A study on Real Time clock features
Omkar Rane
 
Nexys4ddr rm FPGA board Datasheet
Nexys4ddr rm  FPGA board DatasheetNexys4ddr rm  FPGA board Datasheet
Nexys4ddr rm FPGA board Datasheet
Omkar Rane
 
Linear Regression (Machine Learning)
Linear Regression (Machine Learning)Linear Regression (Machine Learning)
Linear Regression (Machine Learning)
Omkar Rane
 
transmission gate based design for 2:1 Multiplexer in micro-wind
transmission gate based design for 2:1 Multiplexer in micro-windtransmission gate based design for 2:1 Multiplexer in micro-wind
transmission gate based design for 2:1 Multiplexer in micro-wind
Omkar Rane
 
2:1 Multiplexer using NAND gate in Microwind
2:1 Multiplexer using NAND gate in Microwind 2:1 Multiplexer using NAND gate in Microwind
2:1 Multiplexer using NAND gate in Microwind
Omkar Rane
 
NAND Gate design in microwind
NAND Gate design in microwindNAND Gate design in microwind
NAND Gate design in microwind
Omkar Rane
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.
Omkar Rane
 
Sequence detector for "111"
Sequence detector for "111"Sequence detector for "111"
Sequence detector for "111"
Omkar Rane
 
NOR gate design in microwind
NOR gate design in microwindNOR gate design in microwind
NOR gate design in microwind
Omkar Rane
 
Design of Mux and decoder using VHDL
Design of Mux and decoder using VHDLDesign of Mux and decoder using VHDL
Design of Mux and decoder using VHDL
Omkar Rane
 
Half adder lab in Microwind
Half adder lab in Microwind Half adder lab in Microwind
Half adder lab in Microwind
Omkar Rane
 

More from Omkar Rane (20)

Machine Learning Model for M.S admissions
Machine Learning Model for M.S admissionsMachine Learning Model for M.S admissions
Machine Learning Model for M.S admissions
 
Timer 0 programming on LPC 1768
Timer 0 programming on LPC 1768Timer 0 programming on LPC 1768
Timer 0 programming on LPC 1768
 
ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768ADC (Analog to Digital conversion) using LPC 1768
ADC (Analog to Digital conversion) using LPC 1768
 
PWM based motor speed control using LPC 1768
PWM based motor speed control using LPC 1768PWM based motor speed control using LPC 1768
PWM based motor speed control using LPC 1768
 
UART interfacing on LPC1768 (Cortex M3 micro controller)
UART interfacing on LPC1768 (Cortex M3 micro controller)UART interfacing on LPC1768 (Cortex M3 micro controller)
UART interfacing on LPC1768 (Cortex M3 micro controller)
 
LED Blinking logic on LPC1768
LED Blinking logic on LPC1768LED Blinking logic on LPC1768
LED Blinking logic on LPC1768
 
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
CAN interfacing on LPC1768 (ARM Cortex M3 based Micro controller)
 
Vlisi Course project presentation:Keypad Scanner
Vlisi Course project presentation:Keypad ScannerVlisi Course project presentation:Keypad Scanner
Vlisi Course project presentation:Keypad Scanner
 
VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner VlSI course project report : Keypad Scanner
VlSI course project report : Keypad Scanner
 
LPC 1768 A study on Real Time clock features
LPC 1768 A study on Real Time clock featuresLPC 1768 A study on Real Time clock features
LPC 1768 A study on Real Time clock features
 
Nexys4ddr rm FPGA board Datasheet
Nexys4ddr rm  FPGA board DatasheetNexys4ddr rm  FPGA board Datasheet
Nexys4ddr rm FPGA board Datasheet
 
Linear Regression (Machine Learning)
Linear Regression (Machine Learning)Linear Regression (Machine Learning)
Linear Regression (Machine Learning)
 
transmission gate based design for 2:1 Multiplexer in micro-wind
transmission gate based design for 2:1 Multiplexer in micro-windtransmission gate based design for 2:1 Multiplexer in micro-wind
transmission gate based design for 2:1 Multiplexer in micro-wind
 
2:1 Multiplexer using NAND gate in Microwind
2:1 Multiplexer using NAND gate in Microwind 2:1 Multiplexer using NAND gate in Microwind
2:1 Multiplexer using NAND gate in Microwind
 
NAND Gate design in microwind
NAND Gate design in microwindNAND Gate design in microwind
NAND Gate design in microwind
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.
 
Sequence detector for "111"
Sequence detector for "111"Sequence detector for "111"
Sequence detector for "111"
 
NOR gate design in microwind
NOR gate design in microwindNOR gate design in microwind
NOR gate design in microwind
 
Design of Mux and decoder using VHDL
Design of Mux and decoder using VHDLDesign of Mux and decoder using VHDL
Design of Mux and decoder using VHDL
 
Half adder lab in Microwind
Half adder lab in Microwind Half adder lab in Microwind
Half adder lab in Microwind
 

Recently uploaded

哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
symbo111
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.pptPROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
bhadouriyakaku
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
iemerc2024
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
obonagu
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 
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
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
Kamal Acharya
 
[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
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
dxobcob
 
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
 
AIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdfAIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdf
RicletoEspinosa1
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 

Recently uploaded (20)

哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
Building Electrical System Design & Installation
Building Electrical System Design & InstallationBuilding Electrical System Design & Installation
Building Electrical System Design & Installation
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.pptPROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
PROJECT FORMAT FOR EVS AMITY UNIVERSITY GWALIOR.ppt
 
Self-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptxSelf-Control of Emotions by Slidesgo.pptx
Self-Control of Emotions by Slidesgo.pptx
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.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
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.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
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
 
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
 
AIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdfAIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 

Sampling Theorem (System and signals)

  • 1. clear clc % Practical : Exp-4 Title: Sampling Theorem % Name: Omkar Rane % Batch: 1 Block : 1 % Roll No: SETB118 % Seat No: S177086 %a). To analyze undersampled and oversampled signals. %_________________________________________________________________________% a=1; t=0:1/2000:0.02; y=a*cos(2*pi*60*t); subplot(311); plot(t,y); xlabel('t'); ylabel('A'); title('Continous cosine'); %________________________________________________________________________% a=1; t240 = 0:1/240:0.02; n240=0:(length(t240)-1); ts1=1/240; y=a*cos(2*pi*60*ts1*n240); subplot(312); stem(n240,y); xlabel('t'); ylabel('A'); title('discrete cos for sampling rate 240'); %________________________________________________________________________% a=1; t1000 = 0:1/1000:0.02; n1000=0:(length(t1000)-1); ts1=1/1000; y=a*cos(2*pi*60*ts1*n1000); subplot(313); stem(n1000,y); xlabel('t'); ylabel('A'); title('discrete cos for sampling rate 1000'); %________________________________________________________________________%
  • 3. clear clc %lab-4 part 2 % Practical : Exp-4 Title: Sampling Theorem % Name: Omkar Rane % Batch: 1 Block : 1 % Roll No: SETB118 % Seat No: S177086 %b). To comment on reconstructed signal while observing sampling signal. %_________________________________________________________________________% tf=0.05; t=0:0.00005:tf; f1=input('enter frequency 1 :'); f2=input('enter frequency 2 :'); f3=input('enter frequency 3 :'); fs=input('Enter Sampling frequency :'); ts=1/fs; n=0:tf*fs; q=n*ts; xt1=cos(2*pi*f1*t); xt2=cos(2*pi*f2*t); xt3=cos(2*pi*f3*t); xt=xt1+xt2+xt3; xn=cos(2*pi*f1*q)+cos(2*pi*f2*q)+cos(2*pi*f3*q); subplot(2,2,1); plot(t,xt); xlabel('t'); ylabel('A'); title('Original Continous Signal'); subplot(222); stem(n,xn); xlabel('t'); ylabel('A'); title('Discrete signal of original');
  • 5. %lab-4 part 2 clear clc % Practical : Exp-4 Title: Sampling Theorem % Name: Omkar Rane % Batch: 1 Block : 1 % Roll No: SETB118 % Seat No: S177086 %c). To verify Nyquist criterion. %_________________________________________________________% tf=0.05; t=0:0.00005:tf; f1=input('enter frquency 1 :'); f2=input('enter frquency 2 :'); f3=input('enter frquency 3 :'); fs=input('Enter Sampling frequency :'); ts=1/fs; n=0:tf*fs; q=n*ts; f=[f1 f2 f3]; fm=max(f); xt1=cos(2*pi*f1*t); xt2=cos(2*pi*f2*t); xt3=cos(2*pi*f3*t); xt=xt1+xt2+xt3; xn=cos(2*pi*f1*q)+cos(2*pi*f2*q)+cos(2*pi*f3*q); xa=xn*sinc(fs*(ones(length(n),1)*t-q'*ones(1,length(t))));
  • 6. subplot(321); plot(t,xt); title('orignal signal'); subplot(322); stem(q,xn); title('sampled signal'); subplot(323); plot(t,xa); if fs<2*fm title('reconstructed signal with sampling frequency less than nyquist criteria '); elseif fs==2*fm title('rescontructed signal with sampling frequency equal to nyquiest criteria'); else title('Reconstructed signal with sampling frequency greater than nyquist criteria'); end Output: - Condition when sampling frequency less than Nyquist criteria.
  • 7. Output: - Condition when sampling frequency equal to Nyquist criteria. Condition when sampling frequency greater than Nyquist criteria.