Wideband Digitizer in MATLAB
In order to analyze the spectrum, similar to the way it has been done in the GSM Channelizer design, one can also utilize MATLAB along with the Nutaq product. Moreover, it is also up to the designers to decide whether they want to carry out the entire signal processing within the FPGA, as done above, or within MATLAB, as we explain in the discussion that follows. One way to process data efficiently in MATLAB is to save data in the onboard DDR3-SODIMM RAM and then transfer it to MATLAB for further processing. Each Nutaq product comes with a 4 GB DDR-3 SODIMM RAM, which can be used to store data at very high speeds (Maximum throughput of up to 5.7 GBps). Then, the saved data can be imported into the host machine for further processing in MATLAB.
For the discussion henceforth, we use the WR8G RF front-end along with PicoDigitier250, i.e., the hardware setup is the same as it was for the GSM Channelizer. The sampling rate was set to 250 Msps. Instead of performing signal processing within the FPGA, we use MATLAB for performing the FFT operation and for plotting the results. The signal received by the RF front-end is directly saved in the onboard RAM, i.e., the outputs of the two green ADC blocks, shown on the left in Fig. 1 are sent directly to the DDR3 RAM. Then, Nutaq’s C-APIs, which come as part of the Nutaq software, are used to import the data onto the host machine, where it is saved as a .bin file. The contents of the .bin file are then loaded into MATLAB, using the ‘fopen’ and ‘fread’ MATLAB functions.
Once the data has been imported into MATLAB, the next step is to organize it such that the I and Q samples are aligned with each other. To this end, for this example, we scanned the spectrum and imported 65536 bytes of data to the host machine. To calculate the right frame size, i.e., number of samples per channel, we note that the setup consists of two channels, I and Q. Furthermore, each sample consists of 16-bits (FPGA configuration), and 8 bits form a byte, therefore, the total number of samples per channel can be found by dividing the total number of bytes by 4, which in this case, comes to 16384. Using this value, the ‘fpgaacqgetframes’ function, provided by Nutaq as part of its BAS, can be used to split the data into I and Q samples. The fpgaacqgetframes fuction works in a similar manner as the Deinterleave block used in GNURadio, as shown in Fig. 3. Once the I and Q samples have been separated, the final step is to combine them to form complex samples, using ‘complex’ function provided by MATLAB. At this stage, we are ready to proceed with performing the FFT. As a first step, we plot the time domain signal, using the below commands:
- Fs = 250e6; %sampling rate
- Ts = 1/Fs; %sampling time interval
- X_data = source_data; %After the conversion to complex
- n = length(X_data); %number of samples
- t = 0:Ts:(n * Ts)-Ts; %sampling period
- %plot the original curve in the time domain
Execution of the above code results in the display of time domain signals, as shown below: