⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cosft.dem

📁 Delphi Pascal 数据挖掘领域算法包 数值算法大全
💻 DEM
字号:
PROGRAM d12r5(input,output);
(* driver for routine COSFT *)
LABEL 1,99;
CONST
   eps=1.0e-3;
   np=16;
   np2=18;   (* np2=np+2 *)
   width=30.0;
   pi=3.1415926;
TYPE
   gldarray=ARRAY [1..np2] OF real;
   glyarray=gldarray;
VAR
   big,per,scal,small : real;
   i,jj,j,nlim : integer;
   data,size : gldarray;

(*$I MODFILE.PAS *)
(*$I FOUR1.PAS *)

(*$I REALFT.PAS *)

(*$I COSFT.PAS *)

BEGIN
1:   writeln('period of cosine in channels (2-',np:2,')');
   readln(per);
   IF (per <= 0.0) THEN GOTO 99;
   FOR i := 1 to np DO BEGIN
      data[i] := cos(2.0*pi*(i-1)/per)
   END;
   cosft(data,np,+1);
   big := -1.0e10;
   small := 1.0e10;
   FOR i := 1 to np DO BEGIN
      IF  (data[i] < small) THEN small := data[i];
      IF  (data[i] > big) THEN big := data[i]
   END;
   scal := width/(big-small);
   FOR i := 1 to np DO BEGIN
      nlim := round(scal*(data[i]-small)+eps);
      write(i:4,' ');
      FOR j := 1 to nlim+1 DO write('*');
      writeln
   END;
   writeln('press RETURN to continue ...');
   readln;
   cosft(data,np,-1);
   big := -1.0e10;
   small := 1.0e10;
   FOR i := 1 to np DO BEGIN
      IF (data[i] < small) THEN small := data[i];
      IF (data[i] > big) THEN big := data[i]
   END;
   scal := width/(big-small);
   FOR i := 1 to np DO BEGIN
      nlim := round(scal*(data[i]-small)+eps);
      write(i:4,' ');
      FOR j := 1 to nlim+1 DO write('*');
      writeln
   END;
   GOTO 1;
99:
END.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -