Channelizer monitoring with VSI4SPEC software
(C) 12/2009 Jan Wagner
Introduction
This software was written at Metsähovi for the Yebes observatory, Spain, to monitor several baseband channels in real time at rates of at least 32Msample/s per channel.
The vsi4spec real-time spectrometer software uses a Metsähovi VSIB card to capture 4, 8 or 16-channel 2-bit data directly from a sampler with a VSI interface. For legacy systems you may need a converter such as the Metsähovi VSIC Converter or its close relative, the Haystack VSI-4 Sampler Adapter Board (Haystack memo #016 on vsi4). The name of the program comes from the fact that Yebes is using the VSI-4 as the data source.
Operation
The vsi4spec integrates data from four or eight channels over a specified arbitrary time period.
At the end of every integration period, the time-integrated power spectra of every channel are output into an binary file in a packed real-imag format. The output file may be monitored and plotted in your favorite environment, for example with Python scipy.
The length of the FFT i.e. the spectral resolution is practically arbitrary. The smallest size is 1024 points. Sizes up to 2 million (2^20) points per each channel have been tested to operate in real-time with four channels.
The high speed comes from utilizing the fact that the time-integrated FFTs are identical to the single FFT of time-integrated data. The same fast scheme can be applied to window-overlap-add methods as well. Windowing is not implemented in this first software version.
Performance
In its current version, vsi4spec can integrate (without problems or data loss) four channels each 32 Ms/s each (VSI@256 Mbps). These four channels are handled by a single CPU core. Using one second integration, four channels and 64k FFT points (2^16 points), yielding a 488 Hertz resolution for every channel, the CPU load was only 22% on our oldest 3.2GHz Pentium4 computer. Increasing this resolution to 1M FFT points (2^20 points, 30.5 Hertz resolution on every channel) increased the CPU load on the same computer to still only 40%. Similar figures were seen on a slightly newer AMD Opteron 2212 processor.
We conclude that even old Pentium4 and AMD2212 processors handle 512 Mbps rates (8 channels, 32 Ms/s/ch, 2-bit data) in real-time without data loss and at very high spectral resolution.
Requirements
- VSI-H data source (VSIC converter or VSI-4 in MarkIV Sampler)
- VSIB board and drivers
- Intel IPP library 5.x or 6.x, free non-commercial edition
- VSI4SPEC source code (version 1.0)
Usage
oper@pertinax:/usr/src/vsi4spec$ ./vsi4spec
Usage: vsi4spec <fftlen> <samplerate> <inttime> <4|8|16>
where fftlen is the length of the FFT, at least 1024 points
samplerate is the sampling rate of each channel in Hertz
inttime is the integration time in seconds
4|8|16 is the number of channels to capture
The usage is quite self-explanatory. The sampling rate is determined by other hardware, the command line argument that you specify is for information only and has no effect on the true sampling rate. Of course you should specify the correct rate. Typically it is 32e6.
Example: vsi4spec $((2**20)) 32e6 2.5 8 to capture eight channels and output new integrated spectra with 1M FFt points every ~2.5 seconds. The actual integration time may be slightly shorter than specified, because an integer multiple of FFT points (samples) has to fit into the integration time.
Note that in the 16-channel case the PCI Bus is too slow for sustaining a 32e6 sampling rate. Vsi4spec automatically sets VSIB data decimation to 2:1 which results in a sampling rate of 16e6, i.e. you are limited to 8 MHz bandwidth if you want to monitor all 16 channels.
Limitations and future
Currently vsi4spec is single-threaded. If more processing such as overlap-add and windowing is going to be added in some future vsi4spec version, the 8-channel processing may have to be split into two 4-channel processing threads that run on two CPU cores. Another limitation is that currently the FFT uses Intel Performance Primitives. Unlike the FFTW library, the IPP FFT does not take advantage of multi-core CPUs. For very high spectral resultion it may be advisable to adapt FFTW. For integer Hertz spectral resolution one should use DFT instead.
At the moment, vsi4spec accepts only VSIB data input. It is possible to extend support to Mark5B+ VSI I/O board input as well.
In the future, input data could also be received from the network in say a 2048 Mbps multicast data stream (512 MHz wide single IF at 2-bit sampling).
Should you want ASCII output files with Magnitude and Phase information, you can replace the normal binary write-out in vsi4spec.c with
//Data: [reDC reNyq re1 im1 re2 im2 ...] with length 'fftlen' for (i=0; i<fftlen; i++) { if ((i%2)==0) { for (j=0; j<numprocessedchannels; j++) { double magnitude = finalSpectrum[j][i]; double phase = 0; if (i!=0) { double re = finalSpectrum[j][i]; double im = finalSpectrum[j][i+1]; magnitude = sqrt(re*re + im*im); phase = atan2(im, re) * (180/M_PI); } magnitude /= (numberOfStacks*fftstacklen); fprintf(fOut, "%g ", magnitude); // fprintf(fOut, "%g %g \t", magnitude, phase); } } fprintf(fOut, "\n"); } //last, write out nyquist from imag part of first complex value for (j=0; j<numprocessedchannels; j++) { fprintf(fOut, "%g ", finalSpectrum[j][1]); } fprintf(fOut, "\n");
The default output however is binary [reDC reNyq re1 im1 re2 im2 ...] with length 'fftlen' of 32-bit float values.