# Fourier transformation of Hann window is wrong

From the documentation

f = FourierTransform[HannWindow[x], x, w];
Plot[Log10@Abs[f], {w, -80, 80}, PlotRange -> All]


which produces

Now I was trying to do the same for a discrete case using $1/n$ normalization

    T = 1.;
num = 1000;
funx = Table[i, {i, -T/2, T/2, T/(num - 1)}];
funHann = HannWindow /@ (funx/T);
frek = Most@Range[-num/2, num/2, 1]/T;
DFT = Fourier[funHann, FourierParameters -> {-1, 1}]~
RotateRight~(IntegerPart@(num/2));
ListLogPlot[Transpose[{frek, Abs@DFT}], PlotRange -> All]


which instead of produces something totally different

Does anybody have an idea why?

EDIT: I think I managed to get to a working case, but not via implemented Fourier instead I defined DFT

    xfft = With[{N = num - 1},
Compile[{{k, _Real}, {fun1, _Real, 1}}, (1/N)*
fun1.Exp[-2*Pi*I*Range[0, N - 1]*k/N]]];
frek = Join[Most@Range[0, num/2, 1], Most@Range[-num/2, 0, 1]]/(10.0);
XHann = (xfft[#, Most@funHann]) & /@ (Most@frek);
out = ListLogPlot[{Transpose[{Most@frek, Abs[XHann]}]},
PlotRange -> {{-20, 20}, All}, Joined -> {True, True},
Frame -> True, PlotMarkers -> {\[FilledCircle], 6}, Joined -> True,
ImageSize -> Large,
BaseStyle -> {FontFamily -> "Courier New", FontSize -> 10}]


I really don't understand the implemented Fourier and what is correct or what is wrong.

data = Array[HannWindow, 1024, {-20, 20}];