## 6 Proposed MAC Protocol for Wireless Healthcare Environments--WhMAC
### whMAC Power Consumption Model  
When a power consumption model for communication needs to be built, duty cycle needs to be considered first. Duty cycle is calculated as the fraction of time that a system is in an \"active\" state. For the sensor transceiver, this is the time the transceiver is on (RF activity time), regardless of whether it is transmitting data, receiving data or idly listening to a clear channel. Low power protocols are developed to reduce these times so that the transceiver can be switched off for longer durations of time. Introducing the wake up receiver as a component that can listen to a channel reduces this duty cycle (time spent on idle listening), but introduces new component with quiescent power consumption. Good power model must be derived to justify the introduction of this component and determine the maximum power consumption it can have in order to be practical in applications. For wake up packets, the energy used by the sensor for receiving one wake up signal is calculated as:  
\[E_{wup}=P_{wd}T_{wup}(1+wer+per)+P_{R}T_{cmd}(1+per) \tag{1}\]  
\(P_{wd}\) and \(T_{wup}\) are the dynamic power consumed by the wake up receiver while receiving a wake up packet, and its duration, respectively. \(P_{R}\) is average power while receiving a packet (command) and \(T_{cmd}\) is the duration of the command. \(wer\) and \(per\) are error rates for the wake up and data packets. The energy consumption of the sensor for sending one status packet can be calculated as:  
\[E_{stat}=(P_{R}T_{beac}+P_{T}T_{stat}+P_{R}T_{ack})(1+per) \tag{2}\]  
\(P_{T}\) is average power while sending data (status packet). \(P_{R}\) is average power while receiving packet (beacon or acknowledgement). \(T_{beac}\), \(T_{stat}\) and \(T_{ack}\) are the durations of beacon, status and acknowledgement packets respectively. Streaming of data is done by assigning a number of time slots for sensor that streams data. This is a power-hungry mode, where every little increase in overhead or idle listening significantly increases power consumption, due to the amount of data being sent. We have no idle listening when this method is used for streaming. Some methods of reducing this energy are:  
1. Reducing the overhead by increasing the size of the packets. 2. Increasing the data rate. Increasing the packet size would increase the packet error rate, and for a given Bit Error Rate (BER), the optimal packet size can be calculated. Also, while streaming, the sensor does not need to listen the beacon in every time slot to resynchronise and commands can be given with the ACK. It can wait for \(N_{R}\) time slots before resynchronising to save power. \(N_{R}\) is calculated as:  
\[N_{R}\leq\frac{1}{2}\left(\frac{T_{g}}{T_{frame}\theta}\right) \tag{3}\]  
where \(T_{g}\) is guard time, and \(\theta\) is clock accuracy. Typical value for \(N_{R}\) would be 30 for \(T_{frame}=1\) s, \(\theta=30\) ppm and \(T_{g}=2\) ms. The energy used for streaming is then given by:  
\[E_{stream}=\left(\frac{P_{R}T_{beac}}{N_{R}}+P_{T}T_{data}+P_{R}T_{ack}\right) (1+per) \tag{4}\]  
where \(P_{R}\) is power spent while receiving beacon (it is divided by \(N_{R}\)), and receiving the acknowledgement. \(P_{T}\) is the power while sending the data packet. \(T_{beac}\)\(T_{data}\)\(T_{ack}\) are the durations of the beacon, data and ACK packets respectively. Therefore, the total power overhead for communication during time while sensor is in a WBAN is calculated as:  
\[P_{total}=P_{ws}+\frac{n_{wup}E_{wup}+n_{stat}E_{stat}+\frac{T_{stream}}{T_{ frame}}E_{stream}}{T_{on}} \tag{5}\]\(P_{ws}\) is the quiescent power consumption of the wake up receiver. \(n_{wup}\) and \(n_{stat}\) are the numbers of wake up commands and status frames in the period where we measure power consumption (\(T_{on}\)). \(T_{stream}\) is the time spent on streaming data (the duration of the monitored signal).