1. Software version
matlab2021a
2. Theoretical knowledge of this algorithm
Digital TV terrestrial broadcast transmission has always been a research hotspot in all walks of life, and the use of OFDM multi-carrier modulation can effectively combat the multipath effect in terrestrial transmission. This subject mainly requires students to master the realization principle of OFDM modulation in digital TV terrestrial broadcasting transmission system, and can focus on the frequency domain synchronization technology in OFDM system.
Below we combine this structure with our MATLAB for a comprehensive analysis and description.
The corresponding MATLAB code for these modules is:
func_demod : In this function, the following code is the initial preparation before demodulation, such as adding frequency offset, adding signal-to-noise ratio, interpolation, etc.
………………………….. …………………………..
………………………………………………………..
Then start to detect the training sequence data information added in OFDM:
………………………….. …………………………..
………………………………………………………..
The rationale for this code is as follows:
By calculating the correlation value of the training sequence, the corresponding correlation peak is obtained, and the specific position of the training sequence is determined by searching for the vertex position of the correlation peak.
Match the position of the maximum value of the output by recording the pseudocode. Here, the output of the pseudocode matching is realized by a windowing algorithm.
Schematic diagram of matching position
As shown in the figure, we use the windowing method to search for the correlation peak, that is, set a threshold according to the signal power, compare the result of the PN code matching with the threshold, and record the value in the register when the value is greater than the threshold. , and then continue to record the next N values, and then compare successively to get the maximum value,
The corresponding code for this function is:
These are the processes of timing synchronization
This is to change the appropriate window position for the FFT through timing synchronization.
The corresponding MATLAB code for these modules is:
extract pilot;
Through this loop tracking, timing errors and frequency offset errors are readjusted.
3. Core code
%本系统重点研究的是基于OFDM的频率偏移的频域估计的算法仿真,
%由于OFDM系统比较复杂,本系统采用的已知的发送信号,然后对系统进行设计与实现
clc;
clear;
close all;
i=1;
for SNRs = 12:2:24; %设置信噪比
func_parameter(SNRs); %参数初始化
[FFTout,error_rate] = func_demod(); %解调
fileName = ['FOUT\FFTOUT_' num2str(i) '.mat'];
save(fileName,'FFTout')
pause(1);
disp('误码率为:');
error_rate
error(i) = error_rate;
i=i+1;
close all;
end
figure
plot(12:2:24,error,'r-*');
title('OFDM频域同步的误码率曲线效果图');
xlabel('SNR');
ylabel('ERR');
grid on
figure
Number_fft = 128;
load FOUT\FFTOUT_1.mat
subplot(421);
hold on;
for (i=3:45)
for(k=1:2*Number_fft)
plot(real(FFTout(i,k)),imag(FFTout(i,k)),'.k');
end;
end;
grid on;
hold off;
title('OFDM符号的星座图');
load FOUT\FFTOUT_2.mat
subplot(422);
hold on;
for (i=3:45)
for(k=1:2*Number_fft)
plot(real(FFTout(i,k)),imag(FFTout(i,k)),'.k');
end;
end;
grid on;
hold off;
title('OFDM符号的星座图');
load FOUT\FFTOUT_3.mat
subplot(423);
hold on;
for (i=3:45)
for(k=1:2*Number_fft)
plot(real(FFTout(i,k)),imag(FFTout(i,k)),'.k');
end;
end;
grid on;
hold off;
title('OFDM符号的星座图');
load FOUT\FFTOUT_4.mat
subplot(424);
hold on;
for (i=3:45)
for(k=1:2*Number_fft)
plot(real(FFTout(i,k)),imag(FFTout(i,k)),'.k');
end;
end;
grid on;
hold off;
title('OFDM符号的星座图');
load FOUT\FFTOUT_5.mat
subplot(425);
hold on;
for (i=3:45)
for(k=1:2*Number_fft)
plot(real(FFTout(i,k)),imag(FFTout(i,k)),'.k');
end;
end;
grid on;
hold off;
title('OFDM符号的星座图');
load FOUT\FFTOUT_6.mat
subplot(426);
hold on;
for (i=3:45)
for(k=1:2*Number_fft)
plot(real(FFTout(i,k)),imag(FFTout(i,k)),'.k');
end;
end;
grid on;
hold off;
title('OFDM符号的星座图');
load FOUT\FFTOUT_7.mat
subplot(427);
hold on;
for (i=3:45)
for(k=1:2*Number_fft)
plot(real(FFTout(i,k)),imag(FFTout(i,k)),'.k');
end;
end;
grid on;
hold off;
title('OFDM符号的星座图');
4. Operation steps and simulation conclusion
5. References
[1] Li Shiju. Digital Wireless Transmission. Second Edition. Beijing: Tsinghua University Press, 2007
[2] Wang Yumin. OFDM key technology and application. Beijing: Machinery Industry Press, 2007
[3] Peng Mugen. Next Generation Broadband Wireless Communication System: OFDM and WiMAX. Beijing: Machinery Industry Press, 2007
[4] Yu Zhaoming, Yu Zhi. Digital TV transmission and networking [M]. Beijing: People's Posts and Telecommunications Press, 2003
[5] Lu Guanming Zongfang. Principles of Digital Television (Second Edition) [M]. Beijing: Machinery Industry Press, 2009
[6] Ge Philosophy. Proficient in MATLAB [M]. Beijing: Electronic Industry Press, 2008
A01-31
6. How to obtain the complete source code
Method 1: Contact the blogger via WeChat or QQ
Method 2: Subscribe to the MATLAB/FPGA tutorial, get the tutorial case and any 2 complete source code for free