Sonntag, 28. Juni 2015

Radio astronomy with FDM-S2

FDM-S2 Support

Unfortunately the software supplied by ELAD for the FDM-S2 did not cover my need for radio astronomy. There is no option there for saving permanently scans, in for example csv files, therefore you are forced to work with wav file, what requires a great amount of storage. On the ELAD site http://sdr.eladit.com/FDM-S2%20Sampler/ you can find several DLLs for taking IQ samples, which you can posteriorly transform to frequency domain and finally save in csv files. This was the target of this software.

Block Diagramm of the software

Possible application

FMD-S2-Samples

This application controls the FDM-S2 and works as an interface for the Callback routine. Thanks to the document "SPECIFICATION FOR EXTERNAL USE of I/O DLLs TO COMMUNICATE TO FDM DEVICE" it was possible to implement a code for making all setting prior to calling the Callback function. This was compiled with Visual Studio Express VC10. Via config file and the option -c you can set following parameters:

Sampler  
Set the DLL for the sampling. Every DLL works with a fixed sampling rate. ELAD supplies six DLLs:
  • ExtIO_ELAD_FDMS2_192k_v3_04.dll for 192 k Sample output data rate.
  • ExtIO_ELAD_FDMS2_384k_v3_04.dll for 384 k Sample output data rate. 
  • ExtIO_ELAD_FDMS2_768k_v3_04.dll for 768 k Sample output data rate.
  • ExtIO_ELAD_FDMS2_1536k_v3_04.dll for 1536 k Sample output data rate. 
  • ExtIO_ELAD_FDMS2_3072k_v3_04.dll for 3072 k Sample output data rate. 
  • ExtIO_ELAD_FDMS2_6144k_v3_04.dll for 6144 k Sample output data rate.


Every DLL returns a fixed amount of samples:
  • For 192k DLL return value is 12288 complex samples.
  • For 384k DLL return value is 12288 complex samples.
  • For 768k DLL return value is 12288 complex samples.
  • For 1536k DLL return value is 12288 complex samples.
  • For 3072k DLL return value is 49152 complex samples.
  • For 6144k DLL return value is 49152 complex samples.

Scan Frequency
Initial sampling frequency. The bandwidth is determined by the chosen DLL and defines the end frequency.
Permanence
This value sets the amount of sets of complex samples we want to take for every scan. It means, for a value of 300 and DLL ExtIO_ELAD_FDMS2_6144k_v3_04.dll you get 300x49152=14.7 millions of samples.
Shift Counter
This parameter sets the amount of frequency shifting after having taken the required amount of samples for every given initial frequency (determined by permanence). The offset for shifting is just a part of the bandwidth and it is configurable in the file fdm-s2-samples.cpp under the struct fdm. All parameters associated with a DLL are defined in this structure.

Download






FFT of IQ Data: fdm_s2_fft.py

This application reads the IQ samples file/s, extracts all parameter set by fdb-s2-samples coded in a binary header and makes a DSP (Power Spectral Density, matlab), for getting finally the frequency spectrum. The FFT settings can be changed in the file fdm_s2_fft.py. After this, the spectrum will be plotted and all Frequency-Power pairs will be written in a csv file, for any posterior use.
The application was implemented with Python 2.7. Python supplies an easy way of installing packages by demand, so you just have to call the script and all needed modules not installed yet will print an information error. You can bit a bit get the required environment for this application.


Used variables are predefined but will be overwritten with the information found in the decoded binray header of the IQ samples file. Hier the variables:

FREQUENCY_DEFAULT = 30000000                            #30MHz
NFFT = 8192                                                                          # FFT Size
BLOCK = 12288                                                                   #FDM-S2
BANDBREITE_384K = 100000                                        #Hz
BANDBREITE_3M = 700000                                            #Hz
BANDBREITE_6M = 3000000                                         #Hz
PERMANENCE = 20                                                           # Permanence in fdm-s2-samples.cpp
SHIFT_CYCLE = 10                                                            # Shift Counter in fdm-s2-samples.cpp
BANDBREITE = BANDBREITE_6M          
SAMPLE_RATE = 384000                                                #With the FDM-S2 384K DLL for 32Bit
                                                                                                 # see "Sample output data rate" for every FDM-S2 DLL 
GAUSS_FILTER_FACTOR = 2                                        #Smoothing of Power Values. Factor 2 is very light.
PATH_OF_SAMPLING_FILES = ".\\RawFiles\\"          #Input Files
PATH_OF_OUTPUT_FILE = ".\\"                     
START_FREQ = 1419.6                                                    # Start Frequency for Output Data
END_FREQ = 1421.3                                                         # End Frequency for Output Data


Change the following code line. because this was implemented for taking into account the Down Converting shift on my own system
handle.write("{0},{1}\n".format((1392+freq/1000000), smooth_gauss[smooth_cnt]))


Download



Keine Kommentare:

Kommentar veröffentlichen