TPM test signal generator

he TPM firmware includes a test signal generator, which can be used to generate arificial signals. These signals are deterministic, but realistic enough to exercise all beamformer firmware components.

The signal is composed of:
  • two tones, with independently programmable amplitude, frequency and phase

  • a pseudorandom Gaussian noise generator, with programmable amplitude.

  • a periodic pulse

The signals can be synchronized among TPMs, simulating a coherent source in the sky, or can be incoherent between TPMs. In each TPM the signal is the same for all antennas, and can substitute the signal from the ADC on a per antenna basis. As the signal is inserted before the static delay equalization, a static delay can be programmed on a per signal (antenna,polarization) basis. This can be used to simulate a source at a specific, fixed, direction in the sky.

The generator can be accessed using a specific interface in the Tile and [TODO] Station Tango devices

Test signals characteristics

The signals are generated internally using digital techniques. Therefore they present limitations due to finite internal representation. These signals are multiplied by an integer gain in the range 0-255, summed together, and the result is rounded to 8 bits.

Sinusoidal tone

The sinusoidal tones are generated by two identical direct digital synthesizers. The synthesizer produces a cosine function, with programmable initial phase (this feature is not currently implemented in the Tango device, the initial phase is always zero) and an amplitude of 127 units. The resolution of the cosine function is 2048 points per turn.

The finite number of bits in the representation creates extra noise at a level of about 50 dB below the fundamental, but harmonics are spread uniformly if the tone frequency is not in a small integer ratio with the sampling clock. Quantization in the lookup table produces harmonics at less than -70 dBc.

The frequency is internally specified using 30 bits of resolution, with a frequency step of approximately 0.75 Hz.

Pseudo random noise generator

The white noise is obtained by summing eight 8 bit uniform pseudorandom integers. The resulting signal has a quasi-Gaussian distribution, with zero mean and a RMS value of about 216 units. Difference in the distribution density with respect to a true Gaussian is at the percent level.

Comb generator

The comb generator introduces one or more pulses regularly spaced in the ADC frame. A pulse is always generated in the first sample of the frame, the others have a period which is a divisor of 864. In this ways pulses repeat always in the same position in each frame. The comb generator is useful to verify the delay generated by the digital chain, including anly element in the station and pulsar beamformers.

Tile device interface

The Tile device exposes the generator using a command “ConfigureTestGenerator”, which accepts a json description of the test generator setting, and the attribute “TestGeneratorMode”, which is True if some input channels are using the test generator.

The command can be used only in MAINTENANCE AdminMode. When the Tile AdminMode is changed from MAINTENANCE, the generator is always turned off.

ConfigureTestGenerator command

The json command parameter uses the following fields. All fields are optional, with a default behavior if the field is omitted. An empty json string disables the generator.

  • ToneFrequency: first tone frequency, in Hz. The frequency is rounded to the resolution of the generator. If this is not specified, the tone generator is disabled.

  • ToneAmplitude: peak tone amplitude, normalized to 31.875 ADC units. The amplitude is rounded to 1/8 ADC unit. Default is 1.0. A value of -1.0 keeps the previously set value.

  • Tone2Frequency: frequency for the second tone. Same as tone_frequency.

  • Tone2Amplitude: peak tone amplitude for the second tone. Same as tone_amplitude.

  • NoiseAmplitude: RMS amplitude of the pseudorandom Gaussian white noise, normalized to 26.03 ADC units.

  • PulseFrequency: frequency of the periodic pulse. A code in the range 0 to 7, corresponding to (16, 12, 8, 6, 4, 3, 2) times the ADC frame frequency.

  • PulseAmplitude: peak amplitude of the periodic pulse, normalized to 127 ADC units. Default is 1.0. A value of -1.0 keeps the previously set value.

  • SetTime: time at which the generator is set, for synchronization among different TPMs.

  • AdcChannels: list of adc channels which will be substituted with the test signal. Channels are numbered from 0 to 31, with each even-odd pair (2N, 2N+1) corresponding to X and Y polarizations of channel N. Default to all signals if at least one generator is specified, or none if no generator is specified (empty json string).

The delay in each channel is set using the SetTimeDelays command.

SetTime is used to synchronize the generator across tiles. It must be in the future, and is expressed in units of 256 frames (0.27648 ms). Current time can be retrieved as the fpga1_time/fpga2_time attribute from the tile.

Station device interface

The Station device exposes the generator using a command “ConfigureTestGenerator”, which accepts a json description of the test generator setting, and the attribute “TestGeneratorMode”, which is True if the test generator is active.

The command can be used only in MAINTENANCE AdminMode. When the Tile AdminMode is changed from MAINTENANCE, the generator is always turned off.

ConfigureTestGenerator command

The json command parameter uses the same fields as for the corresponding Tile device command, with the exception of the adc_channels field, which is not present, and with the test_source_position, which is described below. All fields are optional, with a default behavior if the field is omitted. The same test signal configuration is propagated to all the tiles composing the station, using all ADC channels. An empty JSON string disables the generator.

  • test_source_position: position of the source, in Altitude-Azimut coordinates. This is used to set the individual delays for all antennas, rounded to +/- 0.5 ADC samples (0.625 ns). Default is at zenith, with all delays set to zero. Note that this overrides the cable delay (as the signal is injected after any physical cable). Proper cable delay must be re-specified to tiles when the generator is disabled.