**3. Examples in signal processing**

One of the application categories in use of embedded system is digital signal processing. The embedded system with numerical processes is much convenient than the analog or hardware process even if the low response time in the numerical system. LabVIEW is one of the options for embedded system development. The integration of LabVIEW program with hardware devices such as Arduino is great deal to reduce the cost. In this section, there are two examples are introduced: ECG signal processing and body sound signal processing.

ECG signal is a biomedical signal used to diagnose pathology related to cardiovascular disease. A simple ECG measurement system is designed with 3 leads placed on to human limbs to observe flutter wave and detect the complex waves include P, Q, R, S, T. To obtain the spatial signal of a heart, the electrodes should be placed on the chest with 6 leads assigned from v1 to v6. Here, with 4 electrode placed on all limbs, the 12 leads ECG measurement system is built. The 10 electrodes are used to monitor 12 signal of a cardiovascular system from the limbs to heart.

The low-cost hardware design for 12 leads ECG measurement based on Arduino Uno was reported [15]. To obtain the signal for storage and analysis, the signal is numerical converted and transferred to PC with software. For convenience, LabVIEW programming software was chosen. Because of the low spectrum range of ECG signal (0 to 100 Hz), the required sampling frequency is also low as well. The amplitude of ECG signal is weak (millivolts level), to observe the signal the

amplitude have to be amplified with gain ranged from 30 dB to 40 dB, therefore, the ECG signal is contaminated with a number of the gained electromagnetic noises in the spectrum range.

To reduce the electromagnetic noises as well as increase SNR (signal-to-noise ratio) of the signal, beside the analog filters [15], digital filters is also considered since the difficulties of analog high-order filters design. After the signal purification, the wave of signal should be displayed then stored in PC. Therefore, the function diagram of a LabVIEW program contains signal acquisition, filtering, display, and storing. To compare the filtered signal and the raw signal, two waveform graph panel are used. The diagram has shown in **Figure 5**.

As **Figure 5** presented, the data is transferred to the data acquisition block and displayed in a graph plotting as well as filtered by the signal filtering. After the noise reduction processes, the filtered data is displayed and then stored in PC storage. Because of the low sampling frequency requirement, the LabVIEW-Arduino Uno interface can be chosen as LINX. By use of LINX package, the sampling cycle can adjusted through the "wait" block in LabVIEW to limited the while loop cycle. Typically, with the spectrum range of ECG signal, the maximum frequency reaches to 100 Hz, hence, the minimum sampling frequency should be 200 Hz as the Nyquist criteria requirement. However, the enlargement of sampling frequency provides better frequency resolution under frequency analysis.

The 12 leads ECG system contains 8 channels, includes V1 to V6, lead I and lead III. **Figure 6** shows the analog read program which was built with LINX and LabVIEW The data acquired through a block called "Analog Read N Channels", this block enable to read multiple channels simultaneously. Because the sampling cycle of the embedded system depends on the LabVIEW while loop cycle, therefore the

#### **Figure 5.**

*Function diagram of the LabVIEW ECG signal acquisition.*

**109**

**Figure 8.**

**Figure 7.**

*LabVIEW and Open Embedded System DOI: http://dx.doi.org/10.5772/intechopen.98271*

hardware device.

sampling time is set via "Time Delay" block. For this development, the sampling cycle is set with value of 0.003 seconds, corresponding to sampling frequency of 334 Hz approximately. The setting of the sampling cycle is shown in **Figure 7**. Because of the multi channels reading, the data is packed in to a 1D array. To separate the data in each channel, a block named as "Index Array" was used. With each indexed number, a correspondent numerical value is extracted to an indicator. Based on the extracting in multi loops, the numerical values is arranged as a data 1D array which can be used to plot the raw data of each channel. The extraction program is indicated in **Figure 8**. Here, because the data indexed from 0, the channel number of 0 to 7 is assigned to extract the data of correspondent channels. The lead indicator named as the analog input pin corresponding to the electrode of the

To reduce the noises from the collected data, a bandpass Butterworth filter was used. The noises contain both DC (Directed Current) components and AC (Alternative Current). In a signal waveform, AC components are the significant information that the observer can use for analysis. To eliminate the DC components in the ECG signal, a highpass filter with zero-close cut-off frequency should be addressed. To maximize the spectrum range, the zero-close cut-off frequency is chosen as 0.05 Hz while the high cut-off frequency of the low-pass filter is located at 100 Hz. The combination of the low-pass and the high-pass filter is the band-pass filter with the passed frequency range of 0.05 Hz to 100 Hz. The filter LabVIEW diagram is shown in **Figure 9**. Since the narrow range from stop frequency to cutoff frequency requests pitched edge, the filter order should be high. For this ECG

LabVIEW waveform graph block plots a waveform with 1D data typically in a linear variation of counted number of sample index. Therefore, the waveform

spectrum range, the order of the band-pass filter is set as 6.

*The sampling cycle setting time with "time delay" block.*

*The multi-channels data extraction program.*

**Figure 6.** *The LabVIEW analog read program for 12 leads ECG measurement.*

### *LabVIEW and Open Embedded System DOI: http://dx.doi.org/10.5772/intechopen.98271*

*LabVIEW - A Flexible Environment for Modeling and Daily Laboratory Use*

panel are used. The diagram has shown in **Figure 5**.

provides better frequency resolution under frequency analysis.

in the spectrum range.

amplitude have to be amplified with gain ranged from 30 dB to 40 dB, therefore, the ECG signal is contaminated with a number of the gained electromagnetic noises

To reduce the electromagnetic noises as well as increase SNR (signal-to-noise ratio) of the signal, beside the analog filters [15], digital filters is also considered since the difficulties of analog high-order filters design. After the signal purification, the wave of signal should be displayed then stored in PC. Therefore, the function diagram of a LabVIEW program contains signal acquisition, filtering, display, and storing. To compare the filtered signal and the raw signal, two waveform graph

As **Figure 5** presented, the data is transferred to the data acquisition block and displayed in a graph plotting as well as filtered by the signal filtering. After the noise reduction processes, the filtered data is displayed and then stored in PC storage. Because of the low sampling frequency requirement, the LabVIEW-Arduino Uno interface can be chosen as LINX. By use of LINX package, the sampling cycle can adjusted through the "wait" block in LabVIEW to limited the while loop cycle. Typically, with the spectrum range of ECG signal, the maximum frequency reaches to 100 Hz, hence, the minimum sampling frequency should be 200 Hz as the Nyquist criteria requirement. However, the enlargement of sampling frequency

The 12 leads ECG system contains 8 channels, includes V1 to V6, lead I and lead III. **Figure 6** shows the analog read program which was built with LINX and LabVIEW The data acquired through a block called "Analog Read N Channels", this block enable to read multiple channels simultaneously. Because the sampling cycle of the embedded system depends on the LabVIEW while loop cycle, therefore the

**108**

**Figure 6.**

**Figure 5.**

*The LabVIEW analog read program for 12 leads ECG measurement.*

*Function diagram of the LabVIEW ECG signal acquisition.*

sampling time is set via "Time Delay" block. For this development, the sampling cycle is set with value of 0.003 seconds, corresponding to sampling frequency of 334 Hz approximately. The setting of the sampling cycle is shown in **Figure 7**.

Because of the multi channels reading, the data is packed in to a 1D array. To separate the data in each channel, a block named as "Index Array" was used. With each indexed number, a correspondent numerical value is extracted to an indicator. Based on the extracting in multi loops, the numerical values is arranged as a data 1D array which can be used to plot the raw data of each channel. The extraction program is indicated in **Figure 8**. Here, because the data indexed from 0, the channel number of 0 to 7 is assigned to extract the data of correspondent channels. The lead indicator named as the analog input pin corresponding to the electrode of the hardware device.

To reduce the noises from the collected data, a bandpass Butterworth filter was used. The noises contain both DC (Directed Current) components and AC (Alternative Current). In a signal waveform, AC components are the significant information that the observer can use for analysis. To eliminate the DC components in the ECG signal, a highpass filter with zero-close cut-off frequency should be addressed. To maximize the spectrum range, the zero-close cut-off frequency is chosen as 0.05 Hz while the high cut-off frequency of the low-pass filter is located at 100 Hz. The combination of the low-pass and the high-pass filter is the band-pass filter with the passed frequency range of 0.05 Hz to 100 Hz. The filter LabVIEW diagram is shown in **Figure 9**. Since the narrow range from stop frequency to cutoff frequency requests pitched edge, the filter order should be high. For this ECG spectrum range, the order of the band-pass filter is set as 6.

LabVIEW waveform graph block plots a waveform with 1D data typically in a linear variation of counted number of sample index. Therefore, the waveform

**Figure 7.**

*The sampling cycle setting time with "time delay" block.*

**Figure 8.**

*The multi-channels data extraction program.*

**Figure 9.** *LabVIEW diagram of the signal filtering program.*

cannot be observed in the time-domain precisely. To indicate the graphs amplitude distribution in time-domain, the real-time clock can be combined with the ECG numerical data to be 2D data array, this process so called waveform building. Based-on the waveform building, the data plotted in a graph panel named as "Waveform Chart" in multiple channels display. The diagram of waveform building of amplitude data and real-time clock combination has shown in **Figure 10** while the array of the such 8 channel is presented in **Figure 11**.

The function of data storing can be designed with "creat file" block in "File I/O" menu. However, the data acquisition and file create in the same "while loop" may delayed the cycle of the loop. Therefore a structure Producer-Consumer which allow the parallel jobs; independent loops. By the structure, the received data in the first loop is enqueue then transmitted to the second loop named as dequeue and queue for data obtaining. The procedure is shown in **Figure 12**. With such program structure, the obtained data can be stored parallelly with the data acquisition

#### **Figure 10.**

*The waveform building of a single channel amplitude data with the correspondent real-time clock data.*

**111**

**Figure 13.**

**Figure 12.**

*LabVIEW and Open Embedded System DOI: http://dx.doi.org/10.5772/intechopen.98271*

procedure with the jobs of signal filtering, waveform building, graph plotting. This structure is also used in the case of that the variable need to be processed in multi

Another approach for data acquisition system with precise sampling frequency is LabVIEW applications with LIFA package. For LIFA users, as above discussion, the compatibility with each LabVIEW version should be checked since the NI-VISA of each LabVIEW version does not support for all LIFA packages, causing to error connection. Eventhough, the embedded system development community with LabVIEW still prefers LIFA because of simplicity and precision. With a requirement of fast sampling frequency, LINX might not be satisfied. In the second example, the observed objects are body sounds which their spectrum ranged in 0 to 20 kHz, the maximum frequency is much higher oscillation than the ECG signal. To observe the whole spectrum, at least, the minimum sampling frequency should be set at 44 kHz to satisfied Nyquist criteria. A test with this parameter based-on LINX

To obtain experiments of embedded systems collecting the body sound data such as heart sound and lung sound, a wide range stethoscope was designed [20]. The body sound is transduced to electromagnetic wave then converted to numerical data by Arduino board and read by a LabVIEW program. Instead of LINX, LIFA is used in this development. Similarly to the procedure has shown in **Figure 4**, the

loop arranged in the same program with synchronization requirement.

*The producer-consumer structure program for data storing.*

application resulted the instability of the sampling frequency.

*The LabVIEW body sound data acquisition based on LIFA applications.*

*The waveform building of 8 channels with amplitude and real-time clock data combination.*

*LabVIEW and Open Embedded System DOI: http://dx.doi.org/10.5772/intechopen.98271*

#### **Figure 12.**

*LabVIEW - A Flexible Environment for Modeling and Daily Laboratory Use*

cannot be observed in the time-domain precisely. To indicate the graphs amplitude distribution in time-domain, the real-time clock can be combined with the ECG numerical data to be 2D data array, this process so called waveform building. Based-on the waveform building, the data plotted in a graph panel named as "Waveform Chart" in multiple channels display. The diagram of waveform building of amplitude data and real-time clock combination has shown in **Figure 10** while

*The waveform building of a single channel amplitude data with the correspondent real-time clock data.*

*The waveform building of 8 channels with amplitude and real-time clock data combination.*

The function of data storing can be designed with "creat file" block in "File I/O" menu. However, the data acquisition and file create in the same "while loop" may delayed the cycle of the loop. Therefore a structure Producer-Consumer which allow the parallel jobs; independent loops. By the structure, the received data in the first loop is enqueue then transmitted to the second loop named as dequeue and queue for data obtaining. The procedure is shown in **Figure 12**. With such program structure, the obtained data can be stored parallelly with the data acquisition

the array of the such 8 channel is presented in **Figure 11**.

*LabVIEW diagram of the signal filtering program.*

**110**

**Figure 11.**

**Figure 10.**

**Figure 9.**

*The producer-consumer structure program for data storing.*

procedure with the jobs of signal filtering, waveform building, graph plotting. This structure is also used in the case of that the variable need to be processed in multi loop arranged in the same program with synchronization requirement.

Another approach for data acquisition system with precise sampling frequency is LabVIEW applications with LIFA package. For LIFA users, as above discussion, the compatibility with each LabVIEW version should be checked since the NI-VISA of each LabVIEW version does not support for all LIFA packages, causing to error connection. Eventhough, the embedded system development community with LabVIEW still prefers LIFA because of simplicity and precision. With a requirement of fast sampling frequency, LINX might not be satisfied. In the second example, the observed objects are body sounds which their spectrum ranged in 0 to 20 kHz, the maximum frequency is much higher oscillation than the ECG signal. To observe the whole spectrum, at least, the minimum sampling frequency should be set at 44 kHz to satisfied Nyquist criteria. A test with this parameter based-on LINX application resulted the instability of the sampling frequency.

To obtain experiments of embedded systems collecting the body sound data such as heart sound and lung sound, a wide range stethoscope was designed [20]. The body sound is transduced to electromagnetic wave then converted to numerical data by Arduino board and read by a LabVIEW program. Instead of LINX, LIFA is used in this development. Similarly to the procedure has shown in **Figure 4**, the

**Figure 13.** *The LabVIEW body sound data acquisition based on LIFA applications.*

LabVIEW data acquisition program based-on LIFA is shown in **Figure 13**, where the block of "Analog read pin" is located outside of the while loop to avoid the replication of the setup pin mode for each cycles. Here, the sampling frequency can directly input to the "control" block as 88 kHz to satisfy the requirement of whole spectrum range observation. For the compatibility, this experiment was check with all current LIFA package with LabVIEW 2018 sp1. The result suggested that the package of 1.3.0.26 is great deal for this development without any errors.

Because of the conversion from the acoustic wave to the electromagnetic wave, the signal is contaminated with electromagnetic wave noises, hence, the noises should be reduced to enhance the SNR for the observation. To ensure the noise minimization, the digital band-pass filter is applied with cut-off frequencies are set at 5 Hz for low frequency cut and 35 kHz for high frequency cut, respectively. This block is different to the "Butterworth band-pass filter" which used in ECG acquisition system that the order of the filters are calculated based on the cut-off frequency and stop frequency parameters. The procedure application is much easier than the use of the filter block such as above Butterworth configuration. This block is packed in the toolkit named as "Digital Filter Design Toolkit". The filtering procedure diagram is shown in **Figure 14**.

During the sound data acquisition, beside the storage for future use, the sound as well as the quality can be checked directly by the hearing of users. To reconstruct the acoustic oscillation, the data conversed from the discrete format to analog wave through 24 bit DAC (Digital to Analog Conversion) sound card integrated in PC. The signal generates the body sound with a speaker with built-in amplifier. The functional procedure is shown in **Figure 15**, where the sound amplitude possibly adjusted with a digital amplifier called as "Set Volume" and generated to the output phone jack through the block of "write". Both blocks are located in Graphics and Sound menu.

Both applications based-on use of LINX and LIFA are introduced for examples to visualize the low-cost embedded system design with Arduino and LabVIEW.

**Figure 14.** *The filter applying to the body sound signal in the LabVIEW program.*

**113**

design as before.

**5. Conclusions**

widely developed in the near future.

*LabVIEW and Open Embedded System DOI: http://dx.doi.org/10.5772/intechopen.98271*

**4. Another approaches**

error may occurred in some unknown conditions.

Even if the current drawback of the toolboxes are available, the development still can be solved in certain circumstances. With the experiment conditions and by the demonstration, these developments suggest another applications which toward the embedded system building without the traditional NI hardware devices. However, these development still need more work to complete the issues since the bug and

Beside Arduino boards, there are many commercial products are still developing such as Raspberry pi for remote access network or IoT (Internet of Things) system, chipKit for function enhancement, ESP8266 for wifi applications. Recently, to open a change for mobile AI (Artificial Intelligent) system, NVIDIA company released Jetson nanno kit which specified with quad-core CPU and 128-core GPU. Almost of current embedded hardware devices use USB connection with asynchronous communication protocol for data exchange. This means with the definition of NI-VISA which support for the hardware using USB port, the commands and the data can be fullduplex transferred between PC and the embedded hardware devices. The requirement for LabVIEW interface can be solved through firmware library programming. In the case of large amount of logic components integration required such as parallel filters, numerical array convolution, the embedded system FPGA-based (Field Programmable Gate Array) with LabVIEW can be considered. Unlike the LabVIEW interface package such as LINX and LIFA, the FPGA-based embedded system has to be originated by NI hardware devices or use of other hardware compatible with NI-myRIO platform. With the optimization of logic circuit with specified functions or procedure, the fast response of the FPGA-based embedded systems possibly satisfy the real-time requirement. An example of such application was reported in 2010 with real-time response for DC motor controller design [21]. The advantage of LabVIEW embedded systems that is the enriched update of libraries and block module in each version which support for data processing such as signal processing, image processing, network routing, control system, computer vision, IoT, and more. In large scale system level, when the real-time characteristics is required, the distributed system with multiple computers network possibly the solution. Therefore, for the LabVIEW embedded system in the near future, a trend of functionalizing hardware device is potential development. With the standardization of the data transfer protocol, the computer peripheral design based on embedded system will focus on the firmware and software design rather than the hardware

With the development of the operating system for smart devices such as Android and iOS, NI LabVIEW also provide a solution that the smart devices users can observe acquired data and control system objects distantly through a service called WebVI, which means the embedded systems in the future can be observed and control through smart devices such as smartphone, tablet when they are connected to internet, an IoT solution of LabVIEW application development [22]. Based-on this enhancement, the category of applications toward IoT system can be

In this chapter, embedded systems based-on LabVIEW applications with low-cost hardware devices are introduced and discussed. For the application

**Figure 15.**

*The program with function of direct sound regenerating.*

Even if the current drawback of the toolboxes are available, the development still can be solved in certain circumstances. With the experiment conditions and by the demonstration, these developments suggest another applications which toward the embedded system building without the traditional NI hardware devices. However, these development still need more work to complete the issues since the bug and error may occurred in some unknown conditions.
