Using BladeRF 2.0 A4 in simultaneous MIMO with Matlab (not Matlab Simulink)

Discussions related to schematic capture, PCB layout, signal integrity, and RF development
Post Reply
Alexandre95110
Posts: 1
Joined: Thu Jan 11, 2024 12:39 am

Using BladeRF 2.0 A4 in simultaneous MIMO with Matlab (not Matlab Simulink)

Post by Alexandre95110 »

Hello everyone

I'm writing here in the hope of finding a solution.

For more than 1 year now, I've been trying to run a BladeRF A4 in MIMO mode using MATLAB (not MATLAB Simulink).
I've tried modifying the data format using the LibBladeRF 2.5.0 library.

I also tried using the BladeRF_MIMO scripts available on GitHub. However, it's impossible to do simultaneous MIMO transmission and reception.

Could you help me, what do I have to modify in the MATLAB scripts? By deciphering the LibBladeRF library, it seems that MIMO is totally possible.

I'm working on Windows Installer version 2023-12.

Thank you in advance for your help.
duringaccurate
Posts: 2
Joined: Mon Feb 12, 2024 8:15 pm

Re: Using BladeRF 2.0 A4 in simultaneous MIMO with Matlab (not Matlab Simulink)

Post by duringaccurate »

Is your version of MATLAB compatible with the BladeRF[right]space bar clicker[/right] library and MIMO functionality?
missileshower
Posts: 1
Joined: Wed Sep 25, 2024 9:26 pm

Re: Using BladeRF 2.0 A4 in simultaneous MIMO with Matlab (not Matlab Simulink)

Post by missileshower »

It sounds like you're encountering some difficulty in setting up MIMO mode for simultaneous transmission and reception with your BladeRF A4 in MATLAB. MIMO mode is possible with the BladeRF, but ensuring the right configurations can be challenging.

Here are some steps and tips you can try to modify your MATLAB scripts:

1. Check the BladeRF MIMO configuration:
Ensure that the MIMO channels are correctly initialized for both transmit and receive. Typically, you'll need to configure channels 0 and 1 for transmission, and channels 2 and 3 for reception, or the appropriate setup for your BladeRF device.
Use the bladerf_set_channel function to define the channels for both transmit and receive paths.
2. Use Full-Duplex Mode:
The BladeRF can operate in full-duplex mode, but you need to make sure this is enabled in your MATLAB scripts. This involves making sure that both transmit and receive functions are running in parallel without blocking each other.
Ensure that bladerf_sync_tx and bladerf_sync_rx calls are properly synchronized. You might need to handle this through threading in MATLAB (using parfeval or similar functions to run these concurrently).
3. Adjust Buffers and Sync:
MIMO setups can sometimes fail due to buffer underflows or overflows. Check that the buffers for both transmit and receive are large enough, and adjust the buffer size in your configuration:
matlab
Sao chép mã
bladerf_sync_config(dev, BLADERF_TX, BLADERF_FORMAT_SC16_Q11, num_buffers, buffer_size, num_transfers, timeout);
bladerf_sync_config(dev, BLADERF_RX, BLADERF_FORMAT_SC16_Q11, num_buffers, buffer_size, num_transfers, timeout);
You might need to experiment with num_buffers and buffer_size to prevent underflows.
4. Clock Synchronization:
Since you are working with MIMO, clock synchronization between the channels is important. Use bladerf_set_clock_source to ensure that both TX and RX channels are synced to the same clock.
5. MATLAB BladeRF MIMO GitHub Scripts:
If the GitHub scripts you tried are not working as expected, you may need to dig deeper into how they initialize and configure MIMO. Look for sections that configure the channels and synchronization. You might need to add some lines to ensure correct simultaneous execution.
6. LibBladeRF Adjustments:
If you've already deciphered parts of the LibBladeRF library, you may want to explore functions such as bladerf_enable_module and bladerf_set_sampling to check if both TX and RX modules are correctly set for MIMO.
Post Reply