## 2 Signal Processing Principles
### Codeword-Level Maximum Likelihood Decoding  
To mitigate the effects of channel gain drift and photon statistical noise, a frame header-based statistical estimation method is proposed. In the preamble section of the transmitted frame, a symbol sequence composed of known bits enables the receiver to estimate the expected photon count \(\lambda_{i}^{\text{header}}\) for each frequency channel. The estimation formula is given by the following:  
\[\lambda_{i}^{\text{header}}=\frac{1}{N}\sum_{i=1}^{N}S_{i}^{\text{header}}(t) \tag{10}\]  
\(N\) denotes the number of frame header symbols used for estimation. \(S_{i}^{\text{header}}\) represents photon count received at frequency \(f_{i}\) during frame header period. Due to potential signal gain fluctuations caused by atmospheric turbulence, fiber nonlinear effects, or pointing errors in optical channels, an adaptive normalization factor is further introduced to compensate for these variations.  
\[\lambda_{i}^{\text{norm}}(b)=\lambda_{i}^{\text{header}}\times\frac{S_{i}^{ \text{sum}}}{\lambda_{i}^{\text{ideal}}} \tag{11}\]  
where \(S_{i}^{\text{sum}}\) denotes the cumulative photon count over the entire codeword duration. \(\lambda_{i}^{\text{ideal}}\) represents the theoretical photon count in the ideal case.  
To enhance detection robustness, the received photon counts are accumulated over the entire symbol duration \(T_{s}\) instead of relying on single-point instantaneous sampling. Assuming that each code element contains \(T_{s}\) discrete time sampling points, the accumulated photon count is given by the following:  
\[S_{i}^{\text{sum}}=\sum_{k=t}^{t+T_{s}}S_{i}(k) \tag{12}\]where \(S_{i}(k)\) denotes the photon count at the sampling moment at time k. \(T_{s}\) denotes the duration of the code element. This method averages out high-frequency noise fluctuations through time integration, thereby enhancing the signal matching degree. The photon counts after code element level accumulation still obey Poisson distribution, and this approach reduces the relative variance and improves signal stability.  
After obtaining the cumulative photon counts \(S_{i}^{\text{sum}}\) for all four frequency channels, the receiver needs to determine the most probable transmit bit \(b\). We use maximum likelihood estimation to find the bit value that maximizes the joint likelihood value for all four channels. For a given bit value \(b\), the joint likelihood function can be expressed as follows:  
\[L(b)=\prod_{i=1}^{4}P(S_{i}^{\text{sum}}|\lambda_{i}^{\text{norm}}(b)) \tag{13}\]  
\[\log L(b)=\sum_{i=1}^{4}(S_{i}^{\text{sum}}\log\lambda_{i}^{\text{norm}}(b)- \lambda_{i}^{\text{norm}}(b)) \tag{14}\]  
\[\hat{b}=\text{argmax}_{b}\sum_{i=1}^{4}(S_{i}^{\text{sum}}\log\lambda_{i}^{ \text{norm}}(b)-\lambda_{i}^{\text{norm}}(b)) \tag{15}\]  
Compared with the traditional maximum intensity detection, the method comprehensively considers the information of four frequency channels to improve the stability of the judgment. It utilizes the statistical characteristics of photons to optimize the likelihood function, enhancing the decoding accuracy and reducing the probability of misjudgment caused by instantaneous photon fluctuations.