-
Notifications
You must be signed in to change notification settings - Fork 881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to open *.raw (float 32) #848
Comments
What complex format has the .raw file? 2xint8, 2xuint8, 2xint16, ...? Please rename it accordingly, see https://github.com/jopohl/urh/wiki/Supported-signal-file-formats |
It is a Float 32 in gnuradio, so it should be |
This sounds rather like a bug in GNU Radio and/or a problem with your flow-graph. This error indicates that the file gets not completely written by the application. |
As a side question: Why do you capture in GR and not directly in URH? |
I thought so too, however I can open and display it with a simple
That is because I need to set up more options during capture (e.g. enable direct sampling mode, set RF gain) and also add filters if necessary. |
That only gives you a stream of float32, not complex. Try |
I have tried with |
Thank you for providing the file! Seems like numpy just skips the last sample to avoid a conversion error. I implemented the same behavior in #849. |
Expected Behavior
Open *.raw file without exception.
Actual Behavior
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/urh/controller/MainController.py", line 564, in on_open_recent_action_triggered
self.add_files(FileOperator.uncompress_archives([action.data()], QDir.tempPath()))
File "/usr/lib/python3.9/site-packages/urh/controller/MainController.py", line 408, in add_files
self.add_signalfile(filename, group_id, enforce_sample_rate=enforce_sample_rate)
File "/usr/lib/python3.9/site-packages/urh/controller/MainController.py", line 285, in add_signalfile
signal = Signal(filename, sig_name, sample_rate=sample_rate)
File "/usr/lib/python3.9/site-packages/urh/signalprocessing/Signal.py", line 75, in init
self.__load_complex_file(filename)
File "/usr/lib/python3.9/site-packages/urh/signalprocessing/Signal.py", line 83, in __load_complex_file
self.iq_array = IQArray.from_file(filename)
File "/usr/lib/python3.9/site-packages/urh/signalprocessing/IQArray.py", line 203, in from_file
return IQArray(data=np.fromfile(filename, dtype=np.float32))
File "/usr/lib/python3.9/site-packages/urh/signalprocessing/IQArray.py", line 17, in init
self.__data = self.convert_array_to_iq(data)
File "/usr/lib/python3.9/site-packages/urh/signalprocessing/IQArray.py", line 212, in convert_array_to_iq
return arr.reshape((-1, 2), order="C")
ValueError: cannot reshape array of size 12717211 into shape (2)
Comment: maybe this happens because gnuradio does not save an even number of samples and the reshape cannot take place so the fix might be easy.
Steps To Reproduce
Platform Specifications
The text was updated successfully, but these errors were encountered: