pkggk
一般會員
發表:3 回覆:1 積分:0 註冊:2004-08-19
發送簡訊給我
|
看不懂
//--------------------------------------------------------------------------- #include <math.h>
#include
#pragma hdrstop
#include
#include "Unit1.h"
#include
#include
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//--------------------------------------------------------------------------- int head,len,N=512,info=44,divx,n,divn,target;
byte *x,*y,*xx;
FILE *in,*out;
double sita;
int boss[10];
double *ihsc,hsc=0;
double *ihss,hss=0;
double *ihsd,hsd=0;
double *ihsv,hsv=0;
double min[5]; typedef struct frame
{
double real;
double imag;
double mag;
}FRAME; typedef struct spy
{
int great;
bool b;
}SPY; typedef struct item
{
double hsc;
double hss;
double hsd;
double hsv;
}ITEM; FRAME **X;
SPY *look;
ITEM kind[5]; void DFT()
{
double t1,t2,t3;
for(int k=0;kX[i][max].mag)
max=j;
}
look[i].b=false;
look[i].great=max;
}
for(int i=0;i=boss[j]-1)&&(look[i].great<=boss[j] 1))
look[i].b=true;
}
} void HSC()
{
double sum,sum2;
ihsc=new double[n];
for(int i=0;iRefresh();
divx=(len-info)/Form1->Width;
Form1->Canvas->Pen->Color=clBlue;
Form1->Canvas->MoveTo(0,300-xx[44]/2);
for(int i=44;iCanvas->LineTo(i/divx,300-xx[i]/2);
} void nonoverlap_DFT()
{
double t1,t2,t3;
for(int k=0;kSaveDialog1->Execute())
out=fopen(Form1->SaveDialog1->FileName.c_str(),"w");
fwrite(y,1,len,out);
show();
} void run(int length,int start)
{
n=length/(N/2)-1;
x=new byte[length];
X=new FRAME*[n];
for(int j=0;jClear();
kind[0].hsc=11.6043094481525;
kind[0].hss=0.448499635481532;
kind[0].hsd=0.130093326913301;
kind[0].hsv=0.0449613865269529;
kind[1].hsc=11.5713783108608;
kind[1].hss=0.398676562549982;
kind[1].hsd=0.132503941656688;
kind[1].hsv=0.0310030372866746;
kind[2].hsc=16.4228438312637;
kind[2].hss=0.266626589932925;
kind[2].hsd=0.214631651861746;
kind[2].hsv=0.005208442775376;
kind[3].hsc=9.4253439941987;
kind[3].hss=0.439712862116863;
kind[3].hsd=0.126353643754725;
kind[3].hsv=0.0330929741374392;
kind[4].hsc=7.54635354596129;
kind[4].hss=0.313736734722696;
kind[4].hsd=0.196789721566695;
kind[4].hsv=0.0260551542863754;
if(OpenDialog1->Execute())
in=fopen(OpenDialog1->FileName.c_str(),"r");
Form1->Caption=OpenDialog1->FileName;
head=fileno(in);
len=filelength(head);
xx=new byte[len];
fread(xx,1,len,in);
divn=StrToInt(Edit1->Text);
show();
block=(len-info)/divn;
for(int i=0;i
|