BPSK Transceiver with ADALM-Pluto and Matlab - Page 1
Forum section: electronics / rf-microwave

author: yacinbm
author_rank: Newbie
timestamp: December 24, 2021, 04:22:42 am
content: Hi everyone!I'm currently working on implementing a BPSK transceiver with Matlab Simulink and my ADALM-Pluto.Here is a quick summary of the specs I want for my system:Bit rate: 25kbpsCarrier Frequency: 2.4GHzOversampling factor: 8Sample Rate: Bit rate*Oversampling factor=25kbps*8=200kspsFrame Length: 152bits (alternating 0s and 1s)Here is my VERY simple transmission/reception line:My Tx/Rx channels are connected together using an SMA cable in loopack. I know that my receiver is missing symbol/frame synchronization, but I'm getting a very unexpected constellation from the receiver of my Pluto (see below). I'm sending a very simple sequence of 1s and 0s modulated by BPSK, so I'm expecting to get a constellation without any points at (0,0i) and that resembles two dots centered around the origin on the Q axis.Just to be safe, I checked the constellation right before my Tx, and it has the desired shape:Here's the configuration of my Simulink blocks (bit of a crowded image, sorry!):Any help would be greatly appreciated! I've been stuck with this issue for a few days now and I can't seem to figure it outCheers from Canada!

author: yacinbm
author_rank: Newbie
timestamp: December 24, 2021, 01:05:20 pm
content: If you guys need any other details, let me know!Cheers

author: yacinbm
author_rank: Newbie
timestamp: December 24, 2021, 06:01:46 pm
content: Hey all!I went back to it this morning and got an idea. I split my transceiver module into two separate ones; one for the Tx and another for the Rx. I had the idea to try and run the models on two different computers since it could alleviate some of the computation from my desktop PC.After doing this,I FINALLY GOT SOMETHING COHERENT!I modified my previous model to use a cosine shaping filter at the Tx/Rx and after doing some phase and frequency correction, I got the constellation below! I've gotta say, I'm suprised Simulink is so sh*t at handling this sort of operations compared to GNURadio, but I have to use Matlab for this project...Next step is to try and figure out if my data was correctly sent over the air and if I can reconstruct it and the outputI have actually started doing this and I'm getting a strange result. My frame uses a 13 bits Barker code for start of frame detection. At the receiver, I capture two complete frame and run a correlation between the received signal and a 13 bits Barker code. I get some peaks in the correlation result, indicating that I have detected the sequence. That being said, I get 4 peaks, instead of the expected 2 (at most!). I'll try using a longer Barker sequence to see if that helps.Again, if you have any recommendations, please hit me up down below!Cheers

author: yacinbm
author_rank: Newbie
timestamp: December 26, 2021, 07:31:21 pm
content: Well, everything works now!If you ever need some info for something similar, don't hesitate to get in touchI was able to send a string over the air and decode it on my receiver.

author: 1design
author_rank: Regular Contributor
timestamp: December 27, 2021, 04:40:53 pm
content: Great project, what fixed the synchronization issue on the receiver?

author: yacinbm
author_rank: Newbie
timestamp: December 28, 2021, 03:59:58 pm
content: It was mostly the fact that Simulink couldn't handle the computation for the transmitter/receiver on a single PC (I think!) that was causing my synchronization woes.When I moved it to a second computer for the receiver, the constellation got a lot better (no more (0,0i) points). The synchronization issues at the receiver were handled using 3 different blocks:A coarse frequency estimator and frequency offset to try and correct for the inaccuracies of the ADALM-Pluto internal oscillator. This made the constellation rotate a little less around the origin.A carrier synchronizer configured for BPSK and for the correct oversampling factor. This concentrated the constellation to the real axis, but didn't have the "two dot" shape at -1 and +1.A symbol synchronizer block to sample the symbol at the correct phase. This finally gave me my final constellation with two circular points at +/-1, as expected for BPSK.The rest of the synchronization was for the binary frame itself, in order to detect when it started. For this reason, I started my data frame with a 13bit barker code, which has the characteristic of having an auto-correlation value of 13 when and only when it has a zero sample offset. So, at the receiver, I made sure to capture a number of samples equal to the length of two whole frames. This ensured that I had at least a complete frame in every capture. Then, I simply ran a correlation on the captured data and a 13bit barker code, and measured where it was equal to 13 (or close to, because my symbols weren't perfect +/-1). You can do this with a Preamble Detector block in Simulink, which returns the index of the end of the detected preamble. Then, it was only a question of extracting the data from the frame andVoilà!My simple BPSK ASCII transceiver was complete!I still have a bit of an issue at the moment though. There is a phase ambiguity because of the PLLs used for synchronization (the synchronization is valid for both pi and 0 degrees in BPSK). The effect is that sometimes, all the bits in my frame are flipped, so instead of receiving 001101, I would receive 110010. I'll get back in touch if I find an elegant solutionP.S.: This will be used as an introductory project for students at Uni, so I don't think I'm allowed to share my files. That being said, if you're working on something similar and are having some issues, please don't hesitate to get in touch! I couldn't find a lot of info on how to do this with BPSK rather than QPSK.Cheers

author: gf
author_rank: Super Contributor
timestamp: December 28, 2021, 04:26:18 pm
content: Maybe it helps to take a look at theGNU Radio BPSK example.

author: stranger452
author_rank: Newbie
timestamp: June 07, 2023, 07:38:36 am
content: Hi!Yacinbmcan you send me the simulink file of that bpsk Transmitter??