The CDF files `title_ID_train.cdf`

and `title_ID_test.cdf`

are binary files that store the data required for training and testing 1D CNNs in a format recognizable by the executable file.

Suppose that the training data consists of N frames (i.e. 1D arrays) (X_{1}, X_{2}, .. , X_{N}) and each frame consists of N_{f} samples. Each frame is associated with a classification vector C_{i} of length N_{c} that classifies the frame into one of N_{c} classes. For example, the classification vector [0, 1, 0, .. , 0] indicates that the frame corresponds to the 2^{nd} class.

The training CDF file should then include the following items **arranged in a single column vector**. The column vector includes the CNN attributes, then the classification vectors, and finally the input frames:

**Part 1 :CDF attributes:**

- ID: ID of the CDF file.
- N: number of training frames.
- N
_{f}: frame size. - Number of input channels = 1.
- N
_{c}: number of classes.

**Part 2: List the N classification vectors one by one**

- C
_{1,1} - C
_{1,2} - …
- C
_{1,Nc} - …
- C
_{N,1} - C
_{N,2} - …
- C
_{N,Nc}

**Part 3: List the associated N input frames one by one**

- X
_{1,1} - X
_{1,2} - …
- X
_{1,Nf} - …
- X
_{N,1} - X
_{N,2} - …
- X
_{N,Nf}

To generate a cdf file using Matlab, you can simple store the aforementioned items in a column vector `COL`

and use the following code to save the vector into a CDF file:

```
ftr = fopen('example_1_train.cdf'],'w');
fwrite(ftr,COL,'float');
```

Please note that the same procedure can be followed to generate the testing CDF `title_ID_test.cdf`

.