Logical error with counter

I have a logical error with my code but I cant find it and no matter what I change its like going around in circles. From the snippet I'm supposed to have a maximum amplitude value for each frame (which contains 1024 bins where each bin has an amplitude value). First off I'm supposed to have 25 frames but only 24 is outputting...and then the maximum amplitude value is the same for all frames...which is wrong. Please help if you can. Note: the data is taken from an array.

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
int count = 0;
	int frames = 0, bins = 0;
	int frameset = 0, binset = 0;
// code which opens the data file
	const int row = 25600;
		const int col = 3;
		int amplitude[row][col];
		int max = amplitude[0][2];


		for (count = 0; count < 25600; count++) {
			amplitude[frames][bins] = data;
			bins++;
			for (frames = 0; frames < 26; frames++) {
				if (bins == 1024) {
					bins = 0;
				}
			}
		}
			for (int i = 0; i < 25; i++) {
				int j = 0;
				if ((i == 0) && (j == 0)) {
					cout << "Maximum Amplitude for each frame:" << endl;
					cout << "Frame" << "\tBin" << "\tMaximum Amplitude" << endl;
					outFile << "Maximum Amplitude for each frame." << endl;
					outFile << "Frame" << "\tBin" << "\tMaximum Amplitude" << endl;
				}
				for (j = 0; j < 1024; j++) {
					if (j == 0) {
						max = amplitude[i][j];
					}
					else {
						if (amplitude[i][j] > max) {
							max = amplitude[i][j];
							frameset = i;
							binset = j;
							cout << frameset << "\t" << binset << "\t" << max << endl;
Topic archived. No new replies allowed.