1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
| //---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <stdlib.h>
#include <fstream.h>
#include <iostream.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
:TForm(Owner)
{
}
//-----------------------------
void__fastcall TForm1::N1Click(TObject*Sender)
{
exit(1);
}
//-----------------------------
void_fastcall TForml::ButtonlClick(TObject*Sender)
{
const float H0[14]={0.07785, 0.39654, 0.72913, 0.46978, -0.14391, -0.22404, 0.07131, 0.08061,
-0.03803, -0.01657, 0.01255, 0.00043, -0.0018, 0.00035};
const float HI [14]={0.00035, 0.0018, 0.00043, -0.01255, -0.01657, 0.03803, 0.08061, -0.07131,
- 0.22404, 0.14391, 0.46978, -0.72913, 0.39654, -0.07785};
const int Ldy[9]={ 1005, 508, 260, 136, 74, 43, 27, 19, 15};
const int Ly[9]={1999, 1005, 508, 260, 136, 74, 43, 27, 19};
const int Ldx=13;
char file1[30];
ifstream Fl ("Newfilel.txt");
ofstream Fres("C:\RES.DAT",ios::out);
Nmax=178;
//---- file
for(int il=0;il<=Nmax;il++)
{
Fl.getline(filel,30);
//
Memo 1 ->Lines->Append(file 1);
ifstream File(filel,ios::in);//Date Y
//Obnul À------------------------
for(int i=0;i<2000;i++)
{
for(int k=0;k<6;k++)
{
A[i][k]=0;
}
DAT[i]=0;
}
//Read File-----------------------
for(int i=0;i<2000;i++)
{
for(int k=0;k<6;k++)
{
File>>A[i][k];
}
}
// DAT-------------------------------
for(int h=0;h<6;h++) //Signal h
{
for(int i=0;i<2000;i++)
{
DAT[i]=A[i][h];
}
//----------------------WAVELET------------------
for(int s=0;s<8;s++)
{
for(int k=0;k<=(Ldx+Ly[s]);k++)
{
c[k]=0;
if(k>=0&k<=12)
{
for(int i=0;i<=k;i++)c[k]=c[k]+HO[i]*DAT[k-i];
}
else if(k>=13&k<=Ly[s])
{
for(int i=0;i<=13;i++)c[k]=c[k]+H0[i]*DAT[k-i];
}
else
{
for(int i=(k-Ly[s]);i<=13;i++) c[k]=c[k]+HO[i]*DAT[k-i];
}
}
//---------------
for(int k=0;k<=(Ldx+Ly[s]);k++) LOD[k]=c[k];
//------------
for(int k=0;k<=(Ldx+Ly[s]);k++)
{
c[k]=0;
if(k>=0&k<=12)
{
for(int i=0;i<=k;i++) c[k]=c[k]+Hl[i]*DAT[k-i];
}
else if(k>=13&k<=Ly[s])
{
for(int i=0;i<=13;i++) c[k]=c[k]+Hl[i]*DAT[k-i];
}
else
{
for(int i=(k-Ly[s]);i<=13;i++) c[k]=c[k]+Hl[i]*DAT[k-i];
}
}
//------------
for(int k=0;k<=(Ldx+Ly[s]);k++) HID[k]=c[k];
//------------
for(int i=0;i<2000;i++) DAT[i]=0;
//------------
for(int k=0;k<=Ldy[s];k++)
{
DH[k][s]=L0D[2*k+l];
DAT[k]=DH[k][s];
DH[k][s+8]=HID[2*k+l];
}
//--
}
//------------Obnul
for(int s=0;s<10;s++)RES[s]=0;
//-----------Koef detal
for(int s=0;s<8;s++)
{
for(int k=0;k<=Ldy[s];k++)
{
if(sqrt(DH[k][s+8]*DH[k][s+8])>RES[s]) RES[s]=sqrt(DH[k][s+8]*DH[k][s+8]);
// Memol ->Lines->Append(DH[k][s+8]);
// Seriesl->Add(DH[k][s+l l],k,clRed);
}
}
//------------Koef aprok
for(int k=0;k<=Ldy[7];k++)
{
if(sqrt(DH[k][7]*DH[k][7])>RES[8]) RES[8]=sqrt(DH[k][7]*DH[k][7]);
}
for(int s=0;s<9;s++)
{
Memol->Lines->Append(RES[s]);
Fres"RES[s]"" ";
}
File.close();
} //............End Signal h--------
Fres<<"\n";
}
Fres.close();
Fl.close();
} |