I've read an interesting paper called FingerIO
that transmits audio waves in OFDM,
and I wanted to implement and generate sounds using MATLAB.
(I am quite new to signal processing, so please understand my lack of background knowledge!)
In OFDM, there are 64 subcarriers, each with their own frequency band and holding a symbol.
OFDM applies IFFT on the symbols and converts them into time domain with 64 time domain samples.
The 64 time domain samples are sent to the receiver.
The receiver then applies FFT on the received signal and recovers the 64 transmitted symbols.
Below is the snippet of my code to test the data.
I first created a 64X1 matrix that represents subcarriers in the frequency domain, put data in the subcarriers, and applied IFFT.
for i=1:64
X_Freq = zeros(1,64);
X_Freq(i) = 1;
x_Time = ifft(X_Freq);
end
My anticipation was that the frequency of the signal will increase with the value of i since higher subcarriers have higher frequencies.
However, when I ran the code, the frequency increased with the i during the first half (when i=64/2) of the subcarriers, but it began to decrease after the half point.
So I thought, since an FFT returns a symmetric positive and negative frequencies data, I've added the code below before the IFFT operation to create the positive frequency data.
for i=1:64
X_Freq = zeros(1,64);
X_Freq(i) = 1;
X_Freq = [X_Freq X_Freq(end:-1:1)];
x_Time = ifft(X_Freq);
end
After revision, the frequency now increases with the value of i, but the problem is that the output of the IFFT is now 128 samples.
Does anyone know how I can use 64 samples and use up to 64 subcarriers?
I would appreciate any comments/advises!
Thanks in advance!