OFDM Oversampled Signal Model
In this example, we will consider the OFDM oversampled signal model (Orthogonal frequency-division multiplexing, a digital modulation technology using a large number of closely spaced orthogonal subcarriers, or multiplexing). The model allows you to see a combination of several modulations. This example also uses an RMS unit that measures an OFDM-modulated signal with noise superimposed on it, scaled by a value proportional to the number of active subcarriers relative to the size of the FFT (Fast Fourier transform) to confirm that the signal power is approximately one.
The model is based on the following principle.
- A random integer data set and pilot input characters are generated.
- 16-QAM modulates data and pilot symbols.
- OFDM modulates the QAM-modulated signal. A pair of OFDM modulators and demodulators processes three symbols with different subcarrier indexes of the pilot signal and cyclic prefix lengths for each symbol. The OFDM signal contains data and pilots that the model generates at a frequency four times the sampling rate.
- Next, we apply amplitude distortion to each frame, which significantly changes the signal strength.
- After that, OFDM demodulates and outputs the data and pilots separately.
- 16-QAM demodulates data and pilot symbols.
- After that, we find the difference between the input and output.
The figure below shows the implemented model.
Next, initialize the model parameters.
M = 16; # Порядок модуляции
nfft = 64; # Длина FFT
NumSymbols=3; # Количество символов OFDM
osf=4; # Фактор передискретизации
ngbc = [9;8]; # Число носителей защитного диапазона
insertdcnull = true; # Наличие DC-нулевой поднесущей
addpilotport = true; # Присутствие пилота
Noise_power = 10; # Мощность шума
# Индексы пилотных поднесущих
pscindx = [[12;26;40;54] [14;28;38;52] [12;26;40;54]];
cplen = [16; 32; 16]; # CyclicPrefixLength
# Выборки на кадр для данных
spf_data = NumSymbols * (nfft-sum(ngbc)-size(pscindx,1)-insertdcnull)
# Выборки на кадр для пилота
spf_pilot = NumSymbols * size(pscindx,1)
# Число активных поднесущих
nasc = nfft-sum(ngbc)+insertdcnull;
After declaring the model parameters, initialize the model startup function and run the model itself.
# Подключение вспомогательной функции запуска модели.
function run_model( name_model)
Path = (@__DIR__) * "/" * name_model * ".engee"
if name_model in [m.name for m in engee.get_all_models()] # Проверка условия загрузки модели в ядро
model = engee.open( name_model ) # Открыть модель
model_output = engee.run( model, verbose=true ); # Запустить модель
else
model = engee.load( Path, force=true ) # Загрузить модель
model_output = engee.run( model, verbose=true ); # Запустить модель
engee.close( name_model, force=true ); # Закрыть модель
end
sleep(5)
return model_output
end
run_model("OFDM_Signal_and_QAM") # Запуск модели.
Now let's analyze the recorded dates.
ErrorData = collect(ErrorData);
ErrorPilot = collect(ErrorPilot);
RMSinp = collect(RMSinp);
RMSout = collect(RMSout);
ErrorData = ErrorData.value;
ErrorPilot = ErrorPilot.value;
RMSinp = RMSinp.value;
RMSout = RMSout.value;
plot([real(RMSinp),real(RMSout)], title="RMS", label=["До наложения шума" "После наложения шума"])
As we can see, the signal strength varies from frame to frame. Now let's look at the difference between the input and output data.
plot([ErrorData,ErrorPilot], title="Разница между входами и выходами", label=["Данные" "Пилоты"])
According to the graph, the error is zero, but to make sure of this, we will find the total error.
println("Суммарная разница между входными и выходными данными: " * string(sum(ErrorData)))
println("Суммарная разница между входными и выходными пилотами: " * string(sum(ErrorPilot)))
Conclusion
In this example, we have analyzed and demonstrated the possibilities of using several types of modulations in communication systems. This approach is very much in demand in this field of activity.