I'm trying to construct a basic OFDM simulation, and run into some problems when I trying to demodulate the signal to digit number.
the error is in last line 4 with min function.
%remove CP
Rsig=Rxsig(1,Ncp+1:end); sig=fft(Rsig,N); %singal=<1x128>,128 is the subcarrier number
%demodulation
for jj=1:N sig4=[sig(1,jj) sig(1,jj) sig(1,jj) sig(1,jj)]; [min, pos]=min(floor((abs(sig4-temp)*1000)')); % find the nearest signal
% temp=(1/sqrt(2))*[1+1j 1-1j -1+1j -1-1j];
end
or is there a better way to demodulate the signal ? Thank you for answering !!!
Best Answer