Computation of DFT Using Basic Equation of FFT and Power Spectrum Estimating using DFT

Program:
clc;
clear;
x=[1,2,3,4,5,6,7,8];
N=8;
n=0:N-1;
x=clean(fft(x));
y=clean(ifft(x));
mag=abs(x);
phase=atan(x);
disp("fft value was",x);
disp("ifft value was",y);

subplot(1,3,1);
plot2d3(n,x);
xlabel("n-value");
ylabel("amplitude of x(n)");
title("Input sequence");

subplot(1,3,2);
plot2d3(n,mag);
xlabel("n value");
ylabel("Magnitude of x(n)");
title("Magnitude plot");

subplot(1,3,3);
plot2d3(n,phase);
xlabel("n value");
ylabel("Phase of x(n)");
title("Phase plot");

Output



Comments

Popular posts from this blog

Compute Convolution for Longer Sequence

Spectrum Analysis using DFT