Frequency analysis of discrete time signals is usually performed on digital signal processor, which may be general purpose digital computer or specially designed digital hardware. To perform frequency analysis on discrete time signal, we convert the time domain sequence to an equivalent frequency domain representation. We know that such representation is given by The Fourier transform X(ejw) of the sequence x(n). However, X(ejw) is a continuous function of frequency and therefore, It is not a computationally convenient representation of the sequence. DFT is a powerful computational tool for performing frequency analysis of discrete time signals. The N-point DFT of discrete time sequence x(n) is denoted by X(k) and is defined as.
x(n)= n)
Program:
clc;
close all;
clear all;
xn=input(‘Enter the sequence x(n)’);
ln=length(xn); %find the length of the sequence
xk=zeros(1,ln); %let’s initialize an array of the same size as that of input sequence
ixk=zeros(1,ln); let’s initialize an array of the same size as that of input sequence
%DFT of the sequence
for k=0:ln-1
for n=0:ln-1
xk(k+1)=xk(k+1)+(xn(n+1)*exp((i)*2*pi*k*n/ln));
end
end
%Plotting input sequence
t=0:ln-1;
subplot(221);
stem(t,xn);
ylabel (‘Amplitude’);
xlabel (‘Time Index’);
title(‘Input Sequence’);
magnitude=abs(xk); % In order to find the magnitudes for the individual DFT points
% plot the magnitude response
t=0:ln-1;
subplot(222);
stem(t,magnitude);
ylabel (‘Amplitude’);
xlabel (‘K’);
title(‘Magnitude Response’);
phase=angle(xk); % In order to find the phases of individual DFT points % plot the magnitude
t=0:ln-1;
subplot(223);
stem(t,phase);
ylabel (‘Phase’);
xlabel (‘K’);
title (‘Phase Response’);
%IDFT of the sequence
for n=0:ln-1
for k=0:ln-1
ixk(n+1)=ixk(n+1)+(xk(k+1)*exp(i*2*pi*k*n/ln));
end
end
ixk=ixk./ln;
%code block to plot the input sequence
t=0:ln-1;
subplot(224);
stem(t,ixk);
ylabel (‘Amplitude’);
xlabel (‘Time Index’);
title (‘IDFT sequence’);
In wordpress if you are developing new or custom wordpress theme or wordpress plugin then…
If you are experiencing indexing issues of your website then you are not alone and…
On your wordpress website if you want to generate qr code for pages and posts…
If you are trying to verify your WordPress website with google search console with html…
If you are on wordpress website and wondering how to keep search console html verification…
If you are getting too many redirects error on your WordPress website after changing url…