LTE PRACH Preamble Generation in MATLAB
조회 수: 12 (최근 30일)
이전 댓글 표시
Hello,
I'm trying to generate the preamble sent in the random access channel (PRACH) in LTE. I'm hoping somebody have some tips...
Using the LTE Toolbox is quite simple with ltePRACH(). However, I would like to generate my preamble without using this box.
One possible PRACH modulator in a 1.4MHz system is as follows:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150338/image.png)
- Generate Zadoff Chu Sequence according to 36.212 for the uth root with length NZC = 839.
- DFT with NZC points
- Subcarrier Mapping*
- IDFT with 1536 points. (12 times more than IDFT size for data as the subcarrier spacing is 1.25KHz instead of 15KHz).
- Repeat (Not need we are working with preamble format 0).
- CP Insertion
My main issue is with step 3, as I'm not sure how to map the unused subcarriers. Our sequence in frequency has 839 subcarriers occupied. As with normal uplink SC-FDMA transmission there is a half subcarrier (7500 Hz) shift, which for the PRACH is a K/2 subcarrier shift. A further subcarrier offset, φ (7 for formats 0–3 and 2 for format 4), centers the PRACH transmission within the 1.08 MHz bandwidth [1]. In this case, we have that we need to add zero padding:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150340/image.png)
Therefore, in total we have 864 subcarriers "used", or more precisely, 12 with zeros + 839 with the sequence and + 13. To reach to the the 1536, I'm just filling more zeros in the rest of subcarriers.
The problem is that lte ltePRACHDetect() detects different preambles to the one I have sent. The example code is here:
% code
% Cell Configuration
ueConfig=struct('NULRB',6,'DuplexMode','FDD','CyclicPrefix','Normal');
prachConfig=struct('Format',0,'SeqIdx',0,'PreambleIdx',0,'CyclicShiftIdx',1,'HighSpeed',0,'TimingOffset',0,'FreqIdx',0,'FreqOffset',0);
ue.NULRB = 6;
ue.DuplexMode = 'FDD';
% Sequence
N_ZC = 839;
sequence = lteZadoffChuSeq(129, 839);
% DFT -> Subcarrier Mapping -> IFFT
preambleDFT = fft(sequence, N_ZC);
preamble864subcarriers = [ zeros(13,1); preambleDFT; zeros(12,1)];
preambleMapped = [ zeros(336,1); preamble864subcarriers; zeros(336,1)]; % Only ' conjugate the complex numbers as well!!!
preambleIFFT = ifft(preambleMapped,1536);
% ADD CP and Guard Band
CPpreambleGP = [preambleIFFT(end-198+1:end); preambleIFFT; zeros(186,1)];
% MATLAB LTE Toolbox Generation
[matlabPreamble, info]=ltePRACH(ueConfig,prachConfig);
disp('--- MATLAB PREAMBLE ----');
[index,offset] = ltePRACHDetect(ue,prachConfig,matlabPreamble,(0:63).')
disp('--- OWN PREAMBLE ----');
[index,offset] = ltePRACHDetect(ue,prachConfig,CPpreambleGP,(0:63).')
Thanks a lot, Germán
댓글 수: 1
Fayaz
2023년 3월 20일
hello, can you give me code to generate the preamble sent in the random access channel (Narrowband PRACH) in LTE
답변 (1개)
fedi sonnara
2018년 5월 17일
change the line
preambleIFFT = ifft(preambleMapped,1536);
by
preambleIFFT = ifft(fftshift(preambleMapped),1536)/8.5;
The FFT in matlab is shifted i.e. the index 1 of the FFT vector corresponds to the middle of the spectrum. from 2 -> FFT size /2 corresponds to the right part of the spectrum from FFT size /2 +1 -> FFT size corresponds to the left part of the spectrum
read about shifting the FFT.
By changing this line, both sequences are matched and ltePRACHDetect() returns the same result for both of them.
댓글 수: 1
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!