01/03/2021 To 07/03/2021
Signal Processing
Signal Processing Algorithm
After the signals were acquired, the signals were processed to detect individual drops and to calculate the volume data using a Atmega-328p microprocessor. The processing algorithms were implemented in Atmega328p microprocessor using Arduino language. The block diagram of the drop detection and volume calculation algorithm is shown in below.
The acquired signal by the Atmega328p Microcontroller may be very noisy. It means this has low signal to noise ratio. But for a low signal to noise ratio, the level of noise is relatively high to detect drops by simply applying a threshold to the first derivative signal without smoothing. Therefore, the input voltage signal is first smoothed with a moving average filter. The moving average filter function was designed by getting simply average of several previous data points. Then smoothed signal was send through the 1st derivative filter function and then smoothed again using another moving average filter to get a smooth gradient signal. Though it looks sufficient to use the smoothed gradient to detect drops by thresholding, during transient voltages caused by large changes in flow rate, the baseline of the first derivative signal is raised above the baseline and often goes above the threshold value. Therefore, some drops are not detected during large transients if the first gradient is used for thresholding. It is also not possible to increase the threshold value arbitrarily, as that leads to misdetection of drops at high flow rates. Therefore, to improve the detection accuracy, the second derivative is also calculated. The second derivative proved to be quite robust against transients and the accuracy of drop detection did not suffer adversely during such large transients or during high flow rates. Finally, the drops are detected from the original signal.
Calibration data set
Before signal processing by using Atmega328P Microcontroller, A calibration data set was simulated by using MATLAB functions. The Raw data sets were collected by using catheter based water dropping structure and amplifier circuit. Collected data set MATLAB files are in below.
MATLAB Simulations
Original drop signals
Original drop signals got from different data sets
Zoom versions of above drop signals
2. Smoothed drop signals
Zoomed versions of above smooth signals
3. Taking the 1st derivative signal of above smoothed signal
Zoomed versions of 1st derivative signals
4. Smooth 1st derivative signal
Zoomed versions of 1st derivative signal and smoothed 1st derivative signal
5. Taking the 2nd derivative signal of smoothed 1st derivative signal
Zoomed versions of above signals
6. Entire process
7. Smooth 2nd derivative signals
8. Drop detecting
Zoomed versions of above signal