File:DFT zero-padding technique example (2N) - Sequence.pdf

Description
English: Example of zero-padding technique for the Discrete Fourier Transform (DFT): gate sequence with .
Italiano: Esempio di tecnica di aggiunta degli zeri per la trasformata di Fourier discreta (DFT): sequenza porta con .
Date
Source Own work
Author Luca Ghio
Permission
(Reusing this file)
Public domain I, the copyright holder of this work, release this work into the public domain. This applies worldwide.
In some countries this may not be legally possible; if so:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.
Category:Self-published work#DFT%20zero-padding%20technique%20example%20(2N)%20-%20Sequence.pdfCategory:PD-self#DFT%20zero-padding%20technique%20example%20(2N)%20-%20Sequence.pdf
gnuplot source
InfoField
click to expand
N=10;
n=[0:N-1]
x=[ones(1,N)];
y=fft(x,length(x));
figure
set (gca,'FontSize',14)
stem(n,x)
xlabel('n')
ylabel('x(n)')
axis([0 N-1 -0.5 1.5])
grid on

figure
set (gca,'FontSize',14)
stem(n,abs(y),'o')
xlabel('n')
ylabel('|X(k)|')
axis([0 N-1 -1 11])
grid on

N=10;
N1=2*N;
x=[ones(1,N) zeros(1,N1-N)];
n=[0:N1-1];
y=fft(x,length(x));
figure
set (gca,'FontSize',14)
stem(n,x)
xlabel('n')
ylabel('x(n)')
axis([0 N1-1 -0.5 1.5])
grid on

figure
set (gca,'FontSize',14)
stem(n,abs(y),'o')
xlabel('k')
ylabel('|X_z(k)|')
axis([0 N1-1 -1 11])
grid on

N=10;
N1=4*N;
x=[ones(1,N) zeros(1,N1-N)];
n=[0:N1-1];
y=fft(x,length(x));
figure
set (gca,'FontSize',14)
stem(n,x)
xlabel('n')
ylabel('x(n)')
axis([0 N1-1 -0.5 1.5])
grid on

figure
set (gca,'FontSize',14)
stem(n,abs(y),'o')
xlabel('k')
ylabel('|X_z(k)|')
axis([0 N1-1 -1 11])
grid on

N=10;
N1=1000;
x=[ones(1,N) zeros(1,N1-N)];
n=[0:N1-1];
y=fft(x,length(x));
f=n/N1;

figure
set (gca,'FontSize',14)
plot(f,abs(y))
xlabel('f')
ylabel('|X(e^{j2\pi f})|')
axis([0 1 -1 11])
grid on
Category:Images with Octave source code Category:Created with GNU Octave Category:DFT vs DCT
Category:Created with GNU Octave Category:DFT vs DCT Category:Images with Octave source code Category:PD-self Category:Pages using deprecated source tags Category:Self-published work