|
SINC.OMS
Script File:
# Description:
# Inverse discrete Fourier transform of a sinc function
#
clear
# number of points in the transform
N = 256
# number of points where h(t) = 1
M = 32
# half the rectangular window width
T = .5
# time between points
dt = 2 * T / M
# spacing between frequency points
df = 1. / (N * dt)
# frequency grid
f = (seq(N) - N / 2 - 1) * df
# so we do not divide by zero
f(N / 2 + 1) = 1e-4 * T
# the sinc function
H = sin(2 * pi * T * f) / (pi * f)
#
# compute the approximate continuous inverse transform
h = ifft(complex(H)) * df
#
# plot the result
t = (seq(N) - N / 2 - 1) * dt
gxaxis("linear", - 1, + 1, 4, 5)
gxtitle("Time")
gtitle("Inverse Fourier Transform")
gplot(t, real(h))
Output:
|
|