Bonjour tout le monde,
je cherche à développer un bout de code matlab pour générer un symbole ofdm en utilisant la symétrie hermitienne. Je veux un symbole OFDM sur 512 sous-porteuses avec une IFFT de 256 points. J'ai un bout de code sans la symétrie hermitienne qui fonctionne :
J'ai essayé ce bout de code pour la symétrie hermitienne, mais je n'arrive pas à retrouver les symboles de constellation de départ. Pouvez-vous svp m'aider à trouver ce qui cloche? Je vous remercie par avance.Code:clear all; close all; clc; Fe = 40e6; % = Bandwidth BW numberSubcarrier = 512; NHS_FFTlength = numberSubcarrier; NumberOFDMsymbol= 1; delta_f = Fe / numberSubcarrier; T = 1 / delta_f; NHSk_vec = 0 : numberSubcarrier - 1; NHSn_vec = 0 : NHS_FFTlength - 1; symbMappRe = sign(randn(1, numberSubcarrier)); symbMappIm = sign(randn(1, numberSubcarrier)); NHSsymbMapp = complex(symbMappRe, symbMappIm); %% IFFT for n = 0 : NHS_FFTlength - 1 NHSsymbOFDM(n + 1) = (1/ NHS_FFTlength) * sum(NHSsymbMapp .* exp(1j * 2 * pi * NHSk_vec * n ./ NHS_FFTlength)); end %% IFFT + CP % for n = 0 : NHS_FFTlength - 1 % NHSsymbOFDM(n + 1) = (1/ NHS_FFTlength) * sum(NHSsymbMapp .* exp(1j * 2 * pi * NHSk_vec * n ./ NHS_FFTlength)); % end %% FFT for k = 0 : numberSubcarrier - 1 NHSsymbOFDM_inv(k + 1) = sum(NHSsymbOFDM .* exp(-1j * 2 * pi * k * NHSn_vec ./ NHS_FFTlength)); end %% figures figure; plot(real(NHSsymbMapp)); hold on; grid on; plot(real(NHSsymbOFDM_inv), '--r'); title('real part of the mapped symbols (NHS)'); legend('mapped symbols', 'symbols after IFFT-FFT') figure; plot(imag(NHSsymbMapp)); hold on; grid on; plot(imag(NHSsymbOFDM_inv), '--r'); title('imaginary part of the mapped symbols (NHS)'); legend('mapped symbols', 'symbols after IFFT-FFT')
Code:clear all; close all; clc; Fe = 40e6; % = Bandwidth BW numberSubcarrier = 512; NHS_FFTlength = numberSubcarrier / 2; NumberOFDMsymbol= 1; delta_f = Fe / numberSubcarrier; T = 1 / delta_f; NHSk_vec = 0 : numberSubcarrier - 1; NHSn_vec = 0 : NHS_FFTlength - 1; symbMappRe = sign(randn(1, numberSubcarrier/2)); symbMappIm = sign(randn(1, numberSubcarrier/2)); NHSsymbMapp = complex(symbMappRe, symbMappIm); %% IFFT for n = 0 : NHS_FFTlength - 1 NHSsymbOFDM(n + 1) = (1/ NHS_FFTlength) * sum(NHSsymbMapp .* exp(1j * 2 * pi * NHSk_vec(1 : length(NHSk_vec)/2) * n ./ NHS_FFTlength)) + ... (1/ NHS_FFTlength) * sum(conj(NHSsymbMapp) .* exp(1j * 2 * pi * NHSk_vec(length(NHSk_vec)/2 + 1 : length(NHSk_vec)) * n ./ NHS_FFTlength)); end %% IFFT + CP % for n = 0 : NHS_FFTlength - 1 % NHSsymbOFDM(n + 1) = (1/ NHS_FFTlength) * sum(NHSsymbMapp .* exp(1j * 2 * pi * NHSk_vec * n ./ NHS_FFTlength)); % end %% FFT for k = 0 : numberSubcarrier / 2 NHSsymbOFDM_inv(k + 1) = sum(NHSsymbOFDM .* exp(-1j * 2 * pi * k * NHSn_vec ./ NHS_FFTlength)) + ... sum(conj(NHSsymbOFDM) .* exp(-1j * 2 * pi * (k + numberSubcarrier / 2) * NHSn_vec ./ NHS_FFTlength)); end %% figures figure; plot(real(NHSsymbMapp)); hold on; grid on; plot(real(NHSsymbOFDM_inv), '--r'); title('real part of the mapped symbols (NHS)'); legend('mapped symbols', 'symbols after IFFT-FFT') figure; plot(imag(NHSsymbMapp)); hold on; grid on; plot(imag(NHSsymbOFDM_inv), '--r'); title('imaginary part of the mapped symbols (NHS)'); legend('mapped symbols', 'symbols after IFFT-FFT')
-----