Simulates the impact of desynchronization. [ r_asynchr, Delta_omega, Delta_tau ] = Channel_Desynchronization( r, Para, Desynchronization_type ) The function works for SISO and MIMO, time-invariant and time-invariant systems. Input arguments: s: transmit signal. Size: matrix [N_R, nFrameSamples] Para: structure containing the modulation parameters. DesynchronizationType: optional, type of synchronization error. 'CFO' (carrier frequency offset), 'STO' (symbol timing offset) and 'CFO_STO' (both effects). Set by default to 'CFO_STO'. Outputs arguments: r_asynchr: received signal impacted by synchronization errors. Size: matrix [N_R, nFrameSamples + Delta_tau] Delta_omega: CFO [angular frequency] Delta_tau: STO [sampling period]
0001 function [ r_asynchr, Delta_omega, Delta_tau ] = Channel_Desynchronization( r, Para, DesynchronizationType ) 0002 % Simulates the impact of desynchronization. 0003 % 0004 % [ r_asynchr, Delta_omega, Delta_tau ] = Channel_Desynchronization( r, Para, Desynchronization_type ) 0005 % 0006 % The function works for SISO and MIMO, time-invariant and time-invariant 0007 % systems. 0008 % 0009 % Input arguments: 0010 % 0011 % s: transmit signal. Size: matrix [N_R, nFrameSamples] 0012 % 0013 % Para: structure containing the modulation parameters. 0014 % 0015 % DesynchronizationType: optional, type of synchronization error. 'CFO' 0016 % (carrier frequency offset), 'STO' (symbol timing offset) and 'CFO_STO' 0017 % (both effects). Set by default to 'CFO_STO'. 0018 % 0019 % Outputs arguments: 0020 % 0021 % r_asynchr: received signal impacted by synchronization errors. Size: 0022 % matrix [N_R, nFrameSamples + Delta_tau] 0023 % 0024 % Delta_omega: CFO [angular frequency] 0025 % 0026 % Delta_tau: STO [sampling period] 0027 % 0028 0029 0030 % This file is part of WaveComBox: www.wavecombox.com and is distributed under 0031 % the terms of the MIT license. See accompanying LICENSE file. 0032 % Original author: François Rottenberg, May 3, 2018. 0033 % Contributors: 0034 % Change log: 0035 0036 [N_R, nFrameSamples]=size(r); 0037 r_asynchr=zeros(N_R,nFrameSamples); 0038 0039 if exist('DesynchronizationType','var')==0 0040 DesynchronizationType='CFO_STO'; 0041 end 0042 0043 switch DesynchronizationType 0044 case 'CFO' 0045 % CFO 0046 epsilon=0.8*(rand-0.5); 0047 Delta_omega=2*pi*1/Para.T*epsilon; 0048 for index=1:N_R 0049 r_asynchr(index,:)=r(index,:).*exp(1j*Delta_omega*(0:nFrameSamples-1)*Para.T/Para.nSubcarriers); 0050 end 0051 Delta_tau=0; 0052 case 'STO' 0053 % STO 0054 Delta_tau=randi(Para.nSubcarriers*2); 0055 r_asynchr=[zeros(Para.N_R, Delta_tau) r]; 0056 Delta_omega=0; 0057 case 'CFO_STO' 0058 % CFO 0059 epsilon=0.8*(rand-0.5); 0060 Delta_omega=2*pi*1/Para.T*epsilon; 0061 for index=1:N_R 0062 r_asynchr(index,:)=r(index,:).*exp(1j*Delta_omega*(0:nFrameSamples-1)*Para.T/Para.nSubcarriers); 0063 end 0064 % STO 0065 Delta_tau=randi(Para.nSubcarriers*2); 0066 r_asynchr=[zeros(Para.N_R, Delta_tau) r_asynchr]; 0067 otherwise 0068 error('Desynchronization type not defined') 0069 end 0070 0071 end 0072