Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Comaprison on 2 files

Status
Not open for further replies.

Maitry

Junior Member level 1
Joined
Sep 17, 2020
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
127
Hello support team,

I have 2 different file for which i need to compare the number of error bits for ultimate BER comparison.
I have tried attached MATLAB code. My Tx file is 1.txt. But when I import the 1.txt file in matlab as per written code. MATLAB is not properly understand the 1.txt file. But when I import the file like txdata1.txt , then it import as per required. As you can see, my file 1.txt is too big. Is there something I am doing wrong. plz guide. I want to import the file like 1.txt(transmitted file ) and similar received file (with some errors) . How can I compare the file like this(1.txt ) with the similar file(with errors)

Awaited your guidance.
 

Attachments

  • MATLAB.txt
    514 bytes · Views: 233
  • 1.txt
    544.9 KB · Views: 228
  • txdata1.txt
    1.4 KB · Views: 229

Hi,

txdta1.txt shows a bitstream where each bit is a vector element (each bit in a separate row), in 1.txt your bit stream is a single number (no delimiter e.g. newline, between the individual bits), which is too large to be handled by MATLAB.

For a "low" value this should work [1]. It seems your bitstream is to long to result in a single integer.

This simple code should help to convert your single "value" (column, row) file into a vector.

Code:
d = fopen('1.txt'); 
data = textscan(d,'%s','delimiter','\n'); 
fclose(d);

data = data{1};

N = 5E5; % number of bits representing your single value

for ii=1:N
   x(ii) = str2double(data{1}(ii));
end


[1] https://www.mathworks.com/matlabcentral/answers/85455-how-to-convert-a-bit-sequence-to-array

BR
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top