#サンプルコード
%% > octave-cli -q
%% octave> pkg install signal control communications -forge
pkg load communications
Q = 8;
M = 2^Qm;
%Nin = 16; % 16 point-FFT
Nin = M; % M point-FFT
Ngi = Nin/4;
Z = sqrt( mean( 2*(1:2:2^(Qm/2)).^2 ) );
repidx = @(i,N) mod( i-1, N)+1;
%% Dat Gen
txdat = qammod( mod( 1:Nin, M ), M )/Z;
%% Tx
txwave = ifft(txdat);
tx_idx = repidx(-Ngi+1:Nin,Nin); % with GI
txwavegi = txwave( tx_idx );
%% Channel
rxwavegi = txwavegi;
%% Rx
rx_idx0 = Ngi + repidx( 1:Nin/2 ,Nin);
rx_idx1 = Ngi + repidx( Nin/2+1:Nin ,Nin);
rxwave = rxwavegi([ rx_idx0 rx_idx1 ]);
%% Debug Print
rxdat = fft(rxwave);
plot( rxdat,'*')