# Wireless Home Assistive System for Severely Disabled People
## 2 Materials and Methods
### Morse Code Translator (MCT)  
The functional block diagram of the MCT is shown in Figure 3. The time duration of press-and-hold from assistive input accessories can be separated into four kinds of base elements of Morse codes, i.e., a long tone, short tone, long silence interval, and short silence interval. The time duration ratio of a long tone to a short tone is 3 to 1, so is the time duration ratio of a long silence interval to a short silence interval. It is difficult for normal people who are not well trained to accurately input Morse codes according to this principle of time duration ratio, not to mention the severely disabled. In order to overcome the problem of time duration ratio control, the fuzzy recognition algorithm is embedded in MCT to automatically adjust the threshold value between a long tone and short tone, and the threshold value between a long silence interval and short silence interval as well according to the on/off intervals controlled by the user respectively, so as to increase the identification accuracy of long and short tone/silence intervals. The Morse code fuzzy recognition algorithm architecture for a single switch is shown in Figure 4. In Figure 4a, the Morse codes are divided into two kinds of sequences, one is tone (on) interval sequence (\(\rm{n_{T}(k)}\)) and the other is silence (off) interval sequence (\(\rm{n_{I}(k)}\)), which are adjusted by two functions (\(\rm{N_{T}}\) and \(\rm{N_{I}}\)) respectively to simplify the Morse code recognition process. After the signal adjustment, each threshold level (\(\rm{T_{TK}}\), \(\rm{T_{IK}}\)) of the corresponding long and short tone/silence intervals are adjusted using the fuzzy algorithm, respectively, to improve the recognition accuracy of long and short tone/silence intervals. \(\rm{R_{TK}}\) and \(\rm{R_{IK}}\) are the identification functions for the long/short tone/silence of Morse codes according to \(\rm{T_{TK}}\) and \(\rm{T_{IK}}\) respectively. Once the fuzzy recognition process for the Morse codes is finished, MCT can translate the inputted Morse codes to readable characters (in ASCII format) or commands and transmit them into a computer, smartphone, or tablet computer via the Bluetooth interface, replacing the keyboard and mouse. Figure 3: Functional block diagram of MCT. In Figure 4, two control flowcharts are used for the tone and silence recognition of Morse code. The recognition procedure of Morse code tone sequence in the tone recognition flowchart is described below. **Step 1. ** In order to simplify the Morse code recognition process, we utilized the signal adjustment function \(\mathrm{N_{T}}\), i.e., to update \(\mathrm{x_{T}}\) according to \(\mathrm{T_{TK}}\) in Equation (1) recursively. \[\mathrm{N_{T}}\left\{ \begin{array}{ll}\mathrm{x_{T}}=\mathrm{n_{T}}(k),& \qquad\mathrm{if}\;\mathrm{n_{T}}(k)<\mathrm{T_{TK}}\\ \mathrm{x_{T}}=\frac{1}{3}\mathrm{n_{T}}(k),&\qquad\mathrm{if}\;\mathrm{n_{T} }(k)>\mathrm{T_{TK}}\end{array} \right. \tag{1}\]  
where \(\mathrm{N_{T}}\) is the signal adjustment function, \(\mathrm{x_{T}}\) is the output of \(\mathrm{N_{T}}\), \(\mathrm{n_{T}}\)(k) is the original input signal, and \(\mathrm{T_{TK}}\) is the kth threshold of tone to distinguish between long and short elements. **Step 2. ** The prediction error \(\mathrm{e_{T}}\) in Equation (2) is an input to the fuzzy algorithm, and it is created by the difference between \(\mathrm{x_{T}}\) and \(\mathrm{y_{T-1}}\),  
\[\mathrm{e_{T}}=\mathrm{x_{T}}-\mathrm{y_{T-1}}. \tag{2}\]  
In the fuzzy algorithm, a linguistic fuzzy rule is utilized to calculate modified error \(\mathrm{\epsilon^{\prime}_{T}}\). Five linguistic parameters are negative large (LN), negative small (SN), zero (ZE), positive small (SP), and positive large (LP) (Figure 4b). The fuzzy rules in conditional expressions (3) are described as \"if the conditional premise is true, then the corresponding result is met\":  
\[