# Unsupervised Detection of Multiple Sleep Stages Using a Single FMCW Radar
## 2 FMCW Radar Signal Processing  
Radar is a contactless sensing device that detects a target by estimating its orientation, distance, and speed information using the received signal--a radio wave transmitted to the target and returned to the device after being reflected off the target's surface. Radars are classified into four types based on the hardware signal transmission method: pulse, CW, SFCW, and FMCW. Furthermore, based on the signal processing method, they are classified into two types: Doppler and non-Doppler radars.  
The FMCW radar used here was a type of doppler sensor that transmits and receives electromagnetic waves whose frequency increases or decreases according to time. By analyzing the frequency difference between the transmitted signal of the FMCW radar and the received signal reflected from the target at a certain distance, the time delay and phase change of the signal can be detected. Using the variability of the signal components according to the movement of the target, both range and speed information of the target can be extracted. Radar transmits a chirp signal from its signal generator, the frequency of which increases linearly with time towards an object. The signal reflected from the object and received through the receiving antenna is then combined with the transmitted signal using a mixer. After processing the integrated signal through a low-pass filter, the frequency difference between the transmitted and received signals was obtained and converted into a digital signal using an analog-to-digital converter for signal processing.  
The transmitted signal \(T_{x}(t)\) is expressed by (1). Equation (2) includes the time delay due to the additional distance traveled by the received signal \(R_{x}(t)\) reflected from the target object.  
\[T_{x}(t) =M_{r}(t)\cdot cos(2\pi(f_{carrier}+\frac{BW\cdot t}{2\cdot T_{c}} )\cdot t) \tag{1}\] \[R_{x}(t) =M_{R}(t)\cdot cos(2\pi(f_{carrier}+\frac{BW\cdot(t-t_{d})}{2\cdot T _{c}})\cdot(t-t_{d})) \tag{2}\]  
\(M(t)\) is the magnitude of the transmitted and received signals, \(f_{carrier}\) is the carrier frequency, \(T_{c}\) is the duration of the chirp signal, and \(t_{d}\) is the time delay required for the received signal to be reflected and returned. A frequency difference is observed between the transmitted and received signals owing to the target object distance; this difference is defined as an intermediate frequency. As shown in (3), the signal \(x(t,n)\) containing the intermediate frequency component was extracted by multiplying the transmitted and received signals using the mixer, a circuit element within the radar, and applying a low-frequency filter [30].  
\[x(t,n)=\sum_{r}M(t,r)\cdot cos(2\pi\cdot f_{r}\cdot n\cdot+P(t,r)) \tag{3}\]  
where \(n\) refers to the sampling duration, \(r\) represents the distance information, \(f_{r}\) stands the intermediate frequency, and \(P(t,r)\) refers to the phase component of distance with time. A fast Fourier transform was used to extract the magnitude, frequency, and phase components of the intermediate-frequency signal, as follows:  
\[X(t,r)=\sum_{n=1}^{N}x(t,n)\cdot exp^{(-\frac{|2\pi\cdot nx}{N})} \tag{4}\]where \(N\) denotes the number of samples per chirp. When an object is placed at the distance \(r_{m}\) from the radar, the magnitude and phase of the signal are defined using \(X(t,r)\) as follows:  
\[M(t,r_{m}) =2|X(t,r_{m})|=\frac{M_{0}}{4\pi\cdot(r_{m})^{2}}\cdot r_{m} \tag{5}\] \[P(t,r_{m}) =\ \angle X(t,r_{m})=\frac{4\pi\cdot f_{c}}{c}\cdot r_{m} \tag{6}\]  
Here, \(M_{0}\) refers to the magnitude of the transmitted signal and \(c\) represents the speed of light. The magnitude and phase of the intermediate frequency obtained using the radar contain the information on distance to the target. Therefore, biometric information such as respiration, heart rate, and movement can be extracted by utilizing changes in the components of the intermediate-frequency signal that occur because of the micro-displacement of the target.