Search code examples
matlabgnuradiognuradio-companion

How to use a MATLAB file as a file source in GNU Radio


I designed a filter and applied it to a random noise signal using SPTool in MATLAB. My noise signal was x = (1/sqrt(2))*(randn(1024,1)+j*randn(1024,1))

Once I've applied my filter to this noise signal, how can I take that filtered signal and use it as a file source in GNU Radio Companion (which I will connect to QT GUI Frequency Sink)? I tried exporting the signal using SPTool but I'm unsure what file extension I can use for GNU Radio. Thanks in advance.


Solution

  • Use fwrite with the right precision parameter that gives you float 32 binaries.

    Or just use the octave/Matlab scripts in GNU Radio that do exactly that: write raw binary data. For more info, see the GNU Radio FAQ entry on the file format. (On https://wiki.gnuradio.org )