1 Introduction

In the recent technological advancement, WSNs has become a promising technology in wireless communication, as well as interdisciplinary field of interest. WSNs are comprised of spatially distributed miniature sensors for sensing various environmental or physical parameters, such as, humidity, temperature etc. The rigorous research in WSN environment has emerged for various multimedia applications with the term Wireless Multimedia Sensor Network (WMSN) [2, 3, 15, 16, 37]. The WMSN provides various multimedia applications, such as, video retrieval, health care delivery; multimedia surveillance etc. The network can be evolved in numerous applications and technologies, like supply chain, big data, cloud technology, multimedia medical devices, Internet of things etc. [37]. Also, the WMSN proves to be an exception to typical Wireless Sensor Network (WSN) in terms of updated and efficient descendant of it, which are able to gather both scalar and multimedia data. The WMSNs mainly deals with the applications which require high bandwidth and thus it demands a potential solution for managing the overall network. In literature [3], the authors worked in Wireless Multimedia Cognitive Radio Network to emphasize the utilization and necessity of bandwidth for the proper communication in channel. The Cognitive Radio (CR) technology solves the issue of spectrum utilization by different wireless communication techniques for wide range of smart applications and therefore the CR based WSN for multimedia applications (WMCRSN) is introduced. The motivation of our work lies on the usefulness of WSN for multimedia system fin IoT scenario. Such network can provide better communication with proper utilization of bandwidth for multimedia based applications. In this provision, initially the real-time spectrum sensing analysis is performed using standard non-ergodic environmental conditions which are used for wireless multimedia applications. The process then follows the filtering of the signals to obtain band of interest using the literatures available in [1, 19, 21, 30]. At the same time, in order to obtain the corresponding Power Spectrum Density (PSD), Fast Fourier Transform (FFT) is performed on the output of the low pass filter, which has a length size of 1024 [14]. At last, using energy detection based on constellation pattern and water-fill algorithm, the existence of signal source respect to its phase can be obtained. In addition, the continuous changes in the amplitude of the PSD are being given and it represents the complex signal in the time domain [7, 17, 23, 25, 33]. Compared to traditional PSD calculations, the water-fill algorithm can provide better PSD estimation. It presents the spectrum from the frequency band over continuous intervals. The simulations are performed using FFT of block size 1024, which displays the complex property of each signal sampling instant with a gain of 7 dB [5, 12, 35]. The signal is then analyzed using a constellation pattern of quadrature phase shift keying and the results are shown in Fig. 1. The blue dots in Fig. 1 represent the dominant frequency components which are based on their amplitude and quadrature phase. These frequency components indicate the position of the PU signals from the spectrum sensing results. We have observed two dominant frequency components with energy detection thresholding technique.

Fig. 1
figure 1

Constellation plot for the random signal

The water filling algorithm to calculate the PSD estimation is an effective equalization strategy due to the single center frequency and multiple sideband channels [6, 10, 19, 29,30,31, 36] as illustrated in Fig. 2. We have calculated and simulated the PSD estimation based on the water-fill algorithm. Figure 2 shows the signal spectrum over a continuous time interval and results in improved power spectral density (PSD). We have chosen the Blackman-Harris window to illustrate the changing patterns of frequency, time, and power intensity because it is more suitable than other window functions for sinusoidal methods [14, 31, 33].

Fig. 2
figure 2

Comparison of power spectral density of water-fill algorithm and Conventional periodogram

Figure 2 Illustrates the water-fall plot, based on single SNR and MFSK modulation. Based on the spectrum sensing results, the output of channel modelling defines the specific areas with the amount of utilized power by the PUs in the dynamic environment. Corresponding to this, the power allocation of SUs can be done in the unutilized spectrum by PUs [9, 11, 32, 38]. The authors in [38] explores and presented a novel WSN based cooperative communication technique for optical sensor networks whereas the work in [11] presents a standard framework for feature detections using statistical signal processing techniques. These techniques are used in the proposed work for identifying and analysing the spectrum sensing outputs for multimedia applications. The work in [9, 32] highlights the multiuser and secure intra-cluster cooperative communication using mathematical model and hybrid protocol. The SU informs the nearby SU about the same information and the cluster is formed. However, by increasing the number of clusters, the communication between the CH is established using different algorithms [4, 13, 22,23,24, 28]. In this context of spectrum utilization by SUs, the CH is selected based on the central position of any SU among the formed cluster for performing cooperative communication for high data rate applications.

The cluster is formed based on the similarity of the power spectrum in vacant spaces. Any wireless sensor network environment is dynamic in nature and the sensor nodes must adapt the dynamic behaviour and operate efficiently monitoring the changes. Artificial Intelligence makes this process easy and efficient. In our proposed approach the implementation of DAI made the system more energy efficient and less time consuming. The communication between multiple clusters is done using DAI and it utilizes the power based on the output of channel modelling. DAI works on the principle of Multi-Agent System [18, 20, 34]. The agents are Coordinator Agent (CoA), Tasks Agent (TA), Manager Agent (MA) and Deliberative Agent. To communicate between the clusters, the CH is considered as the (CoA) and simultaneously all other nodes are acted as TA. Again, after certain interval of time every CH will be considered as (MA). In that case, among the other CHs according to the objective requirement the DA will be chosen. The system model of the work is described by the flowchart shown in Fig. 3. The state-of-art of the proposed work can be summarized as follows:

  • Channel Modelling using Water fill algorithm

  • Cluster formation using SUs

  • Power allocation in in SUs after formation of cluster by DAI

Fig. 3
figure 3

System model

The work is organized as follows: In Section 2, the dynamic channel modelling is proposed for inter and intra cluster communication between the CHs. In next Section 3 describes the state space model and system parameter models for a signal along with analyses the power utilization by DAI. Section 4 analyses the proposed method in terms of simulations outputs in Rayleigh channel, based on these performance and finally, the conclusion and future work is discussed in Section 5.

2 Dynamic channel modelling

In WMSN, the high data rate demands remains a constant challenge for the researchers towards developing the 5G and beyond products. For high data rate applications, we know the channel modelling is the prime factor which governs the overall Quality-of-Service (QoS) for objective communication. The advantages of water-fil model are used for dynamic channel modelling as discussed. In the water-fill algorithm, a group of sub-channels during spectrum sensing from the nodes are consecutively maintained with nearly equal power usage to obtain the maximum data rate R = b/T, where, 1/T is a fixed symbol rate and the maximum realizable b = ∑nbn is obtained by εn and bn. Under the circumstances, a consecutive set of sub channels is transmitted by the largest bits in numbers in order to maximize the sum can be represented by:

$$ b=\frac{1}{2}\sum \limits_{n=1}^N{\log}_2\left(1+\frac{\varepsilon_n\cdot {g}_n}{\Gamma}\right) $$
(1)

When the sub channel is applied with unit energy by the transmitter, gn is used to represent the signal to noise ratio (SNR) of the sub channel. As we know, \( \left({g}_n={\left|{H}_n\right|}^2/\left({\sigma}_n^2\right).\right){g}_n \), for multi-tone signals, it is a fixed channel function, but in order to get the maximum value of b, εn can be a variable, but it is constrained by energy, which can be written as:

$$ \sum \limits_{n=1}^N{\varepsilon}_n=N{\overline{\varepsilon}}_x $$
(2)

Here, the Lagrangian multiplier is introduced and under the constraint of Eq. (2), the cost function uses it to maximize Eq. (1) and then analysing the derivative of εn, we get:

$$ \frac{1}{2\ln (2)}\frac{1}{\frac{\Gamma}{g_n}+{\varepsilon}_n}=-\lambda $$
(3)

Now, maximising the above for multiple channels for multimedia information, we can write:

$$ {\varepsilon}_n+\frac{\Gamma}{g_n}=\mathrm{constant} $$
(4)

While, Γ = 1(0 dB), we can achieve maximum data rate or maximum capacity of parallel channels. The solution is called water-fill algorithm. Here, we treat the SNR curve of the reverse channel as a graph full of energy (water) to constant line (level) for better analysis of this solution. While Γ ≠ 1, the water-filled optimized form remains unchanged for general WMSN applications. Thus, the number of bits per sub-channel can be written as

$$ {b}_n=0.5\cdot {\log}_2\left(1+\frac{\varepsilon_n\cdot {g}_n}{\Gamma}\right) $$
(5)

The optimum water-fill transmit energies, satisfies for the example of multi-tone as given by:

$$ {\varepsilon}_n=\Gamma .\frac{\sigma_n^2}{{\left|{H}_n\right|}^2}= constant $$
(6)

For the constants in the above equation, when \( \overline{\varepsilon_x}\ge 0 \) and \( {\sum}_n{\varepsilon}_n=N\overline{\varepsilon_x} \) , Eq. (7) has solution. Γ/gn is a convex function, which represents the analog curve of the water-fill algorithm. And this function is minimized in order to achieve optimal energy allocation in sub channels.

Here, we passed a signal with a center frequency of 93.3 MHz and 10 sub-channel sidebands through a low-pass filter, and utilized a dynamic channel model to improve the resolution of the PSD.

3 Performance parameters analysis

3.1 State space model

As shown in [12], the wireless channel model in terms of the state space model can be expressed as yt = Ctxt + Dtvt and xt + 1 = Atxt + Btwt for WMSN applications. Here, the state vector is represented by \( {x}_t\in {\mathfrak{R}}^n \) and \( {w}_t\in {\mathfrak{R}}^m \) is state noise, \( {y}_t\in {\mathfrak{R}}^d \) represents measurement vector of the sampling channel output and \( {v}_t\in {\mathfrak{R}}^d \) represents measurement noise. Also, the θ = {At, Bt, Ct, Dt} represents the channel parameters and the state vector {xt}t which are the unknown can be estimated by measurement vector {yt}. At, Bt, Ct and Dt represent state matrix, process noise matrix, output matrix and measurement noise matrix respectively. These time varying properties adapt dynamically to the variety of output spectrum sensed. For example, vt and ωt represent Gaussian noise captured at each time step, which introduces uncertainty. These attributes are used to capture the randomness of time-varying parallel channels to obtain a suitable state space model. Therefore, the state estimation of the predicted received signal can be obtained. The state space model feeds the basic received signal in the CRSN scenario with the help of transceivers which are acting as the secondary users (SU). These signals are then used by the respective CHs inside their cluster for further communication set-up with the other nodes.

3.2 System parameter estimation

Expectation-Maximization (EM) algorithm is used to calculate and estimate the channel parameters θ = {At, Bt, Ct, Dt} [11, 35]. When the measurement data YN is provided for calculating the maximum likelihood (ML) which estimates with the given parameters, the EM algorithm is an iterative numerical scheme. This requires two steps for calculation:

  1. A.

    The log-likelihood function is performed for calculation of the conditional expectation, as shown:

$$ \varLambda \left(\theta, {\theta}_t\right)={E}_{\theta_t}\left\{\log \frac{d{P}_{\theta }}{d{P}_{\theta_t}}|{y}_T\right\} $$
(7)
  1. B.

    This calculates the dynamic channel conditions for WMSN as:

$$ {\theta}_{l+1}\in \arg {\max}_{\theta \in \Theta}\Lambda \left(\theta, {\theta}_t\right) $$
(8)

Here, step-A and step-B will be repeated before the system parameters converge to the actual parameters ‖θl − θl − 1‖ ≤ ε. P0 represents the measure of a fixed probability. Those parameters in the system θt induce a set of measuring probability is indicated by \( \left\{{P}_{\theta_t};{\theta}_t\in \Theta \right\} \), which is related to P0. Therefore, P0 can be represented by:

$$ {P}_0=\left\{\begin{array}{c}{x}_{t+1}={w}_t\\ {}{y}_t={v}_t\end{array}\right. $$
(9)

Expectation maximization can be written as the following formulas:

$$ \hat{A}=E\kern0.24em \left(\sum \limits_{t=1}^N{\hat{x}}_t{x}_{t-1}^{\hat{T}}|{Y}_N\right)\times \left[E\kern0.24em \left(\sum \limits_{t=1}^N{\hat{x}}_t{\hat{x}}_t^T|{Y}_N\right)\right] $$
(10)
$$ {\hat{B}}^2=\frac{1}{N}E\left(\sum \limits_{t=1}^N\left({\hat{x}}_t-A{\hat{x}}_{t-1}\right){\left({\hat{x}}_t-A{\hat{x}}_{t-1}\right)}^T|{Y}_N\right) $$
(11)
$$ C=E\kern0.24em \left(\sum \limits_{t=1}^N{\hat{y}}_t{\hat{x}}_t^T|{Y}_N\right)\times \left[E\kern0.24em \left(\sum \limits_{t=1}^N{\hat{x}}_t{\hat{x}}_t^T|{Y}_N\right)\right] $$
(12)
$$ {\hat{D}}^2=\frac{1}{N}E\left(\sum \limits_{t=1}^N\left({\hat{y}}_t-C{\hat{x}}_t\right){\left({\hat{y}}_t-C{\hat{x}}_t\right)}^T|{Y}_N\right) $$
(13)

wherein, N observation samples were used. \( {\hat{x}}_t \) represents the value estimated using the Kalman filter at time t. At each numerical iteration, we can use Eqs. (10, 11, 12 and 13) to perform an EM algorithm estimation of the state space model. Compared to the Newton-Raphson method, the EM algorithm is simpler because its numerical iteration is linear. System parameters estimation can be obtained based on conditional expectations:

In the Euclidean space, ei is the unit vector. When the ith position shows et = 1, the other positions become 0. For example, taking m = 2, then the expected value is:

$$ E\kern0.24em \left(\sum \limits_{t=1}^N{\hat{x}}_t{x}_t^{\hat{T}}Q{x}_t|{Y}_N\right)=\left[\begin{array}{c}{L}_N^{(3)}\left({R}_11\right)\\ {}{L}_N^{(3)}\left({R}_12\right)\end{array}\right.\;\;\;\;\;\;\;\left.\begin{array}{c}{L}_N^{(3)}\left({R}_21\right)\\ {}{L}_N^{(3)}\left({R}_22\right)\end{array}\right] $$
(14)

From the filters represented by Eq. (11), we can get that following recursive equation applies to matrix \( {r}_t^{(1)}\; and\kern0.24em {N}_i^{(1)} \) which trace is given by Tr(.):

$$ {\displaystyle \begin{array}{c}{r}_t^{(1)}=\left({A}_{t-1}-{P}_{t\mid t}{C}_{t-1}^T{D}_{t-1}^{-2}{C}_{t-1}{A}_{t-1}\right)\kern0.24em {r}_{t-1}^{(1)}+2{P}_{t\mid t}Q{x}_{t\mid t-1}-{P}_{t\mid t}{N}_t^{(1)}\;{P}_{t\mid t}\;{C}_{t-1}^T{D}_{t-1}^{-2}\left({y}_t-{C}_{t-1}{x}_{t\mid t-1}\right)\\ {}{N}_t^{(1)}={B}_{t-1}^{-2}{A}_{T-1}{\overline{P}}_{t\mid t}{N}_{t-1}^{(1)}{\overline{P}}_{t\mid t}{A}_{t-1}^T{B}_{t-1}^{-2}-2Q\\ {}{N}_0^{(1)}={0}_{m\times m}\end{array}} $$
(15)

3.3 WMSN based channel state estimation

Improving the resolution of the PSD by the water-fill algorithm belongs to the system state estimation of the dynamic channel. xt is the system state which is estimated by Kalman Filter. When the system parameter θt is given, the measured value Yt is also given. The EM algorithm based on the Kalman filter produces a maximum likelihood (ML) parameter estimate, and the mean square is used to optimally estimate the state when the unit variance of ωkand vk is Gaussian and the zero mean is independent. Thus, the sequence for state estimation becomes by using Kalman filter properties can be written as:

$$ {\displaystyle \begin{array}{c}{P}_{t\mid t}={A}_{t-1}{P}_{t-1\mid t-1}{A}_{t-1}^T+{B}_{t-1}^2\\ {}{P}_{t\mid t}^{-1}={C}_{t-1}^T{D}_{t-1}^{-2}C+{B}_{t-1}^{-2}-{B}_{t-1}^{-2}{\overline{P}}_{t\mid t}^{-1}{A}_{t-1}^T{B}_{t-1}^{-2}\\ {}{\overline{P}}_{t\mid t}^{-1}={P}_{t\mid t}^{-1}+{A}_{t-1}^T{B}_{t-1}^{-2}{A}_{t-1}\end{array}} $$

Among them, when \( {B^2}_t={B}_t{B}_t^T, and\kern0.24em \;{D^2}_t={D}_t{D}_t^T.{P}_{t\mid t} and\kern0.24em {\hat{x}}_{t\mid t} \) can perform recursive calculations. A step prediction is performed when system parameters are estimated by using Kalman filter.

$$ {\hat{y}}_{t+1}={\hat{C}}_t\left({\hat{A}}_t{\hat{x}}_{t\mid t}+{\hat{K}}_t\left({y}_t-{\hat{C}}_t{\hat{x}}_{t\mid t}\right)\right) $$
(16)

Wherein, \( {\hat{y}}_{t+1} \) is the predicted channel state at time t + 1, and the Kalman gain is denoted by \( {\hat{K}}_t \) as follows:

$$ {\hat{K}}_t=\left({\hat{A}}_{t-1}{P}_{t\mid t}{\hat{C}}_{t-1}^T\right)\left({C}_{t-\hat{1}}{P}_{t\mid t}{\hat{C}}_{t-1}^T+{D}_{t-1}^{\hat{2}}\right) $$
(17)

3.4 Analysis of DAI for power allocation in CRSN

As discussed earlier, DAI is part of AI and it deals the whole process based on Multi-Agent Systems. In our work we have used this system to utilize the power in CRSN for secondary user in more efficient way. The formation of cluster is depending on the power spectrum similarity in vacant spaces and the respective distances between the SUs. The CH is selected and the coordination between the SU nodes is made for communication. At the time of communication CHs have used the DAI for their resource management [8, 26]. The cooperative communication during clustering is assumed to be dynamic with nodes are positioned with Poisson distribution to analyze the calculation of power requirement [27].

At any time instant ‘t’, the consumed power by the sensor nodes may be written as:

$$ {P}_{(t)}={P}_{\left(t-1\right)}{P}_{r_{(CoA)(MA)}}-{P}_{r_{(TA)}}{L}_{t_{\left(t-1\right)}} $$
(18)
$$ {P}_{(t)}={P}_{\left(t-1\right)}{P}_{r_{(DA)(MA)}}-{P}_{r_{(DA)}}{L}_{t_{\left(t-1\right)}} $$
(19)

Here, P(t) denotes the power of the overall network at time ‘t’, \( {P}_{\left(t-1\right)}{P}_{r_{(CoA)(MA)}} \) is combine the power consumed of CoA and MA by same or different CH(s), similarly \( {P}_{r_{(TA)}} \) and \( {P}_{r_{(DA)}} \) are the power consumption for TA and DA processing to take from the active SU nodes in each clusters. For the best fit flan, the power consumed at time “t-1” is denoted as \( {L}_{t_{\left(t-1\right)}} \). Now, according to the Eq. (19) and [27] it can be seen that the CoA acts as DA for some specific objectives or specific tasks. The specific task can be different based on the requirement of the application. The whole management of task assignment is considered for WMSN in CR scenario. Therefore, based on the communication between CoA-CH and MA-CH, the task assigned to the overall network is been verified after every repetition of a round or simulation. In our experiment, we have considered 10,000 simulations. By increasing more number of simulations, the response time decrease.

4 Simulation and results

While calculating and simulating using the water-fill algorithm, εnand εn − 1 range from −60 to-80 in dB, in Eq. (6): gn = 20 and assuming Γ = 1 (0 dB), the number of channels, i.e. N (Number of channels) = 10, and xt = bn. Substituting the corresponding unknowns in Eqs. (10, 11, 12 and 13) with the values calculated in Eq. (6), we get

$$ \hat{A}=E\kern0.24em \left[\begin{array}{c}\left({\hat{x}}_1{\hat{x}}_{t-1}^T|{Y}_N\right)+\left({\hat{x}}_2{\hat{x}}_{t-2}^T|{Y}_N\right)+\left({\hat{x}}_3{\hat{x}}_{t-3}^T|{Y}_N\right)\\ {}+\left({\hat{x}}_4{\hat{x}}_{t-4}^T|{Y}_N\right)+\left({\hat{x}}_5{\hat{x}}_{t-5}^T|{Y}_N\right)+\left({\hat{x}}_6{\hat{x}}_{t-6}^T|{Y}_N\right)\\ {}+\left({\hat{x}}_7{\hat{x}}_{t-7}^T|{Y}_N\right)+\left({\hat{x}}_8{\hat{x}}_{t-8}^T|{Y}_N\right)+\left({\hat{x}}_9{\hat{x}}_{t-9}^T|{Y}_N\right)+\\ {}\left({\hat{x}}_{10}{\hat{x}}_{t-10}^T|{Y}_N\right)\end{array}\right]\times {\left[10\;E\;|{Y}_N\right]}^{-1} $$

Taking the constants for the above equation, we can get:

$$ \hat{A}=12.090 $$

In Eq. (13), taking \( \hat{A}=12.090 \) and putting the value xt = bn we get

$$ {\displaystyle \begin{array}{c}{\hat{B}}^2=\frac{1}{10}E\;\left(\sum \limits_{t=1}^{10}1\;\left|{Y}_N\right.\right)\\ {}=\frac{1}{10}E\left(10\;\left|{Y}_N\right.\right)\;\end{array}} $$

Also taking the constants for the above equation, we can get:

$$ {\hat{B}}^2=1 $$

After calculating C by substituting Eq. (6) into Eq. (14), we can get:

$$ {\displaystyle \begin{array}{c}C=E\;\left(10\;\left|{Y}_N\right.\right)\times E\left(10\left|{Y}_N\right.\right)\\ {}C=100\end{array}} $$

To find the value of D, we put the value of C and Eq. (6) in Eq. (15),

$$ {\displaystyle \begin{array}{c}{\hat{D}}^2=\frac{1}{10}E\left(10\;\left|{Y}_N\right.\right)\\ {}{\hat{D}}^2=1\end{array}} $$

The values of A, B, C, and D obtained above are substituted into the Eq. (17) in the system state estimation, and the Kalman gain can be obtained as:

$$ {\hat{K}}_t=\left(12.090\times {P}_{t\mid t}\times \frac{1}{100}\right)\;\left(100\times {P}_{t\mid t}\times \frac{1}{100}+1\right) $$
(20)

From the above analysis, it can be seen that the coefficient convergence of the state space model which using the proposed method. In addition, increasing the device gain can decrease the degree of dependence on state vector, but it is constrained with channels of spectrum sensing which has a limited number.

As shown in Fig. 4, the proposed approach of multiple clusters and single cluster are considered. The results show a proven performance by the multiple and single cluster based communication with respect to probability of false alarm and probability of detection. These conditions justify the performance of the SUs. The performance analysis results of the conventional method based on demodulator and low pass filter for the proposed dynamic channel modelling method are respectively shown in Fig. 4. It can be clearly seen from Fig. 4 that the power distribution by the proposed method is less distorted than the conventional method, i.e. the Blackman-Haris window can improve the PSD of the sensing spectrum. Therefore, the power level at the center frequency is improved from −22.14 dB to −15.20 dB (approximately).

Fig. 4
figure 4

Comparison of SNR between conventional and proposed method for detection and false-alarm conditions

Figure 5 illustrates the system response for the multi-cluster communication. According to our proposed method, the response time defines the time taken by the nodes to communicate between clusters with increasing number of simulations. Therefore, it is shown in Fig. 5 that compare to conventional method, proposed method after application of DAI shows the smooth curve with respect to number of simulations, which signifies the response time is less.

Fig. 5
figure 5

Response time comparison between conventional and CoA-MA communication

5 Conclusion

The critically time delayed multimedia applications demand more spectrum. The CR technology is more significant and efficient one which can utilize spectrum resources in a manner that gains more bandwidth in WMSN. The beginning of physical layer of CR is spectrum sensing and its output is separately sent to the allocation and management of the spectrum. The power allocation achieved by the water filling algorithm is controlled by the spectrum sensing output, and the robustness of the proposed method is further analyzed by modeling the dynamic channel. Using energy detection and Blackman-Haris window technology to calculate and simulate estimation of model state, thereby further optimizing the power allocation. In order to get swift and fast communication between the sensor nodes, we have used DAI and it is found that it is more efficient and less time consuming method for inter and intra cluster communication. In this paper, we kept the device gain at a fixed value of 20 dB and considered the case when the noise reaches its maximum. Compared to the traditional methods, the proposed method achieves a minimum of 5 dB (approximate) optimization. Further research can be considered by increasing the number of channels, achieving coverage of spectrum sensing, and underlying processes.