Home > WaveComBox > Toolbox > FBMC_OQAM > Synchronization > FBMC_OQAM_Synchronization.m

FBMC_OQAM_Synchronization

PURPOSE ^

FBMC-OQAM synchronization relying on algorithm [1] and extended to MIMO.

SYNOPSIS ^

function [ r_corrected, Delta_tau_hat, Delta_omega_hat ] = FBMC_OQAM_Synchronization( r, d_TR, Para )

DESCRIPTION ^

 FBMC-OQAM synchronization relying on algorithm [1] and extended to MIMO.

 function [ r_corrected, Delta_tau_est, Delta_omega_hat ] = FBMC_OQAM_Synchronization( r, d_TR, Para )

 The function works for SISO and MIMO systems.

 Input arguments:

   r: received signal. Size: vector [1, nFrameSamples].

   d_TR: vector [Para.nSubcarriers, 1] of pilot symbols.

   Para: structure containing the modulation parameters.

 Outputs arguments:

   r_corrected: received corrected signal. Size: vector [1, (Para.Ns+Para.PreambleLength)*Para.nSubcarriers(1+Para.CP)]

   Delta_tau_hat: estimated STO [sampling periods].

   Delta_omega_hat: estimated CFO [rad/s].

 References: 
   [1] Christoph Thein, Malte Schellmann, and Jürgen Peissig. "Analysis
   of frequency domain frame detection and synchronization in OQAM-OFDM
   systems." EURASIP Journal on Advances in Signal Processing, 2014.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ r_corrected, Delta_tau_hat, Delta_omega_hat ] = FBMC_OQAM_Synchronization( r, d_TR, Para )
0002 % FBMC-OQAM synchronization relying on algorithm [1] and extended to MIMO.
0003 %
0004 % function [ r_corrected, Delta_tau_est, Delta_omega_hat ] = FBMC_OQAM_Synchronization( r, d_TR, Para )
0005 %
0006 % The function works for SISO and MIMO systems.
0007 %
0008 % Input arguments:
0009 %
0010 %   r: received signal. Size: vector [1, nFrameSamples].
0011 %
0012 %   d_TR: vector [Para.nSubcarriers, 1] of pilot symbols.
0013 %
0014 %   Para: structure containing the modulation parameters.
0015 %
0016 % Outputs arguments:
0017 %
0018 %   r_corrected: received corrected signal. Size: vector [1, (Para.Ns+Para.PreambleLength)*Para.nSubcarriers(1+Para.CP)]
0019 %
0020 %   Delta_tau_hat: estimated STO [sampling periods].
0021 %
0022 %   Delta_omega_hat: estimated CFO [rad/s].
0023 %
0024 % References:
0025 %   [1] Christoph Thein, Malte Schellmann, and Jürgen Peissig. "Analysis
0026 %   of frequency domain frame detection and synchronization in OQAM-OFDM
0027 %   systems." EURASIP Journal on Advances in Signal Processing, 2014.
0028 
0029 
0030 % This file is part of WaveComBox: www.wavecombox.com and is distributed under the terms of the MIT license. See accompanying LICENSE file.
0031 % Original author: François Rottenberg, June 29, 2018.
0032 % Contributors:
0033 % Change log:
0034 %   François Rottenberg, November 1, 2018.
0035 %   Addition of the synchronization for MIMO
0036 
0037 % STO estimation
0038 M=Para.nSubcarriers/2;
0039 set_K=Para.PreamblePilotSubcarriers;
0040 nFrameSamples=length(r(1,:));
0041 Para.Ns=Para.Ns+Para.PreambleLength;
0042 if nFrameSamples>(2*(Para.Ns+6)+2*Para.kappa-1)/2*2*M
0043     Para.Ns=Para.Ns+6;
0044 end
0045 
0046 
0047 if Para.N_R==1 && Para.N_T==1    
0048     z = Demodulator( r, Para ); % FBMC demodulation
0049     xi=zeros(2*Para.Ns,1);
0050     for l_test=1:2*Para.Ns-2
0051         xi(l_test)=2*abs(z(set_K,l_test)'*z(set_K,l_test+2) )/sum (abs(z(set_K,l_test)).^2+abs(z(set_K,l_test+2)).^2);
0052     end
0053     [~,l_hat]=max(xi);
0054     % Two-step CFO estimation & correction
0055     epsilon_hat_coarse=1/2/pi*angle( z(set_K,l_hat)'*z(set_K,l_hat+2) );
0056     r_CFO_corrected=r.*exp(-1j*2*pi*epsilon_hat_coarse/Para.nSubcarriers*(0:nFrameSamples-1));
0057     epsilon_hat=epsilon_hat_coarse;
0058     for l=1:2
0059         z = Demodulator( r_CFO_corrected, Para );
0060         epsilon_hat_fine=1/2/pi*angle( z(set_K,l_hat)'*z(set_K,l_hat+2) );
0061         epsilon_hat=epsilon_hat+epsilon_hat_fine;
0062         r_CFO_corrected=r.*exp(-1j*2*pi*epsilon_hat/Para.nSubcarriers*(0:nFrameSamples-1));
0063     end
0064     z = Demodulator( r_CFO_corrected, Para );
0065     
0066     % STO estimation
0067     tau_hat_CFE=1/4/pi*angle(sum(z(set_K,l_hat).*conj(circshift(z(set_K,l_hat),-1)  )./d_TR(set_K)./circshift(d_TR(set_K),-1) )  ...
0068         +  sum(z(set_K,l_hat+2).*conj(circshift(z(set_K,l_hat+2),-1)  )./d_TR(set_K)./circshift(d_TR(set_K),-1)) ); % Factor -1 car on prend déjà le bon set, petit erreur car toutes les sous porteuses sont pas actives
0069     
0070     L_tau_hat_CFE=floor(tau_hat_CFE*2*M);
0071     Delta_tau_hat=(l_hat-1)*M+L_tau_hat_CFE;
0072     Delta_omega_hat=2*pi*1/Para.T*epsilon_hat;
0073 
0074     r_corrected=r_CFO_corrected(Delta_tau_hat+1:end);
0075 else
0076     
0077     z = Demodulator( r, Para ); % FBMC demodulation
0078     xi=zeros(2*Para.Ns,1);
0079     for l_test=1:2*Para.Ns-2
0080         for index_N_R=1:Para.N_R
0081             z_0=squeeze(z(index_N_R,set_K,l_test)).';
0082             z_2=squeeze(z(index_N_R,set_K,l_test+2)).';
0083             xi(l_test)=xi(l_test)+2*(z_0'*z_2 )/sum (abs(z_0).^2+abs(z_2).^2);
0084         end
0085         xi(l_test)=abs(xi(l_test));
0086     end
0087     [~,l_hat]=max(xi);
0088 % %%
0089 %     N_s_prime=(2*Para.Ns+2*Para.kappa-1)/2;
0090 %     figure
0091 %     subplot(2,1,1)
0092 %     plot(real(r(index_N_R,1:2*(N_s_prime)*M)))
0093 %     xlim([1 2*(N_s_prime)*M])
0094 %     xlabel('Time index')
0095 %     ylabel('Received signal')
0096 %     subplot(2,1,2)
0097 %     plot(xi)
0098 %     xlabel('Time index')
0099 %     title('Auto-correlation of the training sequence')
0100 %     xlim([1 2*(Para.Ns)])
0101 % %%
0102     
0103     % Two-step CFO estimation & correction
0104     temp=0;
0105     for index_N_R=1:Para.N_R
0106         z_0=squeeze(z(index_N_R,set_K,l_hat)).';
0107         z_2=squeeze(z(index_N_R,set_K,l_hat+2)).';
0108        temp=temp+z_0'*z_2; 
0109     end
0110     epsilon_hat_coarse=1/2/pi*angle( temp );
0111     r_CFO_corrected=r;
0112     for index_N_R=1:Para.N_R
0113         r_CFO_corrected(index_N_R,:)=r(index_N_R,:).*exp(-1j*2*pi*epsilon_hat_coarse/Para.nSubcarriers*(0:nFrameSamples-1));
0114     end
0115     epsilon_hat=epsilon_hat_coarse;
0116     for l=1:2
0117         z = Demodulator( r_CFO_corrected, Para );
0118         temp=0;
0119         for index_N_R=1:Para.N_R
0120             z_0=squeeze(z(index_N_R,set_K,l_hat)).';
0121             z_2=squeeze(z(index_N_R,set_K,l_hat+2)).';
0122             temp=temp+z_0'*z_2;
0123         end
0124         epsilon_hat_fine=1/2/pi*angle( temp );
0125         epsilon_hat=epsilon_hat+epsilon_hat_fine;
0126         for index_N_R=1:Para.N_R
0127             r_CFO_corrected(index_N_R,:)=r(index_N_R,:).*exp(-1j*2*pi*epsilon_hat/Para.nSubcarriers*(0:nFrameSamples-1));
0128         end
0129     end
0130     z = Demodulator( r_CFO_corrected, Para );
0131     
0132     % STO estimation
0133     temp=0;
0134     for index_N_R=1:Para.N_R
0135         temp=temp+sum((z(index_N_R,set_K,l_hat).'.*conj(circshift(z(index_N_R,set_K,l_hat).',-1)  ))./d_TR(set_K)./circshift(d_TR(set_K),-1) )  ...
0136         +  sum((z(index_N_R,set_K,l_hat+2).'.*conj(circshift(z(index_N_R,set_K,l_hat+2).',-1)  ))./d_TR(set_K)./circshift(d_TR(set_K),-1)) ; % Factor -1 car on prend déjà le bon set, petit erreur car toutes les sous porteuses sont pas actives;
0137     end    
0138     tau_hat_CFE=1/4/pi*angle(temp);
0139     
0140     L_tau_hat_CFE=floor(tau_hat_CFE*2*M);
0141     Delta_tau_hat=(l_hat-1)*M+L_tau_hat_CFE;
0142     Delta_omega_hat=2*pi*1/Para.T*epsilon_hat;
0143     
0144     r_corrected=r_CFO_corrected(:,Delta_tau_hat+1:end);
0145     
0146 end
0147 
0148 
0149 end
0150

Generated on Mon 24-Jun-2019 13:51:48 by m2html © 2005