A non-zero value would indicate to me that the file is open and you can then read it. Try
A = fread(fid,'float32') and see if you get some data in A. If so, keep going with the commands using "fid" wherever "InFileID" shows up. You don't need to type the percent sign (%) or anything after it. That is a comment. Jeff ________________________________ From: AKINYELE ITAMAKINDE <[email protected]> Sent: Wednesday, April 22, 2020 10:44 AM To: Jeff S <[email protected]> Subject: Re: [USRP-users] Conversion of .dat file to a readable data using GNU octave Jeff, Thank you for helping me out. I am also sorry for putting you through this stress. This is what I got now: >> fid = fopen('/home/afe/akin .dat') fid = 28 >> Is this right? if yes, should I now follow this command below? >> InFileID = fopen('myfile.dat'); >> A = fread(InFileID,'float32') >> fclose(InFileID); >> B = [A(1:2:end), A(2:2:end)]; % Split out Re & Imag >> plot(B) On Wed, Apr 22, 2020 at 2:13 PM Jeff S <[email protected]<mailto:[email protected]>> wrote: I would suspect that your file is not getting opened in the fopen command. You need to either be in the same directory as the your data file, or add the path to the file in the fopen command, e.g.: >> fid = fopen('/home/user/somewhere/yourFileName.yourExtention') Leave off the semicolon at the end of the command and make sure you get something that is not -1. If you are getting a -1, non of the other commands are going to work. Jeff ________________________________ From: AKINYELE ITAMAKINDE <[email protected]<mailto:[email protected]>> Sent: Wednesday, April 22, 2020 9:06 AM To: Jeff S <[email protected]<mailto:[email protected]>> Subject: Re: [USRP-users] Conversion of .dat file to a readable data using GNU octave Yea, I performed all the commands on the GNU Octave command window. These are what I got: >> InFileID = fopen('myfile.dat'); >> A = fread(InFileID,'float32'); error: fread: invalid stream number = -1 >> A = fread(InFileID,'float32'); % Read in per Kyle's description error: fread: invalid stream number = -1 >> A = fread(InFileID,'float32'); % Read error: fread: invalid stream number = -1 >> fclose(InFileID); error: fclose: invalid stream number = -1 >> B = [A(1:2:end), A(2:2:end)]; % Split out Re & Imag error: invalid use of end >> plot(B) error: 'B' undefined near line 1 column 7 I don't know where the problem lies. I attached the .dat file from the file sink for you to see. thanks On Tue, Apr 21, 2020 at 4:57 PM Jeff S <[email protected]<mailto:[email protected]>> wrote: The commands I had in my reply pertain only to use in the GNU Octave command window. As for the GNURadio Companion flow graphs you attached, I'm not sure where the question is. That'll have to be someone more advanced than my novice self. I usually have recorded data by going from a USRP Source directly to a File Sink to obtain RF complex data like Kyle described. I then move to GNU Octave to plot parts of that data using the commands I had given. Jeff ________________________________ From: AKINYELE ITAMAKINDE <[email protected]<mailto:[email protected]>> Sent: Tuesday, April 21, 2020 11:06 AM To: Jeff S <[email protected]<mailto:[email protected]>> Subject: Re: [USRP-users] Conversion of .dat file to a readable data using GNU octave Jeff, Thanks for the reply. I have tried this, it did not work. Maybe i dont i know how to use and where to use the lines. I am new to the softwares. I need a line by line procedure of the solution. I attached the transmitter and receiver flow graph of the channel sounding sliding correlator for more understanding of what I want to achieve. Thanks On Mon, Apr 20, 2020 at 6:25 PM Jeff S <[email protected]<mailto:[email protected]>> wrote: Kyle is correct. And to be specific example (since I like them, step by step), I do essentially the same thing like: >> InFileID = fopen('myfile.dat'); >> A = fread(InFileID,'float32'); % Read in per Kyle's description >> fclose(InFileID); >> B = [A(1:2:end), A(2:2:end)]; % Split out Re & Imag >> plot(B) Jeff ________________________________ From: USRP-users <[email protected]<mailto:[email protected]>> on behalf of Kyle A Logue via USRP-users <[email protected]<mailto:[email protected]>> Sent: Monday, April 20, 2020 12:27 PM To: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>; AKINYELE ITAMAKINDE <[email protected]<mailto:[email protected]>> Subject: Re: [USRP-users] Conversion of .dat file to a readable data using GNU octave Assuming you have your file sink configured to complex, the data (which you shouldn't just save as .dat - consider .fc32 or sigmf) should simply be interleaved float32. So it looks like [(float32 real), (float32 imag), (float32 real), (float32 imag), ... ] in python you can read that w/`np.fromfile(xyz, dtype=np.complex64)`. There must be an equivalent in octave. Kyle Logue Engineering Manager ⚝ Comm Software Implementation Dept The Aerospace Corporation ________________________________ From: USRP-users <[email protected]<mailto:[email protected]>> on behalf of AKINYELE ITAMAKINDE via USRP-users <[email protected]<mailto:[email protected]>> Sent: Wednesday, April 15, 2020 07:30 To: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>> Subject: [USRP-users] Conversion of .dat file to a readable data using GNU octave I am working on channel sounding using USRP and GNU radio platforms. I am experiencing difficulty in converting the .dat file of sink file at receiver of flow graph into readable data using GNU octave. Can somebody help me to achieve this? Thanks
_______________________________________________ USRP-users mailing list [email protected] http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
