Witam!! Mam pewnien problem, mianowicie nie wiem jak zamienic sposób wyświetlania danych. Przedstawiają mi sie one w postaci liczb (np. od -5 do +5), a chcĘ aby wyswietlał sie wykres (coś w stylu funkcji sinus). Poniżej część programu:
procedure TForm1.lstReadingClick(Sender: TObject);
begin
integer DFT(integer dir,integer m,Double *x1,Double *y1)
begin
LongInt i,k;
Double arg;
Double cosarg,sinarg;
Double *x2=0,*y2=0;
x2 = malloc(m*SizeOf(Double));
y2 = malloc(m*SizeOf(Double));
if (x2 = 0 or y2 = 0)
result:= (FALSE);
for (i=0;i<m;i++) begin
x2[i] = 0;
y2[i] = 0;
arg = - dir * 2.0 * 3.141592654 * (Double)i / (Double)m;
for (k=0;k<m;k++) begin
cosarg = cos(k * arg);
sinarg = sin(k * arg);
x2[i] := x2[i] + (x1[k] * cosarg - y1[k] * sinarg);
y2[i] := y2[i] + (x1[k] * sinarg + y1[k] * cosarg);
end;
(* Copy the data back *)
if (dir = 1) begin
for (i=0;i<m;i++) begin
x1[i] = x2[i] / (Double)m;
y1[i] = y2[i] / (Double)m;
end;
end; else begin
for (i=0;i<m;i++) begin
x1[i] = x2[i];
y1[i] = y2[i];
end;
end;
free(x2);
free(y2);
result:= (TRUE);
end;
</delphi>