## 4 Cognitive Solutions for HetNets and M2M Communications  
This section deals with some possible solutions to be applied to CHetNets and CM2M communications in a smart city, where one of the main challenges related to the use of CR technologies is spectrum sensing. Indeed, as stated previously, when sensing involves low complexity devices as in a smart environment, it is necessary to find a suitable trade-off between the amount of resources requested by the sensing operation (in terms of computational complexity and energy) and the sensing accuracy (in terms of the probability of correct detection and sensing time). As a consequence, depending on the cognitive node capabilities, different CR approaches should be selected. For this reason, we critically review different solutions distinguishing between two classes of cognitive systems that differ in the speed of changing of the primary system resource usage, and hence for the complexity of sensing operation:  
1. long-term (_i.e._, seconds) cognitive systems;
2. short-term (_i.e._, milliseconds) cognitive systems. In the first case, the primary and the secondary systems share portions of the available spectrum (sub-bands) indicated as \(B_{i}\) in Figure 2, whose occupancy changes due to significant modifications in the environment. This is the case of future 5G cellular systems, where the need for wide frequency bands and the unavailability of large free spectrum portions will lead to the dynamic aggregation of multiple, even non-contiguous, sub-bands (\"carrier aggregation\") [46] to satisfy the requested capacity. Hence, each primary cellular system adaptively changes the number of used sub-bands depending on the traffic load and the interference level with neighbour cells. Together with carrier aggregation, future 5G systems also foresee the exploitation of unlicensed spectrum portions (_i.e._, the ISM spectrum) to increase the capacity of small cells in HetNets, thus reducing the interference generated towards the macrocell. The use of unlicensed spectrum is subject to its availability and therefore sensing must be repeated periodically to find unused sub-channels [47]. Another interesting case is represented by the IEEE 802.22 standard for wireless regional area networks, which is based on the opportunistic usage of available portions of TV spectrum (TV white spaces) that are unused in a given area and in a given time. In all these cases, cognitive secondary systems must be able to detect the use of a given sub-band performing suitable spectrum sensing. The sub-bands where no activity of the nearby primary system is detected are used to communicate with the secondary users. In this case, it is reasonable to assume that the primary system sub-bands occupancy does not change frame-by-frame, but it is performed periodically when the network load changes significantly, or when new cells are activated in the same area. Short-term cognitive approaches are more challenging in terms of sensing because they foresee the exploitation of the smallest resource units (RUs) in which a sub-band can be divided (indicated as \(RU_{i,j}\) in Figure 2), and these are allocated frame-by-frame requiring instantaneous sensing and decisions. Indeed, current and next generation wireless communication systems are characterized by a high flexible and dynamic resource usage. Therefore, the available sub-bands are divided into small RUs (For example, the Physical Resource Blocks in LTE-A.) that are instantaneously allocated to users in a dynamic way depending on the users' requests and channel propagation conditions. In summary, the main difference between the two approaches is the time scale. In the first case, we can assume that the transmission opportunities last for some frames, while in the second case the resource assignment changes frame-by-frame. The short-term cognitive approach is more efficient because it works with a higher granularity of the resources and, hence, it permits to exploit all the resources left unused by the primary system.