SeokhyunJeong / CsiNet-Pytorch

Pytorch reproduction of CsiNet
17 stars 0 forks source link

Ask questions about datasets. #3

Open zhangwb227 opened 9 months ago

zhangwb227 commented 9 months ago

I'm sorry to bother you, but I also recently enjoyed the research on CSI feedback overhead in massive MIMO systems, and I'm glad to find your contribution here. However, I have encountered difficulties in using QuaDRiGa for dataset generation, I would appreciate it if you could share your dataset generation source code with me. Please contact me at zhangwb227@126.com. Thank you very much!

SeokhyunJeong commented 9 months ago

Thank you for your feedback. I used the attached code for the channel generator. Please put this code in Quadriga folder and run it.

If you have any questions feel free to ask me. Thank you very much!

2024년 2월 4일 (일) 오후 9:44, zhangwb227 @.***>님이 작성:

I'm sorry to bother you, but I also recently enjoyed the research on CSI feedback overhead in massive MIMO systems, and I'm glad to find your contribution here. However, I have encountered difficulties in using QuaDRiGa for dataset generation, I would appreciate it if you could share your dataset generation source code with me. Please contact me at @.*** Thank you very much!

— Reply to this email directly, view it on GitHub https://github.com/SeokhyunJeong/CsiNet-Pytorch/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJK5NF3WYJAEC2ZYRWFCRNDYR57BRAVCNFSM6AAAAABCY2WWQGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYTOMBYGAZTAMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

clear all; clc;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Note: Output h is a N_UE by N_BS by N_sc by N_time matrix

%% Control variables %% % Carrier frequency and bandwidth fc = 28e9; % in Hz BW = 1e8; % in Hz OFDM_size=1024;

N_ver=32; % Number of antenna in vertical array N_hor=1; % Number of antenna in Horizontal array Downtilt_angle=10; % in degree

% UE mobility (UE is moving linearly to a random direction) UE_velocity_kmh=6; % in km/h Channel_aging_period=10^-3; % in s

% Get channel h=mmWave_OFDM_TVchannel_generation(fc,BW,OFDM_size,N_ver,N_hor,Downtilt_angle,UE_velocity_kmh,Channel_aging_period);

% Channel fluctuation example UE_antenna_idx=1; BS_antenna_idx=1; for idx=1:size(h,4) channel_magnitude(idx)=norm(squeeze(h(UE_antenna_idx,BS_antenna_idx,:,idx))); end plot(channel_magnitude);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Inputs: % fc: carrier frequency in Hz % BW: bandwidth in Hz % OFDM_size: FFD size % N_ver: Number of antenna in vertical array % N_hor: Number of antenna in Horizontal array % Downtilt_angle: Antenna downtilt angle in degree % UE_velocity_kmh: UE speed in km/h % Channel_aging_period: Time varing channel aging in s

% Output: % 4-D channel matrix (UE antenna, BS_antenna, subcarrier, channel_idx) % h: N_UE N_BS OFDM_size * 200

function h=mmWave_OFDM_TVchannel_generation(fc,BW,OFDM_size,N_ver,N_hor,Downtilt_angle,UE_velocity_kmh,Channel_aging_period)

%% Simulation parameters setting Par = qd_simulation_parameters; Par.center_frequency = fc; Par.sample_density = 2; Par.use_3GPP_baseline=1;

%% Simulation track setting Track = qd_track('linear',199UE_velocity_kmh/3.6Channel_aging_period,unifrnd(-pi,pi)); Track.initial_position = [unifrnd(50,100);unifrnd(50,100);1.7]; Track.scenario = '3GPP_38.901_UMa_NLOS'; Track.interpolate_positions( Par.samples_per_meter);

%% Simulation layout Layout = qd_layout( Par ); Layout.tx_array = qd_arrayant('3gpp-mmw',N_ver,N_hor,fc,1,Downtilt_angle,0.5,1,1,[],[]); Layout.rx_array = qd_arrayant('dipole'); Layout.tx_position(3) = 25; Layout.rx_track = Track;

%% Get channel cn = Layout.get_channels; Track.set_speed( UE_velocity_kmh/3.6 ); dist = Track.interpolate_movement(Channel_aging_period ); ci = cn.interpolate( dist ); h = ci.fr(BW, OFDM_size); size(h) end

FardadAnsari commented 6 months ago

Thanks for the code, may i ask you something about the data you employed for CSInet_pytorch repository, it is indoor or outdoor and which frequesncy 300MHz or 5.3GHz ? Warm Regards

zhangwb227 commented 6 months ago

indoor<---->5.3GHz

outdoor<---->300MHz

The details can be found at the bottom left of page 3 of this article.

"Deep Learning for Massive Mimo Csi Feedback,https://arxiv.org/pdf/1712.08919 "

At 2024-05-21 02:46:16, "Fardad" @.***> wrote:

Thanks for the code, may i ask you something about the data you employed for CSInet_pytorch repository, it is indoor or outdoor and which frequesncy 300MHz or 5.3GHz ? Warm Regards

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

FardadAnsari commented 6 months ago

Thanks for the replay , since we had generated data as csv file in @SeokhyunJeong seokhyunjeong repositories

SeokhyunJeong commented 6 months ago

Thanks for the code, may i ask you something about the data you employed for CSInet_pytorch repository, it is indoor or outdoor and which frequesncy 300MHz or 5.3GHz ? Warm Regards

Thank you for your comment. In the original CsiNet paper, data include outdoor 300MHz and indoor 5.3GHz. In our dataset, for the validation in mmWave frequency band, we employed 28GHz outdoor: 3GPP_38.901_UMa_NLOS.

SecretGuy commented 4 months ago

Thanks a lot for you sharing the code of generating CSI, but i meet a question when i runned the code. I copied the code and runned it, the result doesn't like the data_large or the data_online dataset shareing in your google driver. The result runned the code show only 200 column datas, but the data_large or the data_online includes 2048 column in one row. So, May i ask you some questions ? 1.How should I adjust the code to generate the dataset like the data_large or the data_online, and save it? 2.In fact, I need to generate more than 32 antennas dataset, like 48, 64 and more. Should I change the parameter N_ver to 48, 64? I feel so sorry to bother you. Best wishes !!!

SeokhyunJeong commented 3 months ago

Thanks a lot for you sharing the code of generating CSI, but i meet a question when i runned the code. I copied the code and runned it, the result doesn't like the data_large or the data_online dataset shareing in your google driver. The result runned the code show only 200 column datas, but the data_large or the data_online includes 2048 column in one row. So, May i ask you some questions ? 1.How should I adjust the code to generate the dataset like the data_large or the data_online, and save it? 2.In fact, I need to generate more than 32 antennas dataset, like 48, 64 and more. Should I change the parameter N_ver to 48, 64? I feel so sorry to bother you. Best wishes !!!

Thank you for your comment. You can adjust N_ver or N_hor to generate the channel dataset with more than 32 antennas. Then, you can modify N_t in model.py file.

SecretGuy commented 3 months ago

Thanks a lot for you sharing the code of generating CSI, but i meet a question when i runned the code. I copied the code and runned it, the result doesn't like the data_large or the data_online dataset shareing in your google driver. The result runned the code show only 200 column datas, but the data_large or the data_online includes 2048 column in one row. So, May i ask you some questions ? 1.How should I adjust the code to generate the dataset like the data_large or the data_online, and save it? 2.In fact, I need to generate more than 32 antennas dataset, like 48, 64 and more. Should I change the parameter N_ver to 48, 64? I feel so sorry to bother you. Best wishes !!!

Thank you for your comment. You can adjust N_ver or N_hor to generate the channel dataset with more than 32 antennas. Then, you can modify N_t in model.py file.

Thanks for your reply. I ran the code you provided once and performed a 2D discrete Fourier transform and truncation on the generated data, but the data visualisation I generated myself is not the same as the data_large data visualisation you provided, as shown in the figure below: 1.data_large's data visualisation(you provided) image 2.my dataset's data visualisation(runned the code by myself) image I would like to ask what should be done to the generated data to generate a dataset with a similar distribution as the data_large dataset? Thanks a lot! Best wishes!

SeokhyunJeong commented 3 months ago

Thanks a lot for you sharing the code of generating CSI, but i meet a question when i runned the code. I copied the code and runned it, the result doesn't like the data_large or the data_online dataset shareing in your google driver. The result runned the code show only 200 column datas, but the data_large or the data_online includes 2048 column in one row. So, May i ask you some questions ? 1.How should I adjust the code to generate the dataset like the data_large or the data_online, and save it? 2.In fact, I need to generate more than 32 antennas dataset, like 48, 64 and more. Should I change the parameter N_ver to 48, 64? I feel so sorry to bother you. Best wishes !!!

Thank you for your comment. You can adjust N_ver or N_hor to generate the channel dataset with more than 32 antennas. Then, you can modify N_t in model.py file.

Thanks for your reply. I ran the code you provided once and performed a 2D discrete Fourier transform and truncation on the generated data, but the data visualisation I generated myself is not the same as the data_large data visualisation you provided, as shown in the figure below: 1.data_large's data visualisation(you provided) image 2.my dataset's data visualisation(runned the code by myself) image I would like to ask what should be done to the generated data to generate a dataset with a similar distribution as the data_large dataset? Thanks a lot! Best wishes!

The sparsity can be depend on the simulation environment. However, I think your data is too much not sparse. I re-ran the MATLAB code and obtained the following channel (row: subcarrier dimension, column: antenna dimension):

mld

Please ensure that you change all dimensions of the channel from 32 to 48. For example, if you generated the channel with 48 subcarriers, after 2D FFT, it should reshape to (48, # of subcarriers) instead of (32, # of subcarriers). If you don't mind, could you please show me the code you used to convert channel data into a sparse matrix?

If you have any questions, feel free to leave a comment here.

Thank you!

SecretGuy commented 3 months ago

Thanks a lot for you sharing the code of generating CSI, but i meet a question when i runned the code. I copied the code and runned it, the result doesn't like the data_large or the data_online dataset shareing in your google driver. The result runned the code show only 200 column datas, but the data_large or the data_online includes 2048 column in one row. So, May i ask you some questions ? 1.How should I adjust the code to generate the dataset like the data_large or the data_online, and save it? 2.In fact, I need to generate more than 32 antennas dataset, like 48, 64 and more. Should I change the parameter N_ver to 48, 64? I feel so sorry to bother you. Best wishes !!!

Thank you for your comment. You can adjust N_ver or N_hor to generate the channel dataset with more than 32 antennas. Then, you can modify N_t in model.py file.

Thanks for your reply. I ran the code you provided once and performed a 2D discrete Fourier transform and truncation on the generated data, but the data visualisation I generated myself is not the same as the data_large data visualisation you provided, as shown in the figure below: 1.data_large's data visualisation(you provided) image 2.my dataset's data visualisation(runned the code by myself) image I would like to ask what should be done to the generated data to generate a dataset with a similar distribution as the data_large dataset? Thanks a lot! Best wishes!

The sparsity can be depend on the simulation environment. However, I think your data is too much not sparse. I re-ran the MATLAB code and obtained the following channel (row: subcarrier dimension, column: antenna dimension):

mld

Please ensure that you change all dimensions of the channel from 32 to 48. For example, if you generated the channel with 48 subcarriers, after 2D FFT, it should reshape to (48, # of subcarriers) instead of (32, # of subcarriers). If you don't mind, could you please show me the code you used to convert channel data into a sparse matrix?

If you have any questions, feel free to leave a comment here.

Thank you!

Thanks for your reply. The code I wrote to convert the channel data to a sparse matrix may have some issues. I directly performed 2D-FFT, truncation and re-stitching of the real and virtual parts of the generated data.

Here's the code I worked on

` clear all; clc;

% Output h is a N_UE by N_BS by N_sc by N_time matrix % % Carrier Frequency and BandWidth fc = 28e9; BW = 1e8; OFDM_size = 1024;

N_ver = 32; % Number of antenna in vertical array
N_hor = 1; % Number of antenna in Horizontal array
Downtilt_angle = 10; % in degree

% UE Mobility (UE is moving linearly to a random direction) UE_Velocity_Kmh = 6; % in km/h Channel_aging_period = 10^-3; % in s

% Get channel
h = mmWave_OFDM_TVchannel_generation(fc,BW,OFDM_size,N_ver,N_hor,Downtilt_angle,UE_Velocity_Kmh,Channel_aging_period);

% Channel data process HT = []; UE_antenna_idx = 1; for idx_channel=1:200 a = h(UE_antenna_idx,:,:,idx_channel); % get a channel data a = fft2(a); % 2D-FFT of the channel data a = squeeze(a); % reshape 1×32×1024 to 32×1024 HT_a = a(:,1:32); % Capture the first 32 columns ra = real(HT_a); % get the real value part ia = imag(HT_a); % get the imaginary value part ra_col = ra' ia_col = ia'; HT_real = reshape(ra_col, 1, []); % reshape 32×32 to 1×1024 HT_imag = reshape(ia_col, 1, []); for i=1:1024 % Stitch the real and imaginary data into a single row HT(idx_channel,i) = HT_real(1,i); HT(idx_channel,i+1024) = HT_imag(1,i); end end save('dataset_32_32','HT'); % This is the final dataset generated. disp('done!'); % plot(channel_magnitude);

% Inputs: % fc : carrier frequency in Hz % OFDM_size : FDD size % N_ver : Number of antenna in vertical array % N_hor : Number of antenna in Horizontal array % Downtilt_angle : Antenna downtilt angle in degree % UE_velocity_kmh : UE speed in km/h % Channel_aging_period : Time varing channel aging in s

% Output: % 4-D channel matrix( UE_antenna, BS_antenna, subcarrier, channel_idx ) % h : N_UE N_BS OFDM_size * 200

function h = mmWave_OFDM_TVchannel_generation(fc,BW,OFDM_size,N_ver,N_hor,Downtilt_angle,UE_velocity_kmh,Channel_aging_period);

% Simulation parameters setting Par = qd_simulation_parameters; Par.center_frequency = fc; Par.sample_density = 2; Par.use_3GPP_baseline = 1;

% Simulation track setting Track = qd_track('linear',199UE_velocity_kmh/3.6Channel_aging_period,unifrnd(-pi, pi)); Track.initial_position = [unifrnd(50,100);unifrnd(50,100);1.7]; Track.scenario = '3GPP_38.901_UMa_NLOS'; Track.interpolate_positions(Par.samples_per_meter);

% Simulation layout Layout = qd_layout(Par); Layout.tx_array = qd_arrayant('3gpp-mmw',N_ver,N_hor,fc,1,Downtilt_angle,0.5,1,1,[],[]); Layout.rx_array = qd_arrayant('dipole'); Layout.tx_position(3) = 25; Layout.rx_track = Track;

% Get Channel cn = Layout.get_channels; Track.set_speed(UE_velocity_kmh/3.6); dist = Track.interpolate_movement(Channel_aging_period); ci = cn.interpolate(dist); h = ci.fr(BW, OFDM_size); size(h) end `

I don't know whether you handle the generated channel data like this, but I really want to address this question. I would appreciate it if you could share your channel data processed code with me. Thank you again!

Best wishes.

SeokhyunJeong commented 3 months ago

Thanks a lot for you sharing the code of generating CSI, but i meet a question when i runned the code. I copied the code and runned it, the result doesn't like the data_large or the data_online dataset shareing in your google driver. The result runned the code show only 200 column datas, but the data_large or the data_online includes 2048 column in one row. So, May i ask you some questions ? 1.How should I adjust the code to generate the dataset like the data_large or the data_online, and save it? 2.In fact, I need to generate more than 32 antennas dataset, like 48, 64 and more. Should I change the parameter N_ver to 48, 64? I feel so sorry to bother you. Best wishes !!!

Thank you for your comment. You can adjust N_ver or N_hor to generate the channel dataset with more than 32 antennas. Then, you can modify N_t in model.py file.

Thanks for your reply. I ran the code you provided once and performed a 2D discrete Fourier transform and truncation on the generated data, but the data visualisation I generated myself is not the same as the data_large data visualisation you provided, as shown in the figure below: 1.data_large's data visualisation(you provided) image 2.my dataset's data visualisation(runned the code by myself) image I would like to ask what should be done to the generated data to generate a dataset with a similar distribution as the data_large dataset? Thanks a lot! Best wishes!

The sparsity can be depend on the simulation environment. However, I think your data is too much not sparse. I re-ran the MATLAB code and obtained the following channel (row: subcarrier dimension, column: antenna dimension): mld Please ensure that you change all dimensions of the channel from 32 to 48. For example, if you generated the channel with 48 subcarriers, after 2D FFT, it should reshape to (48, # of subcarriers) instead of (32, # of subcarriers). If you don't mind, could you please show me the code you used to convert channel data into a sparse matrix? If you have any questions, feel free to leave a comment here. Thank you!

Thanks for your reply. The code I wrote to convert the channel data to a sparse matrix may have some issues. I directly performed 2D-FFT, truncation and re-stitching of the real and virtual parts of the generated data.

Here's the code I worked on

` clear all; clc;

% Output h is a N_UE by N_BS by N_sc by N_time matrix % % Carrier Frequency and BandWidth fc = 28e9; BW = 1e8; OFDM_size = 1024;

N_ver = 32; % Number of antenna in vertical array N_hor = 1; % Number of antenna in Horizontal array Downtilt_angle = 10; % in degree

% UE Mobility (UE is moving linearly to a random direction) UE_Velocity_Kmh = 6; % in km/h Channel_aging_period = 10^-3; % in s

% Get channel h = mmWave_OFDM_TVchannel_generation(fc,BW,OFDM_size,N_ver,N_hor,Downtilt_angle,UE_Velocity_Kmh,Channel_aging_period);

% Channel data process HT = []; UE_antenna_idx = 1; for idx_channel=1:200 a = h(UE_antenna_idx,:,:,idx_channel); % get a channel data a = fft2(a); % 2D-FFT of the channel data a = squeeze(a); % reshape 1×32×1024 to 32×1024 HT_a = a(:,1:32); % Capture the first 32 columns ra = real(HT_a); % get the real value part ia = imag(HT_a); % get the imaginary value part ra_col = ra' ia_col = ia'; HT_real = reshape(ra_col, 1, []); % reshape 32×32 to 1×1024 HT_imag = reshape(ia_col, 1, []); for i=1:1024 % Stitch the real and imaginary data into a single row HT(idx_channel,i) = HT_real(1,i); HT(idx_channel,i+1024) = HT_imag(1,i); end end save('dataset_32_32','HT'); % This is the final dataset generated. disp('done!'); % plot(channel_magnitude);

% Inputs: % fc : carrier frequency in Hz % OFDM_size : FDD size % N_ver : Number of antenna in vertical array % N_hor : Number of antenna in Horizontal array % Downtilt_angle : Antenna downtilt angle in degree % UE_velocity_kmh : UE speed in km/h % Channel_aging_period : Time varing channel aging in s

% Output: % 4-D channel matrix( UE_antenna, BS_antenna, subcarrier, channel_idx ) % h : N_UE N_BS OFDM_size * 200

function h = mmWave_OFDM_TVchannel_generation(fc,BW,OFDM_size,N_ver,N_hor,Downtilt_angle,UE_velocity_kmh,Channel_aging_period);

% Simulation parameters setting Par = qd_simulation_parameters; Par.center_frequency = fc; Par.sample_density = 2; Par.use_3GPP_baseline = 1;

% Simulation track setting Track = qd_track('linear',199_UE_velocity_kmh/3.6_Channel_aging_period,unifrnd(-pi, pi)); Track.initial_position = [unifrnd(50,100);unifrnd(50,100);1.7]; Track.scenario = '3GPP_38.901_UMa_NLOS'; Track.interpolate_positions(Par.samples_per_meter);

% Simulation layout Layout = qd_layout(Par); Layout.tx_array = qd_arrayant('3gpp-mmw',N_ver,N_hor,fc,1,Downtilt_angle,0.5,1,1,[],[]); Layout.rx_array = qd_arrayant('dipole'); Layout.tx_position(3) = 25; Layout.rx_track = Track;

% Get Channel cn = Layout.get_channels; Track.set_speed(UE_velocity_kmh/3.6); dist = Track.interpolate_movement(Channel_aging_period); ci = cn.interpolate(dist); h = ci.fr(BW, OFDM_size); size(h) end `

I don't know whether you handle the generated channel data like this, but I really want to address this question. I would appreciate it if you could share your channel data processed code with me. Thank you again!

Best wishes.

Thank you for your response. Your code for channel generation is excellent, but I found a minor issue that need fixing.

In your Matlab code, (1) a = h(UE_antenna_idx,:,:,idx_channel); % get a channel data (2) a = fft2(a); % 2D-FFT of the channel data (3) a = squeeze(a); % reshape 1×32×1024 to 32×1024 (4) HT_a = a(:,1:32); % Capture the first 32 columns

variable a generated by the line (1) has a shape of (1, 32, 1024). fft2 function performs a Fourier transform along the first two dimensions (in this case, 1 and 32). This means that the Fourier transform is not applied along the subcarrier dimension (1024). To address this, you can simply swap lines (2) and (3) to reshape a to (32, 1024) first, allowing the fft2 function to operate along the correct dimensions. Also, you can capture last 32 columns in line (4) HT_z = a(:, 1024-31:1024) to get effective elements.

If you have any questions feel free to ask me. Thank you very much!

SecretGuy commented 3 months ago

Thanks a lot for you sharing the code of generating CSI, but i meet a question when i runned the code. I copied the code and runned it, the result doesn't like the data_large or the data_online dataset shareing in your google driver. The result runned the code show only 200 column datas, but the data_large or the data_online includes 2048 column in one row. So, May i ask you some questions ? 1.How should I adjust the code to generate the dataset like the data_large or the data_online, and save it? 2.In fact, I need to generate more than 32 antennas dataset, like 48, 64 and more. Should I change the parameter N_ver to 48, 64? I feel so sorry to bother you. Best wishes !!!

Thank you for your comment. You can adjust N_ver or N_hor to generate the channel dataset with more than 32 antennas. Then, you can modify N_t in model.py file.

Thanks for your reply. I ran the code you provided once and performed a 2D discrete Fourier transform and truncation on the generated data, but the data visualisation I generated myself is not the same as the data_large data visualisation you provided, as shown in the figure below: 1.data_large's data visualisation(you provided) image 2.my dataset's data visualisation(runned the code by myself) image I would like to ask what should be done to the generated data to generate a dataset with a similar distribution as the data_large dataset? Thanks a lot! Best wishes!

The sparsity can be depend on the simulation environment. However, I think your data is too much not sparse. I re-ran the MATLAB code and obtained the following channel (row: subcarrier dimension, column: antenna dimension): mld Please ensure that you change all dimensions of the channel from 32 to 48. For example, if you generated the channel with 48 subcarriers, after 2D FFT, it should reshape to (48, # of subcarriers) instead of (32, # of subcarriers). If you don't mind, could you please show me the code you used to convert channel data into a sparse matrix? If you have any questions, feel free to leave a comment here. Thank you!

Thanks for your reply. The code I wrote to convert the channel data to a sparse matrix may have some issues. I directly performed 2D-FFT, truncation and re-stitching of the real and virtual parts of the generated data. Here's the code I worked on clear all; clc; % Output h is a N_UE by N_BS by N_sc by N_time matrix % % Carrier Frequency and BandWidth fc = 28e9; BW = 1e8; OFDM_size = 1024; N_ver = 32; % Number of antenna in vertical array N_hor = 1; % Number of antenna in Horizontal array Downtilt_angle = 10; % in degree % UE Mobility (UE is moving linearly to a random direction) UE_Velocity_Kmh = 6; % in km/h Channel_aging_period = 10^-3; % in s % Get channel h = mmWave_OFDM_TVchannel_generation(fc,BW,OFDM_size,N_ver,N_hor,Downtilt_angle,UE_Velocity_Kmh,Channel_aging_period); % Channel data process HT = []; UE_antenna_idx = 1; for idx_channel=1:200 a = h(UE_antenna_idx,:,:,idx_channel); % get a channel data a = fft2(a); % 2D-FFT of the channel data a = squeeze(a); % reshape 1×32×1024 to 32×1024 HT_a = a(:,1:32); % Capture the first 32 columns ra = real(HT_a); % get the real value part ia = imag(HT_a); % get the imaginary value part ra_col = ra' ia_col = ia'; HT_real = reshape(ra_col, 1, []); % reshape 32×32 to 1×1024 HT_imag = reshape(ia_col, 1, []); for i=1:1024 % Stitch the real and imaginary data into a single row HT(idx_channel,i) = HT_real(1,i); HT(idx_channel,i+1024) = HT_imag(1,i); end end save('dataset_32_32','HT'); % This is the final dataset generated. disp('done!'); % plot(channel_magnitude); % Inputs: % fc : carrier frequency in Hz % OFDM_size : FDD size % N_ver : Number of antenna in vertical array % N_hor : Number of antenna in Horizontal array % Downtilt_angle : Antenna downtilt angle in degree % UE_velocity_kmh : UE speed in km/h % Channel_aging_period : Time varing channel aging in s % Output: % 4-D channel matrix( UE_antenna, BS_antenna, subcarrier, channel_idx ) % h : N_UE * N_BS * OFDM_size * 200 function h = mmWave_OFDM_TVchannel_generation(fc,BW,OFDM_size,N_ver,N_hor,Downtilt_angle,UE_velocity_kmh,Channel_aging_period); % Simulation parameters setting Par = qd_simulation_parameters; Par.center_frequency = fc; Par.sample_density = 2; Par.use_3GPP_baseline = 1; % Simulation track setting Track = qd_track('linear',199_UE_velocity_kmh/3.6_Channel_aging_period,unifrnd(-pi, pi)); Track.initial_position = [unifrnd(50,100);unifrnd(50,100);1.7]; Track.scenario = '3GPP_38.901_UMa_NLOS'; Track.interpolate_positions(Par.samples_per_meter); % Simulation layout Layout = qd_layout(Par); Layout.tx_array = qd_arrayant('3gpp-mmw',N_ver,N_hor,fc,1,Downtilt_angle,0.5,1,1,[],[]); Layout.rx_array = qd_arrayant('dipole'); Layout.tx_position(3) = 25; Layout.rx_track = Track; % Get Channel cn = Layout.get_channels; Track.set_speed(UE_velocity_kmh/3.6); dist = Track.interpolate_movement(Channel_aging_period); ci = cn.interpolate(dist); h = ci.fr(BW, OFDM_size); size(h) end I don't know whether you handle the generated channel data like this, but I really want to address this question. I would appreciate it if you could share your channel data processed code with me. Thank you again! Best wishes.

Thank you for your response. Your code for channel generation is excellent, but I found a minor issue that need fixing.

In your Matlab code, (1) a = h(UE_antenna_idx,:,:,idx_channel); % get a channel data (2) a = fft2(a); % 2D-FFT of the channel data (3) a = squeeze(a); % reshape 1×32×1024 to 32×1024 (4) HT_a = a(:,1:32); % Capture the first 32 columns

variable a generated by the line (1) has a shape of (1, 32, 1024). fft2 function performs a Fourier transform along the first two dimensions (in this case, 1 and 32). This means that the Fourier transform is not applied along the subcarrier dimension (1024). To address this, you can simply swap lines (2) and (3) to reshape a to (32, 1024) first, allowing the fft2 function to operate along the correct dimensions. Also, you can capture last 32 columns in line (4) HT_z = a(:, 1024-31:1024) to get effective elements.

If you have any questions feel free to ask me. Thank you very much!

Thanks a lot for your advices! I made changes to the code as you suggested, and the resulting data matrix was able to remain sparstic.

image image

Thank you again!

Best wishes!