SlideShare a Scribd company logo
ECE324: DIGITAL SIGNAL PROCESSING LABORATORY
Practical No.:4
Roll No: B-54 Registration No.:11205816_ Name:Shyamveer Singh
Aim: To perform DFT and IDFT of two given signals, Plot the
Magnitude and phase of same.
Mathematical Expressions Required:
1. DFT
2. IDFT
Inputs :
X(n)=[1 2 3 4 5]
X(k)=[2 4 6 8 9]
Program Codes:
1. DFT
function[y]=shyamdft(x)
m=length(x);
xk=zeros(1,m);
for k=0:m-1;
for n=0:m-1;
xk(k+1)=xk(k+1)+x(n+1)*exp((-i)*2*pi*k*n/m);
end
end
y=xk
M=sqrt(real(y).^2+imag(y).^2)
M1=abs(y)
A = atan2(imag(y),real(y))
A1=angle(y)
z=fft(x)
2. IDFT
function[y]=shyamidft(x)
m=length(x);
xk=zeros(1,m);
for k=0:m-1;
for n=0:m-1;
xk(k+1)=xk(k+1)+(1/m)*x(n+1)*exp((i)*2*pi*k*n/m)
;
end
end
y=xk
M=sqrt(real(y).^2+imag(y).^2)
M1=abs(y)
A = atan2(imag(y),real(y))
A1=angle(y)
z=ifft(x)
Outputs/ Graphs/ Plots:
>> x=[1 2 3 4 5]
x=
1
2
3
4
5
>> shyamdft(x)
y=
15.0000
- 3.4410i
M=
15.0000
M1 =
15.0000
A=
0
A1 =
0
z=
15.0000
- 3.4410i
-2.5000 + 3.4410i
-2.5000 + 0.8123i
-2.5000 - 0.8123i
-2.5000
2.1991
2.8274
-2.8274
-2.1991
2.1991
2.8274
-2.8274
-2.1991
4.2533
2.6287
2.6287
4.2533
4.2533
2.6287
2.6287
4.2533
-2.5000 + 3.4410i
-2.5000 + 0.8123i
-2.5000 - 0.8123i
-2.5000
Comparison with inbuilt functions: A= angle or phase, M=magnitude compare with
inbuilt commands abs, angle.
Y is output Compare with Z inbuilt command.
Outputs/ Graphs/ Plots:
2. IDFT
x=[2 4 6 8 9]
x=
2
4
6
8
9
>> shyamidft(x)
y=
5.8000
+ 1.1862i
M=
5.8000
M1 =
5.8000
A=
0
A1 =
0
z=
5.8000-1.0618 - 1.1862i -0.8382 - 0.2074i -0.8382 + 0.2074i -1.0618
+ 1.1862i
Comparison with inbuilt functions:A= angle or phase, M=magnitude compare with
inbuilt commands abs, angle.
Y is output Compare with Z inbuilt command.
-2.3009
-2.8991
2.8991
2.3009
-2.3009
-2.8991
2.8991
2.3009
1.5920
0.8635
0.8635
1.5920
1.5920
0.8635
0.8635
1.5920
-1.0618 - 1.1862i
-0.8382 - 0.2074i
-0.8382 + 0.2074i
-1.0618
Analysis/ Learning outcomes: After performing this experiment we know about the DFT
and IDFT implantation using MATLAB ,and we also know how to plot a phase and
magnitude plot of a signal.
Magnitude And Phase:
Magnitude: M=sqrt(real(y).^2+imag(y).^2)
Compare with inbuilt command abs.
PHASE:A = atan2(imag(y),real(y))
Compare with inbuilt command angle.

More Related Content

What's hot

Fir filter design using Frequency sampling method
Fir filter design using Frequency sampling methodFir filter design using Frequency sampling method
Fir filter design using Frequency sampling method
Sarang Joshi
 
IIR filter realization using direct form I & II
IIR filter realization using direct form I & IIIIR filter realization using direct form I & II
IIR filter realization using direct form I & II
Sarang Joshi
 
Z Transform
Z TransformZ Transform
Z Transform
Darshan Bhatt
 
Butterworth filter
Butterworth filterButterworth filter
Butterworth filter
MOHAMMAD AKRAM
 
Verilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderVerilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and Encoder
Bharti Airtel Ltd.
 
DSP_2018_FOEHU - Lec 04 - The z-Transform
DSP_2018_FOEHU - Lec 04 - The z-TransformDSP_2018_FOEHU - Lec 04 - The z-Transform
DSP_2018_FOEHU - Lec 04 - The z-Transform
Amr E. Mohamed
 
Chapter1 - Signal and System
Chapter1 - Signal and SystemChapter1 - Signal and System
Chapter1 - Signal and System
Attaporn Ninsuwan
 
Radix-2 DIT FFT
Radix-2 DIT FFT Radix-2 DIT FFT
Radix-2 DIT FFT
Sarang Joshi
 
Windowing techniques of fir filter design
Windowing techniques of fir filter designWindowing techniques of fir filter design
Windowing techniques of fir filter design
Rohan Nagpal
 
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor Logic
Sudhanshu Janwadkar
 
Rf power amplifier design
Rf power amplifier designRf power amplifier design
Rf power amplifier design
venkateshp100
 
Fourier Series for Continuous Time & Discrete Time Signals
Fourier Series for Continuous Time & Discrete Time SignalsFourier Series for Continuous Time & Discrete Time Signals
Fourier Series for Continuous Time & Discrete Time Signals
Jayanshu Gundaniya
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
PeriyanayagiS
 
DSP lab manual
DSP lab manualDSP lab manual
DSP lab manual
tamil arasan
 
One sided z transform
One sided z transformOne sided z transform
One sided z transform
Mahesh Vadhavaniya profmjv
 
TMS320C5x
TMS320C5xTMS320C5x
Linear & Non-Linear Systems |Solved problems|
Linear & Non-Linear Systems |Solved problems|Linear & Non-Linear Systems |Solved problems|
Linear & Non-Linear Systems |Solved problems|
National Engineering College
 
verilog code for logic gates
verilog code for logic gatesverilog code for logic gates
verilog code for logic gates
Rakesh kumar jha
 
Bode Plots
Bode Plots Bode Plots
Bode Plots
Hussain K
 
Dft and its applications
Dft and its applicationsDft and its applications
Dft and its applications
Agam Goel
 

What's hot (20)

Fir filter design using Frequency sampling method
Fir filter design using Frequency sampling methodFir filter design using Frequency sampling method
Fir filter design using Frequency sampling method
 
IIR filter realization using direct form I & II
IIR filter realization using direct form I & IIIIR filter realization using direct form I & II
IIR filter realization using direct form I & II
 
Z Transform
Z TransformZ Transform
Z Transform
 
Butterworth filter
Butterworth filterButterworth filter
Butterworth filter
 
Verilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and EncoderVerilog VHDL code Decoder and Encoder
Verilog VHDL code Decoder and Encoder
 
DSP_2018_FOEHU - Lec 04 - The z-Transform
DSP_2018_FOEHU - Lec 04 - The z-TransformDSP_2018_FOEHU - Lec 04 - The z-Transform
DSP_2018_FOEHU - Lec 04 - The z-Transform
 
Chapter1 - Signal and System
Chapter1 - Signal and SystemChapter1 - Signal and System
Chapter1 - Signal and System
 
Radix-2 DIT FFT
Radix-2 DIT FFT Radix-2 DIT FFT
Radix-2 DIT FFT
 
Windowing techniques of fir filter design
Windowing techniques of fir filter designWindowing techniques of fir filter design
Windowing techniques of fir filter design
 
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor Logic
 
Rf power amplifier design
Rf power amplifier designRf power amplifier design
Rf power amplifier design
 
Fourier Series for Continuous Time & Discrete Time Signals
Fourier Series for Continuous Time & Discrete Time SignalsFourier Series for Continuous Time & Discrete Time Signals
Fourier Series for Continuous Time & Discrete Time Signals
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
 
DSP lab manual
DSP lab manualDSP lab manual
DSP lab manual
 
One sided z transform
One sided z transformOne sided z transform
One sided z transform
 
TMS320C5x
TMS320C5xTMS320C5x
TMS320C5x
 
Linear & Non-Linear Systems |Solved problems|
Linear & Non-Linear Systems |Solved problems|Linear & Non-Linear Systems |Solved problems|
Linear & Non-Linear Systems |Solved problems|
 
verilog code for logic gates
verilog code for logic gatesverilog code for logic gates
verilog code for logic gates
 
Bode Plots
Bode Plots Bode Plots
Bode Plots
 
Dft and its applications
Dft and its applicationsDft and its applications
Dft and its applications
 

Viewers also liked

Digital Signal Processing Lab Manual ECE students
Digital Signal Processing Lab Manual ECE studentsDigital Signal Processing Lab Manual ECE students
Digital Signal Processing Lab Manual ECE students
UR11EC098
 
Linear Convolution using Matlab Code
Linear Convolution  using Matlab CodeLinear Convolution  using Matlab Code
Linear Convolution using Matlab Code
Bharti Airtel Ltd.
 
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
Ravikiran A
 
Dsp manual completed2
Dsp manual completed2Dsp manual completed2
Dsp manual completed2
bilawalali74
 
digital signal-processing-lab-manual
digital signal-processing-lab-manualdigital signal-processing-lab-manual
digital signal-processing-lab-manual
Ahmed Alshomi
 
Dsp U Lec10 DFT And FFT
Dsp U   Lec10  DFT And  FFTDsp U   Lec10  DFT And  FFT
Dsp U Lec10 DFT And FFT
taha25
 
An analysis of digital watermarking in frequency domain
An analysis of digital watermarking in frequency domainAn analysis of digital watermarking in frequency domain
An analysis of digital watermarking in frequency domain
Likan Patra
 
Ff tand matlab-wanjun huang
Ff tand matlab-wanjun huangFf tand matlab-wanjun huang
Ff tand matlab-wanjun huang
Sagar Ahir
 
Grupo 14 - Iglesia y convento san francisco
Grupo 14 - Iglesia y convento san franciscoGrupo 14 - Iglesia y convento san francisco
Grupo 14 - Iglesia y convento san francisco
Jorge Ccahuana
 
Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual
Jitendra Jangid
 
Introduction to Fourier transform and signal analysis
Introduction to Fourier transform and signal analysisIntroduction to Fourier transform and signal analysis
Introduction to Fourier transform and signal analysis
宗翰 謝
 
Image proceesing with matlab
Image proceesing with matlabImage proceesing with matlab
Image proceesing with matlab
Ashutosh Shahi
 
PULSE CODE MODULATION (PCM)
PULSE CODE MODULATION (PCM)PULSE CODE MODULATION (PCM)
PULSE CODE MODULATION (PCM)
vishnudharan11
 
Fourier transform
Fourier transformFourier transform
Fourier transform
Naveen Sihag
 
Matlab source codes section | Download MATLAB source code freerce-codes
Matlab source codes section | Download MATLAB source code freerce-codesMatlab source codes section | Download MATLAB source code freerce-codes
Matlab source codes section | Download MATLAB source code freerce-codes
hafsabanu
 
Dsp lab manual
Dsp lab manualDsp lab manual
Dsp lab manual
Mukul Mohal
 
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier AnalysisDSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
Amr E. Mohamed
 
Digital signal processing (2nd ed) (mitra) solution manual
Digital signal processing (2nd ed) (mitra) solution manualDigital signal processing (2nd ed) (mitra) solution manual
Digital signal processing (2nd ed) (mitra) solution manual
Ramesh Sundar
 
Slideshare ppt
Slideshare pptSlideshare ppt
Slideshare ppt
Mandy Suzanne
 

Viewers also liked (19)

Digital Signal Processing Lab Manual ECE students
Digital Signal Processing Lab Manual ECE studentsDigital Signal Processing Lab Manual ECE students
Digital Signal Processing Lab Manual ECE students
 
Linear Convolution using Matlab Code
Linear Convolution  using Matlab CodeLinear Convolution  using Matlab Code
Linear Convolution using Matlab Code
 
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
 
Dsp manual completed2
Dsp manual completed2Dsp manual completed2
Dsp manual completed2
 
digital signal-processing-lab-manual
digital signal-processing-lab-manualdigital signal-processing-lab-manual
digital signal-processing-lab-manual
 
Dsp U Lec10 DFT And FFT
Dsp U   Lec10  DFT And  FFTDsp U   Lec10  DFT And  FFT
Dsp U Lec10 DFT And FFT
 
An analysis of digital watermarking in frequency domain
An analysis of digital watermarking in frequency domainAn analysis of digital watermarking in frequency domain
An analysis of digital watermarking in frequency domain
 
Ff tand matlab-wanjun huang
Ff tand matlab-wanjun huangFf tand matlab-wanjun huang
Ff tand matlab-wanjun huang
 
Grupo 14 - Iglesia y convento san francisco
Grupo 14 - Iglesia y convento san franciscoGrupo 14 - Iglesia y convento san francisco
Grupo 14 - Iglesia y convento san francisco
 
Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual Signal Prosessing Lab Mannual
Signal Prosessing Lab Mannual
 
Introduction to Fourier transform and signal analysis
Introduction to Fourier transform and signal analysisIntroduction to Fourier transform and signal analysis
Introduction to Fourier transform and signal analysis
 
Image proceesing with matlab
Image proceesing with matlabImage proceesing with matlab
Image proceesing with matlab
 
PULSE CODE MODULATION (PCM)
PULSE CODE MODULATION (PCM)PULSE CODE MODULATION (PCM)
PULSE CODE MODULATION (PCM)
 
Fourier transform
Fourier transformFourier transform
Fourier transform
 
Matlab source codes section | Download MATLAB source code freerce-codes
Matlab source codes section | Download MATLAB source code freerce-codesMatlab source codes section | Download MATLAB source code freerce-codes
Matlab source codes section | Download MATLAB source code freerce-codes
 
Dsp lab manual
Dsp lab manualDsp lab manual
Dsp lab manual
 
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier AnalysisDSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis
 
Digital signal processing (2nd ed) (mitra) solution manual
Digital signal processing (2nd ed) (mitra) solution manualDigital signal processing (2nd ed) (mitra) solution manual
Digital signal processing (2nd ed) (mitra) solution manual
 
Slideshare ppt
Slideshare pptSlideshare ppt
Slideshare ppt
 

Similar to DFT and IDFT Matlab Code

Newton two Equation method
Newton two Equation  method Newton two Equation  method
Newton two Equation method
shanto017
 
Dsp iit workshop
Dsp iit workshopDsp iit workshop
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
 
Matlab file
Matlab file Matlab file
Matlab file
rampal singh
 
Modulation techniques matlab_code
Modulation techniques matlab_codeModulation techniques matlab_code
Modulation techniques matlab_code
Вахидреза Мохсени
 
Forward & Backward Differenece Table
Forward & Backward Differenece TableForward & Backward Differenece Table
Forward & Backward Differenece Table
Saloni Singhal
 
Resolución del-examen-de-la-práctica-de-métodos-numéricos
Resolución del-examen-de-la-práctica-de-métodos-numéricosResolución del-examen-de-la-práctica-de-métodos-numéricos
Resolución del-examen-de-la-práctica-de-métodos-numéricos
Carlos Cosi Mamani
 
#Import standard math functions from math import import .docx
#Import standard math functions from math import  import .docx#Import standard math functions from math import  import .docx
#Import standard math functions from math import import .docx
gertrudebellgrove
 
Image Compression Comparison Using Golden Section Transform, Haar Wavelet Tra...
Image Compression Comparison Using Golden Section Transform, Haar Wavelet Tra...Image Compression Comparison Using Golden Section Transform, Haar Wavelet Tra...
Image Compression Comparison Using Golden Section Transform, Haar Wavelet Tra...
Jason Li
 
Introduction to FEM
Introduction to FEMIntroduction to FEM
Introduction to FEM
mezkurra
 
EC3492 -1.10.pptx
EC3492 -1.10.pptxEC3492 -1.10.pptx
EC3492 -1.10.pptx
PALANIAPPANC2
 
A Simulation Training for Sigma-Delta Modulators by Matlab CAD-Tool
A Simulation Training for Sigma-Delta Modulators by Matlab CAD-ToolA Simulation Training for Sigma-Delta Modulators by Matlab CAD-Tool
A Simulation Training for Sigma-Delta Modulators by Matlab CAD-Tool
MCI
 
Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...
Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...
Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...
IJERA Editor
 
Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...
Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...
Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...
IJERA Editor
 
Data Structure: Algorithm and analysis
Data Structure: Algorithm and analysisData Structure: Algorithm and analysis
Data Structure: Algorithm and analysis
Dr. Rajdeep Chatterjee
 
FIR filter designing using Matlab
FIR filter designing using MatlabFIR filter designing using Matlab
FIR filter designing using Matlab
Bharti Airtel Ltd.
 
MATLAB CODE OF FIR Filter Designing LPF HPF BPF BSF
MATLAB CODE OF FIR Filter Designing LPF HPF BPF BSFMATLAB CODE OF FIR Filter Designing LPF HPF BPF BSF
MATLAB CODE OF FIR Filter Designing LPF HPF BPF BSF
Bharti Airtel Ltd.
 
lec08_computation_of_DFT.pdf
lec08_computation_of_DFT.pdflec08_computation_of_DFT.pdf
lec08_computation_of_DFT.pdf
shannlevia123
 
Lecture 2 Introduction to digital image
Lecture 2 Introduction to digital imageLecture 2 Introduction to digital image
Lecture 2 Introduction to digital image
VARUN KUMAR
 
The convenience yield implied by quadratic volatility smiles presentation [...
The convenience yield implied by quadratic volatility smiles   presentation [...The convenience yield implied by quadratic volatility smiles   presentation [...
The convenience yield implied by quadratic volatility smiles presentation [...
yigalbt
 

Similar to DFT and IDFT Matlab Code (20)

Newton two Equation method
Newton two Equation  method Newton two Equation  method
Newton two Equation method
 
Dsp iit workshop
Dsp iit workshopDsp iit workshop
Dsp iit workshop
 
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 file
Matlab file Matlab file
Matlab file
 
Modulation techniques matlab_code
Modulation techniques matlab_codeModulation techniques matlab_code
Modulation techniques matlab_code
 
Forward & Backward Differenece Table
Forward & Backward Differenece TableForward & Backward Differenece Table
Forward & Backward Differenece Table
 
Resolución del-examen-de-la-práctica-de-métodos-numéricos
Resolución del-examen-de-la-práctica-de-métodos-numéricosResolución del-examen-de-la-práctica-de-métodos-numéricos
Resolución del-examen-de-la-práctica-de-métodos-numéricos
 
#Import standard math functions from math import import .docx
#Import standard math functions from math import  import .docx#Import standard math functions from math import  import .docx
#Import standard math functions from math import import .docx
 
Image Compression Comparison Using Golden Section Transform, Haar Wavelet Tra...
Image Compression Comparison Using Golden Section Transform, Haar Wavelet Tra...Image Compression Comparison Using Golden Section Transform, Haar Wavelet Tra...
Image Compression Comparison Using Golden Section Transform, Haar Wavelet Tra...
 
Introduction to FEM
Introduction to FEMIntroduction to FEM
Introduction to FEM
 
EC3492 -1.10.pptx
EC3492 -1.10.pptxEC3492 -1.10.pptx
EC3492 -1.10.pptx
 
A Simulation Training for Sigma-Delta Modulators by Matlab CAD-Tool
A Simulation Training for Sigma-Delta Modulators by Matlab CAD-ToolA Simulation Training for Sigma-Delta Modulators by Matlab CAD-Tool
A Simulation Training for Sigma-Delta Modulators by Matlab CAD-Tool
 
Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...
Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...
Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...
 
Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...
Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...
Radix-2 Algorithms for realization of Type-II Discrete Sine Transform and Typ...
 
Data Structure: Algorithm and analysis
Data Structure: Algorithm and analysisData Structure: Algorithm and analysis
Data Structure: Algorithm and analysis
 
FIR filter designing using Matlab
FIR filter designing using MatlabFIR filter designing using Matlab
FIR filter designing using Matlab
 
MATLAB CODE OF FIR Filter Designing LPF HPF BPF BSF
MATLAB CODE OF FIR Filter Designing LPF HPF BPF BSFMATLAB CODE OF FIR Filter Designing LPF HPF BPF BSF
MATLAB CODE OF FIR Filter Designing LPF HPF BPF BSF
 
lec08_computation_of_DFT.pdf
lec08_computation_of_DFT.pdflec08_computation_of_DFT.pdf
lec08_computation_of_DFT.pdf
 
Lecture 2 Introduction to digital image
Lecture 2 Introduction to digital imageLecture 2 Introduction to digital image
Lecture 2 Introduction to digital image
 
The convenience yield implied by quadratic volatility smiles presentation [...
The convenience yield implied by quadratic volatility smiles   presentation [...The convenience yield implied by quadratic volatility smiles   presentation [...
The convenience yield implied by quadratic volatility smiles presentation [...
 

More from Bharti Airtel Ltd.

Resume Shyamveer
Resume ShyamveerResume Shyamveer
Resume Shyamveer
Bharti Airtel Ltd.
 
BHEL Final Report
BHEL Final ReportBHEL Final Report
BHEL Final Report
Bharti Airtel Ltd.
 
BHEL PPT
BHEL PPTBHEL PPT
Amplitude modulated-systmes
Amplitude modulated-systmesAmplitude modulated-systmes
Amplitude modulated-systmes
Bharti Airtel Ltd.
 
Amplitude modulated-systems
Amplitude modulated-systemsAmplitude modulated-systems
Amplitude modulated-systems
Bharti Airtel Ltd.
 
Mcq5 ac-fet-amplifiers
Mcq5 ac-fet-amplifiersMcq5 ac-fet-amplifiers
Mcq5 ac-fet-amplifiers
Bharti Airtel Ltd.
 
Mcq6 ac-mosfet-amplifier
Mcq6 ac-mosfet-amplifierMcq6 ac-mosfet-amplifier
Mcq6 ac-mosfet-amplifier
Bharti Airtel Ltd.
 
C bjt-biasing-and-stabilization
C bjt-biasing-and-stabilizationC bjt-biasing-and-stabilization
C bjt-biasing-and-stabilization
Bharti Airtel Ltd.
 
Mcq6 ac-mosfet-amplifier
Mcq6 ac-mosfet-amplifierMcq6 ac-mosfet-amplifier
Mcq6 ac-mosfet-amplifier
Bharti Airtel Ltd.
 
Mcq4 ac-operational-amplifiers
Mcq4 ac-operational-amplifiersMcq4 ac-operational-amplifiers
Mcq4 ac-operational-amplifiers
Bharti Airtel Ltd.
 
Logic gates-notesdc-iii
Logic gates-notesdc-iiiLogic gates-notesdc-iii
Logic gates-notesdc-iii
Bharti Airtel Ltd.
 
C bjt-biasing-and-stabilization
C bjt-biasing-and-stabilizationC bjt-biasing-and-stabilization
C bjt-biasing-and-stabilization
Bharti Airtel Ltd.
 
B bjt-characteristics
B bjt-characteristicsB bjt-characteristics
B bjt-characteristics
Bharti Airtel Ltd.
 
A bjt-operating-modes-configurations
A bjt-operating-modes-configurationsA bjt-operating-modes-configurations
A bjt-operating-modes-configurations
Bharti Airtel Ltd.
 
Resume shyam final
Resume shyam finalResume shyam final
Resume shyam final
Bharti Airtel Ltd.
 
Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis
Bharti Airtel Ltd.
 
Sequence detector Verilog Code
Sequence detector Verilog CodeSequence detector Verilog Code
Sequence detector Verilog Code
Bharti Airtel Ltd.
 
Divine inspiration
Divine inspirationDivine inspiration
Divine inspiration
Bharti Airtel Ltd.
 
To designing counters using verilog code
To designing counters using verilog codeTo designing counters using verilog code
To designing counters using verilog code
Bharti Airtel Ltd.
 
Verilog VHDL code Multiplexer and De Multiplexer
Verilog VHDL code Multiplexer and De Multiplexer Verilog VHDL code Multiplexer and De Multiplexer
Verilog VHDL code Multiplexer and De Multiplexer
Bharti Airtel Ltd.
 

More from Bharti Airtel Ltd. (20)

Resume Shyamveer
Resume ShyamveerResume Shyamveer
Resume Shyamveer
 
BHEL Final Report
BHEL Final ReportBHEL Final Report
BHEL Final Report
 
BHEL PPT
BHEL PPTBHEL PPT
BHEL PPT
 
Amplitude modulated-systmes
Amplitude modulated-systmesAmplitude modulated-systmes
Amplitude modulated-systmes
 
Amplitude modulated-systems
Amplitude modulated-systemsAmplitude modulated-systems
Amplitude modulated-systems
 
Mcq5 ac-fet-amplifiers
Mcq5 ac-fet-amplifiersMcq5 ac-fet-amplifiers
Mcq5 ac-fet-amplifiers
 
Mcq6 ac-mosfet-amplifier
Mcq6 ac-mosfet-amplifierMcq6 ac-mosfet-amplifier
Mcq6 ac-mosfet-amplifier
 
C bjt-biasing-and-stabilization
C bjt-biasing-and-stabilizationC bjt-biasing-and-stabilization
C bjt-biasing-and-stabilization
 
Mcq6 ac-mosfet-amplifier
Mcq6 ac-mosfet-amplifierMcq6 ac-mosfet-amplifier
Mcq6 ac-mosfet-amplifier
 
Mcq4 ac-operational-amplifiers
Mcq4 ac-operational-amplifiersMcq4 ac-operational-amplifiers
Mcq4 ac-operational-amplifiers
 
Logic gates-notesdc-iii
Logic gates-notesdc-iiiLogic gates-notesdc-iii
Logic gates-notesdc-iii
 
C bjt-biasing-and-stabilization
C bjt-biasing-and-stabilizationC bjt-biasing-and-stabilization
C bjt-biasing-and-stabilization
 
B bjt-characteristics
B bjt-characteristicsB bjt-characteristics
B bjt-characteristics
 
A bjt-operating-modes-configurations
A bjt-operating-modes-configurationsA bjt-operating-modes-configurations
A bjt-operating-modes-configurations
 
Resume shyam final
Resume shyam finalResume shyam final
Resume shyam final
 
Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis
 
Sequence detector Verilog Code
Sequence detector Verilog CodeSequence detector Verilog Code
Sequence detector Verilog Code
 
Divine inspiration
Divine inspirationDivine inspiration
Divine inspiration
 
To designing counters using verilog code
To designing counters using verilog codeTo designing counters using verilog code
To designing counters using verilog code
 
Verilog VHDL code Multiplexer and De Multiplexer
Verilog VHDL code Multiplexer and De Multiplexer Verilog VHDL code Multiplexer and De Multiplexer
Verilog VHDL code Multiplexer and De Multiplexer
 

Recently uploaded

Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
University of Maribor
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
Ratnakar Mikkili
 
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
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
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
 
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
 
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
 
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
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
PuktoonEngr
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
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
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
Madhumitha Jayaram
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
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
 
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
 

Recently uploaded (20)

Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
 
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)
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
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
 
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...
 
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
 
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
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
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
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
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
 
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...
 

DFT and IDFT Matlab Code

  • 1. ECE324: DIGITAL SIGNAL PROCESSING LABORATORY Practical No.:4 Roll No: B-54 Registration No.:11205816_ Name:Shyamveer Singh Aim: To perform DFT and IDFT of two given signals, Plot the Magnitude and phase of same. Mathematical Expressions Required: 1. DFT 2. IDFT Inputs : X(n)=[1 2 3 4 5] X(k)=[2 4 6 8 9] Program Codes: 1. DFT function[y]=shyamdft(x) m=length(x); xk=zeros(1,m); for k=0:m-1; for n=0:m-1; xk(k+1)=xk(k+1)+x(n+1)*exp((-i)*2*pi*k*n/m); end end y=xk M=sqrt(real(y).^2+imag(y).^2) M1=abs(y) A = atan2(imag(y),real(y)) A1=angle(y) z=fft(x) 2. IDFT function[y]=shyamidft(x) m=length(x); xk=zeros(1,m); for k=0:m-1; for n=0:m-1; xk(k+1)=xk(k+1)+(1/m)*x(n+1)*exp((i)*2*pi*k*n/m) ; end end y=xk M=sqrt(real(y).^2+imag(y).^2) M1=abs(y) A = atan2(imag(y),real(y)) A1=angle(y) z=ifft(x) Outputs/ Graphs/ Plots:
  • 2. >> x=[1 2 3 4 5] x= 1 2 3 4 5 >> shyamdft(x) y= 15.0000 - 3.4410i M= 15.0000 M1 = 15.0000 A= 0 A1 = 0 z= 15.0000 - 3.4410i -2.5000 + 3.4410i -2.5000 + 0.8123i -2.5000 - 0.8123i -2.5000 2.1991 2.8274 -2.8274 -2.1991 2.1991 2.8274 -2.8274 -2.1991 4.2533 2.6287 2.6287 4.2533 4.2533 2.6287 2.6287 4.2533 -2.5000 + 3.4410i -2.5000 + 0.8123i -2.5000 - 0.8123i -2.5000 Comparison with inbuilt functions: A= angle or phase, M=magnitude compare with inbuilt commands abs, angle. Y is output Compare with Z inbuilt command. Outputs/ Graphs/ Plots: 2. IDFT x=[2 4 6 8 9] x= 2 4
  • 3. 6 8 9 >> shyamidft(x) y= 5.8000 + 1.1862i M= 5.8000 M1 = 5.8000 A= 0 A1 = 0 z= 5.8000-1.0618 - 1.1862i -0.8382 - 0.2074i -0.8382 + 0.2074i -1.0618 + 1.1862i Comparison with inbuilt functions:A= angle or phase, M=magnitude compare with inbuilt commands abs, angle. Y is output Compare with Z inbuilt command. -2.3009 -2.8991 2.8991 2.3009 -2.3009 -2.8991 2.8991 2.3009 1.5920 0.8635 0.8635 1.5920 1.5920 0.8635 0.8635 1.5920 -1.0618 - 1.1862i -0.8382 - 0.2074i -0.8382 + 0.2074i -1.0618 Analysis/ Learning outcomes: After performing this experiment we know about the DFT and IDFT implantation using MATLAB ,and we also know how to plot a phase and magnitude plot of a signal. Magnitude And Phase: Magnitude: M=sqrt(real(y).^2+imag(y).^2) Compare with inbuilt command abs. PHASE:A = atan2(imag(y),real(y)) Compare with inbuilt command angle.