1 Introduction
Intelligent Reflecting Surface (IRS) has recently emerged as a promising new technology for enhancing wireless communications both spectralefficiently and energyefficiently by controlling the propagation environment [1, 2, 3]. Specifically, IRS is a planar surface consisting of a massive number of passive and programmable elements reflecting incident signals with phase shifts [3]. By smartly tuning the phase shifts, an IRS is able to reconfigure propagation environments for constructive signal combination and interference cancellation at the receivers, thereby enhancing the communication performance [3].
To fully explore the benefits of IRS, the acquisition of the channel state information (CSI) plays a critical role in passive beamforming. [4, 5] proposed to estimate IRSrelated channels based on training signals sent by transmitter or receiver. Assuming the perfect CSI, [6, 7] studied the problem of minimizing the base station (BS) transmit power by jointly optimizing the active beamforming at the BS and passive beamforming at the IRS. Furthermore, IRS has been jointly designed with other existing technologies, e.g., nonorthogonal multiple access (NOMA) [8] and overtheair computation [9]. In particular, the IRSrelated channel capacity characterization is studied in [10]. However, there’s no work on the use of IRS for providing massive device connectivity for the Internet of Things (IoT). In this paper, we propose to equip the IoT network with an IRS in order to support massive device connectivity.
Massive device connectivity has been identified as one of the three main use cases in the upcoming 5G network, along with enhanced mobile broadband and ultrareliable, lowlatency communications [11, 12]. In such a scenario, a large number of mobile devices are connected to the Internet via the BS with sporadic communications, e.g., only a small fraction of connected devices are active [13]. To overcome the challenge of detecting active devices and estimating their channels, [14, 15] studied the activity detection and channel estimation problem for massive connectivity from the view of information theory. By exploiting the sparse activity pattern, the problem is formulated as a compressed sensing problem and resolved by the approximate message passing (AMP) [16, 17]. However, all these works treated the communication channels as an uncontrollable environment, and in some cases, harsh propagation environments can significantly degrade the system performance [2]. Hence, we shall propose an IRSassisted IoT network for massive connectivity to improve propagation environment.
In this paper, we consider an uplink IRSassisted IoT network, where a single BS serves a massive number of mobile devices with the assist of an IRS. Specifically, our goal is to jointly detect active devices and estimate the IRSrelated channels. We call this problem as the IRSrelated activity detection and channel estimation problem. In fact to our best knowledge, the problem has not been studied in the prior works. Due to unfavorable propagation conditions, the direct link between the BS and the devices has negligible received signals and thus we ignore the deviceBS channel [18, 1, 19]. However, deployment of an IRS poses new challenges, e.g., passive elements on the IRS can not process incident signals and there are more links to estimate [4, 5, 10]. To overcome these challenges, we formulate the IRSrelated activity detection and channel estimation problem as sparse matrix factorization [20, 21], matrix completion and Multiple Measurement Vector (MMV) problem [22]. To solve the problem, we propose a threestage framework based on the approximate message passing (AMP) including the BiGAMP algorithm [23]
for sparse matrix factorization, the Singular Value Thresholding (SVT) algorithm
[24] for matrix completion and the Vector AMP algorithm [16] for the MMV problem. Simulation results demonstrate that the propose algorithm can achieve IRSrelated device activity detection and channel estimation for an IRSassisted ToT network.Notations. () denotes the set of real (complex) numbers. is the th entry of a matrix , and the operation with returns a diagonal matrix where .
denote transpose operation, nuclear norm, the Hadamard product and standard complex Gaussian distribution.
2 System Model
Consider an IRSassisted IoT network in Fig 1, where the IRS consists of reflecting elements and the BS is equipped with antennas to serve singleantenna mobile devices. Due to unfavorable propagation conditions, the direct link between the BS and the devices has negligible received signals and thus we ignore the deviceBS channel [18, 1, 19]. We define as the channel vector from the th device to the IRS. The channel matrix from the IRS to the BS is denoted by . We assume a blockfading channel model where the channel is quasistatic in each block of length . Furthermore, we consider Rayleigh fading and the pathloss fading for all the channels, e.g., and , where and denote the pathloss components.
In this paper, we focus on sporadic communications [13, 25]
, e.g., only a subset of all devices are active in each coherence block with probability
and denotes the active state of the th device, otherwise . For the propose of IRSrelated device activity detection and channel estimation, the th device will transmit a unique signature sequence where is the sequence length. Then, for all , the uplink signal received by the BS can be written as(1) 
where is the additive noise at time slot
, and the variance
depends on the background noise power normalized by the device transmit power. is defined as the phaseshifting vector of the IRS, where and are on/off state and the phase shift of the th reflecting element on the IRS at the time slot , respectively.Let and be the channel matrix of all deviceIRS links and the known signature matrix, respectively. Considering time slots in each coherence block, the received signals by the BS can be expressed in matrix form as
(2) 
where is the additive Gaussian noise, and denote the activity matrix and the phaseshifting matrix, respectively.
This paper focuses on the regime where the number of devices is much larger than the signature sequence length, i.e., . Therefore, it is impossible to assign the mutually orthogonal signature sequences to all devices. Inspired by [16], the signature sequence of the th device is generated from i.i.d complex Gaussian distribution with zero mean and variance one, i.e., .
3 Problem Formulation
The goal of this paper is to jointly detect the activity matrix and estimate the IRSrelated channel matrices from the IRS to the BS and from the active devices to the IRS, given the received signals , the phaseshifting matrix and the known signature matrix in the regime where . We call this problem as the IRSrelated activity detection and channel estimation problem. For simplicity, we introduce the following variables
(3)  
(4)  
(5) 
Since the activity matrix is a sparse diagonal matrix, has the group sparsity on its column [26]. Then, the system model (2) can be expressed as
(6) 
From the definition (5), we can see that the matrix has the same sparsity pattern as the phaseshifting matrix . Hence, by designing the matrix as a sparse matrix, we can recover the matrix and the matrix from the observations via the techniques of sparse matrix factorization [20, 21]. Specifically, we design the phaseshifting matrix as follows: the on/off state of the th reflect element on the IRS at the time slot
are generated independently from Bernoulli distribution with the probability
of taking the value . In addition, we generate the phase shiftsaccording to the standard uniform distribution within
.Due to the sparsity of the matrix and (5), we have to recover the missing entries of given the estimated matrix and the phaseshifting matrix . Note that is lowrank due to the group sparsity of . Hence, this subproblem can be formulated as a matrix completion problem and solved by exploiting the lowrank property of .
Finally, recovering the from the estimated matrix and the known signature matrix turns out to be the Multiple Measurement Vectors (MMV) problem in compressed sensing [22].
In summary, the original problem can be solved through the following three stages:

Sparse Matrix Factorization: Recovering the matrices and from the observations ;

Matrix Completion: Completing the missing entries of given the estimated matrix and the phaseshifting matrix ;

Multiple Measurement Vectors: Estimating the matrix from the estimated matrix and the known signature matrix .
Once obtaining the estimated matrix , the activity matrix can be recovered via the group sparsity of as follows
(7) 
where is some small nonnegative threshold and is the th column of the estimated matrix . Thus, the estimated matrix can be estimated by setting its th column as where [25].
4 Proposed IRSRelated Activity Detection and Channel Estimation Algorithm
To solve IRSrelated activity detection and channel estimation problem, we establish a threestage framework based on the approximate message passing (AMP) algorithm. As shown in Algorithm 1, the architecture of overall algorithm consists of the BiGAMP algorithm [23] for sparse matrix factorization, the Singular Value Thresholding (SVT) algorithm [24] for matrix completion and the Vector AMP algorithm [16] for the MMV problem. We will explain the details of the proposed algorithm in the following subsections.
4.1 Sparse Matrix Factorization via BiGAMP
First, we adopt an extension of the AMP algorithm, the BiGAMP algorithm [23] to solve the following generalized bilinear inference problem: estimate matrices and from the observations according to (6). The BiGAMP algorithm solves the sparse matrix factorization problem by modeling and as random matrices. Specifically, we introduce the following maximum a posteriori (MAP) estimation problem:
(8) 
where and we assume that the likelihood function is known and separable, i.e.,
(9) 
Furthermore, we assume the entries of obey the i.i.d Gaussian prior and the entries of obey the i.i.d zeromean BernoulliGasussian prior [23]. Hence, the prior of and can be modeled as follows
(10)  
(11) 
where denotes the sparsity level of ; and are the variances of and , respectively. To achieve the estimation, the BiGAMP algorithm infers and from the above model so that the corresponding estimated matrices and can be multiplied to yield an estimate up to the permutation and phase ambiguities. Details of the BiGAMP can be found in [23].
4.2 Matrix Completion via SVT
After sparse matrix factorization and ambiguity elimination in section 4.1, we obtain the estimates and . Due to the design of the phaseshifting matrix , we have to recover the missing entries in from the estimated matrix . According to (5), has the same sparsity pattern as . By exploiting the lowrank property of , we shall solve the following optimization problem:
(12)  
subject to  (13) 
where . denotes an orthogonal projector onto the subspace spanned by matrices with sampled entries in , namely, the th entry in is equal to if and zero otherwise. To solve such a matrix completion problem, we apply the Singular Value Thresholding (SVT) algorithm [24]. Specifically, for a constant and a sequence , starting with , the iterations of SVT proceed as
(14) 
where is a softthresholding operator at level to the singular values of the input matrix, which is defined as and is the positive part of the input, e.g., .
4.3 MMV problem via Vector AMP
As for the MMV problem of recovering from the estimated matrix and the known signature matrix , we adopt the Vector AMP algorithm proposed in [27], which operates a vector denoiser on each column vector of the matching filter output. initializing with and , the iterations of the vector AMP algorithm are defined as
(15)  
where is the th column vector of the estimated matrix at iteration t, is the corresponding residual, is a vector denoiser that operates on the th column vector of , and is the firstorder derivative of . Here, we apply the MMSE denoiser derived in [17], and this denoiser has the following form:
where
with and denoting pathloss component.
5 Simulation
We carry out numerical experiments to evaluate the performance of the proposed algorithm for massive device connectivity with employment of IRS, where the direct path is ignored due to unfavorable propagation conditions [18, 1, 19].
For all the considered channels, we assume Rayleigh fading and the path loss [17, 6]. The path loss model is given by where is the path loss at the reference distance . In our setting, , dB, and the path loss component for devicetoIRS link and IRStoBS link are set as 2 and 2.8, respectively [6, 9]. The th devicetoIRS distance is randomly generated from 500m to 1000m and the IRStoBS distance
is 100m. We suppose the noise power normalized by the device transmit power, and thus the signaltonoise ratio (SNR) is defined as
where is the variance of the noise. We resolved the permutation and phase ambiguities based on the true values of and . For all the simulations: the signature matrix is generated from , and we set IRS elements, antennas at the BS and devices among which each device is active with probability , and the sparsity of the phaseshifting matrix is fixed at 0.5.The performance of recovering the IRSrelated channels is evaluated in terms of normalized meansquareerror (NMSE). To benchmark the estimation of the IRSrelated channel , we compare the proposed algorithm with other two algorithms of sparse matrix factorization, KSVD [28] and SPAMS [29]. In Fig.2, we show that the proposed algorithm significantly outperforms other two baseline algorithms, which demonstrates the effectiveness of our algorithm.
We illustrate the activity recovery error rate versus the SNR for different values of the signature sequence length . We can see that the larger , the faster the error rate can be driven to zero as the SNR increases. As shown in Fig. 2, we can not recover any active device without the IRS under unfavorable propagation conditions, however, this issue can be resolved by deploying an IRS in IoT networks. Furthermore, we consider the noiseless case and study the empirical success probability of recovering the IRSrelated channel versus . We declare successful recovery if the NMSE of
dB and record the success probability from 50 trials. The sharp phase transition result in Fig.
2 are thus able to guide the selection of the signature sequence length.6 Conclusion
In this work, we considered the device activity detection and channel estimation problem for the IRSassisted IoT network. We establish a threestage framework including the BiGAMP algorithm for sparse matrix factorization, the Singular Value Thresholding algorithm for matrix completion and the Vector AMP algorithm for the multiple measurement vector problem. To the end, we provided the simulation results to verify the effectiveness of the proposed algorithm.
References
 [1] E. Basar, M. Di Renzo, J. De Rosny, M. Debbah, M. Alouini, and R. Zhang, “Wireless communications through reconfigurable intelligent surfaces,” IEEE Access, vol. 7, pp. 116 753–116 773, 2019.
 [2] C. Liaskos, S. Nie, A. Tsioliaridou, A. Pitsillides, S. Ioannidis, and I. Akyildiz, “A new wireless communication paradigm through softwarecontrolled metasurfaces,” IEEE Commun. Mag., vol. 56, no. 9, pp. 162–169, Sep. 2018.
 [3] Q. Wu and R. Zhang, “Towards smart and reconfigurable environment: Intelligent reflecting surface aided wireless network,” IEEE Commun. Mag., Early Access. [Online]. Available: https://arxiv.org/abs/1905.00152
 [4] D. Mishra and H. Johansson, “Channel estimation and lowcomplexity beamforming design for passive intelligent surface assisted miso wireless energy transfer,” in Proc. IEEE Int. Conf. Acoust., Speech Signal Process. (ICASSP), Brighton, U.K., May 2019, pp. 4659–4663.
 [5] Z.Q. He and X. Yuan, “Cascaded channel estimation for large intelligent metasurface assisted massive mimo,” CoRR, vol. abs/1905.07948, 2019. [Online]. Available: https://arxiv.org/abs/1905.07948
 [6] Q. Wu and R. Zhang, “Intelligent reflecting surface enhanced wireless network via joint active and passive beamforming,” IEEE Trans. Wireless Commun., pp. 1–1, 2019.
 [7] ——, “Beamforming optimization for intelligent reflecting surface with discrete phase shifts,” in Proc. IEEE Int. Conf. Acoust., Speech Signal Process. (ICASSP), Brighton, U.K., May 2019, pp. 7830–7833.
 [8] M. Fu, Y. Zhou, and Y. Shi, “Intelligent reflecting surface for downlink nonorthogonal multiple access networks,” in Proc. IEEE Global Commun. Conf. (Globecom) Workshops, Hawaii, USA, Dec 2019.
 [9] T. Jiang and Y. Shi, “Overtheair computation via intelligent reflecting surfaces,” in Proc. IEEE Global Commun. Conf. (Globecom), Hawaii, USA, Dec 2019. [Online]. Available: https://arxiv.org/abs/1904.12475
 [10] S. Zhang and R. Zhang, “Capacity characterization for intelligent reflecting surface aided mimo communication,” CoRR, vol. abs/1910.01573, 2019. [Online]. Available: https://arxiv.org/abs/1910.01573
 [11] J. G. Andrews, S. Buzzi, W. Choi, S. V. Hanly, A. Lozano, A. C. K. Soong, and J. C. Zhang, “What will 5g be?” IEEE J. Sel. Areas Commun., vol. 32, no. 6, pp. 1065–1082, June 2014.
 [12] K. B. Letaief, W. Chen, Y. Shi, J. Zhang, and Y. A. Zhang, “The roadmap to 6g: Ai empowered wireless networks,” IEEE Commun. Mag., vol. 57, no. 8, pp. 84–90, August 2019.
 [13] G. Wunder, H. Boche, T. Strohmer, and P. Jung, “Sparse signal processing concepts for efficient 5g system design,” IEEE Access, vol. 3, pp. 195–208, 2015.
 [14] W. Yu, “On the fundamental limits of massive connectivity,” in Proc. Inf. Theory Appl. Workshop, San Diego, Ca, USA, Feb 2017, pp. 1–6.
 [15] X. Chen, T. Chen, and D. Guo, “Capacity of gaussian manyaccess channels,” IEEE Trans. Inform. Theory, vol. 63, no. 6, pp. 3516–3539, June 2017.
 [16] Z. Chen, F. Sohrabi, and W. Yu, “Sparse activity detection for massive connectivity,” IEEE Trans. Signal Process., vol. 66, no. 7, pp. 1890–1904, April 2018.
 [17] L. Liu and W. Yu, “Massive connectivity with massive mimo—part i: Device activity detection and channel estimation,” IEEE Trans. Signal Process., vol. 66, no. 11, pp. 2933–2946, June 2018.
 [18] C. Huang, A. Zappone, G. C. Alexandropoulos, M. Debbah, and C. Yuen, “Reconfigurable intelligent surfaces for energy efficiency in wireless communication,” IEEE Trans. Wireless Commun., vol. 18, no. 8, pp. 4157–4170, Aug 2019.
 [19] C. Huang, A. Zappone, M. Debbah, and C. Yuen, “Achievable rate maximization by passive intelligent mirrors,” in Proc. IEEE Int. Conf. Acoust., Speech Signal Process. (ICASSP), Alberta, Canada, April 2018, pp. 3714–3718.
 [20] Y. Koren, R. Bell, and C. Volinsky, “Matrix factorization techniques for recommender systems,” Computer, vol. 42, no. 8, pp. 30–37, Aug 2009.

[21]
H. Liu, X. Yuan, and Y. J. Zhang, “Superresolution blind channelandsignal estimation for massive mimo with onedimensional antenna array,”
IEEE Trans. Signal Process., vol. 67, no. 17, pp. 4433–4448, Sep. 2019.  [22] J. Chen and X. Huo, “Theoretical results on sparse representations of multiplemeasurement vectors,” IEEE Trans. Signal Process., vol. 54, no. 12, pp. 4634–4643, Dec 2006.
 [23] J. T. Parker, P. Schniter, and V. Cevher, “Bilinear generalized approximate message passing—part i: Derivation,” IEEE Trans. Signal Process., vol. 62, no. 22, pp. 5839–5853, Nov 2014.
 [24] J. Cai, E. Candès, and Z. Shen, “A singular value thresholding algorithm for matrix completion,” SIAM J. Optim., vol. 20, no. 4, pp. 1956–1982, 2010.
 [25] T. Jiang, Y. Shi, J. Zhang, and K. B. Letaief, “Joint activity detection and channel estimation for iot networks: Phase transition and computationestimation tradeoff,” IEEE Internet Things J., vol. 6, no. 4, pp. 6212–6225, Aug 2019.
 [26] M. Wainwright, “Structured regularizers for highdimensional problems: Statistical and computational issues,” Annual Review of Statistics and Its Application, vol. 1, pp. 233–253, 01 2014.
 [27] J. Kim, W. Chang, B. Jung, D. Baron, and J. C. Ye, “Belief propagation for joint sparse recovery,” CoRR, vol. abs/1102.3289, 2011. [Online]. Available: https://arxiv.org/abs/1102.3289
 [28] M. Aharon, M. Elad, and A. Bruckstein, “Ksvd: An algorithm for designing overcomplete dictionaries for sparse representation,” IEEE Trans. Signal Process., vol. 54, no. 11, pp. 4311–4322, Nov 2006.
 [29] J. Mairal, F. Bach, J. Ponce, and G. Sapiro, “Online learning for matrix factorization and sparse coding,” J. Mach. Learn. Res., vol. 11, pp. 19–60, Mar. 2010.