How to Convert an "int8" baseband IQ signal into "int16" in MATLAB?

조회 수: 6 (최근 30일)
Imtiaz nabi
Imtiaz nabi 2022년 11월 16일
답변: Suraj Kumar 2025년 2월 18일
Hi there,
I hope you will be doing fine. I am a GNSS researcher and a PhD candidate. I am working on GPS L1 C/A baseband signal and have recorded an IF signal for 120 seconds using RTL SDR. The signal file is saved in int8 and now I would like to convert it into int16 or int32.
Is it possible?
If yes how to do it? of course I wouldn't ask people to write a full algorithm for me but I just need a track. BTW I have also attached a signal file for those who want to give it a try.
Thank you so much in advance

답변 (1개)

Suraj Kumar
Suraj Kumar 2025년 2월 18일
To convert a baseband IQ signal stored in a .bin file from int8 data type to int16 using MATLAB, you can refer to the following steps:
1. You can use the fopen function to open the file and fread function to read the data as int8.
2. Now you can convert the data into int16 data type by using the int16 function in MATLAB.
You can refer to the following code snippet for better understanding:
fileID = fopen(filePath, 'r');
dataInt8 = fread(fileID, 'int8');
fclose(fileID);
dataInt16 = int16(dataInt8);
To learn more about converting the data type in MATLAB, you can refer to the following documentation:

카테고리

Help CenterFile Exchange에서 Downloads에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by