## 4 Results and Discussion  
### Experimental Setup  
We examined the effectiveness of a TCN model and a transformer-based model in our experimental setup for time-series signal optimization (Figure 5). The network consists of three 1D convolutional layers. Each layer has 64 filters. The size of the convolutional kernel is 3, and the ReLU activation function is applied to introduce non-linearity'same' padding, which is used to ensure the output length matches the input length. A final 1D convolutional layer with a single filter and a kernel size of 1 is applied to produce the output. The output layer is linearly activated to allow the prediction of continuous values. The model is then trained on the original signal for 25 epochs. However, the loss stabilized at 10 epochs. New ECG values for the modified signal are computed at the initial time points using cubic spline interpolation. The obtained ECG values are interpolated to the length of the original signal so that they can be compared directly.  
Afterward, the defined architecture is used to build the TCN model, which is then compiled with the Adam optimizer and mean squared error loss function (Figure 6). For each time point, small perturbations (\(-1\), \(0\), \(1\)) are tested to see which one will go in a direction that conveys a reduction in the distance--the MSE of the original and interpolated signals. If a perturbation returns a smaller distance, the time point is updated. This is repeated for a number of iterations, \(100\) in this case.  
The transformer adds positional information to the input data to help the model understand the position of each element in the sequence; it performs attention operations to focus on different parts of the input sequence [28]. Layer normalization alleviates the output to improve training stability. The feed-forward network consists of Conv1D layers that act as fully connected layers applied to each position of the sequence. Residual connection adds the original input to the output of the feed-forward network, followed by another  
Figure 5: Block diagram of the proposed sampling and validation process.  
Figure 6: Workflow of the proposed models—a programming viewpoint.  
layer normalization. A Conv1D layer is used to produce the final output with a single value per position.  
By testing multiple numbers of samples ranging from low to high, the experiment explores how the quantity of data (in terms of time points) affects the outcomes or results of the study. The inclusive lower range of 18 to 36 samples per second and higher range from 46 to 120 samples per second used denotes a methodical search to determine the ideal time series length that yields dependable or interesting findings without unnecessary complexity or redundancy of data. The samples from 18 to 36 were tested more meticulously to observe the intricacies in lower sampling rates specifically.  
All experiments were implemented in Python (v3.10.9) using Tensorflow (v2.15.0) and Keras (v2.15.0) machine learning libraries. All the experiments were run on a Windows 11 Home 64-bit operating system with an AMD Ryzen 7 3750H 4-Core processor 2.3 GHz (Advanced Micro Devices, Inc., St. Clara, CA, USA), NVIDIA GEFORCE GTX 1660 Ti GPU, (NVIDIA Corporation, St. Clara, CA, USA), and 16 GB installed memory.